aboutsummaryrefslogtreecommitdiffstats
path: root/modules/devices.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-07-11 10:49:02 +0000
committerGitHub <noreply@github.com>2023-07-11 10:49:02 +0000
commit799760ab95b0cb5bddd9971822b5ff5580923cd7 (patch)
tree5a706bd757e03227c3cd1ae1c5a026eae65107ab /modules/devices.py
parent7b833291b3ef4690ef158ee3415c2e93948acb2d (diff)
parentb85fc7187d953828340d4e3af34af46d9fc70b9e (diff)
downloadstable-diffusion-webui-gfx803-799760ab95b0cb5bddd9971822b5ff5580923cd7.tar.gz
stable-diffusion-webui-gfx803-799760ab95b0cb5bddd9971822b5ff5580923cd7.tar.bz2
stable-diffusion-webui-gfx803-799760ab95b0cb5bddd9971822b5ff5580923cd7.zip
Merge pull request #11722 from akx/mps-gc-fix
Fix MPS cache cleanup
Diffstat (limited to 'modules/devices.py')
-rw-r--r--modules/devices.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/devices.py b/modules/devices.py
index c5ad950f..57e51da3 100644
--- a/modules/devices.py
+++ b/modules/devices.py
@@ -54,8 +54,9 @@ def torch_gc():
with torch.cuda.device(get_cuda_device_string()):
torch.cuda.empty_cache()
torch.cuda.ipc_collect()
- elif has_mps() and hasattr(torch.mps, 'empty_cache'):
- torch.mps.empty_cache()
+
+ if has_mps():
+ mac_specific.torch_mps_gc()
def enable_tf32():