diff options
author | brkirch <brkirch@users.noreply.github.com> | 2023-02-01 10:23:58 +0000 |
---|---|---|
committer | brkirch <brkirch@users.noreply.github.com> | 2023-02-01 10:23:58 +0000 |
commit | 7738c057ce938ca5c5a53a95e2023d3bcf14f06a (patch) | |
tree | 274a9cacf72fa46615799e1fb3ea558ad4fe9060 /modules | |
parent | 2c1bb46c7ad5b4536f6587d327a03f0ff7811c5d (diff) | |
download | stable-diffusion-webui-gfx803-7738c057ce938ca5c5a53a95e2023d3bcf14f06a.tar.gz stable-diffusion-webui-gfx803-7738c057ce938ca5c5a53a95e2023d3bcf14f06a.tar.bz2 stable-diffusion-webui-gfx803-7738c057ce938ca5c5a53a95e2023d3bcf14f06a.zip |
MPS fix is still needed :(
Apparently I did not test with large enough images to trigger the bug with torch.narrow on MPS
Diffstat (limited to 'modules')
-rw-r--r-- | modules/devices.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/devices.py b/modules/devices.py index 655ca1d3..f4afb897 100644 --- a/modules/devices.py +++ b/modules/devices.py @@ -207,3 +207,6 @@ if has_mps(): cumsum_needs_bool_fix = not torch.BoolTensor([True,True]).to(device=torch.device("mps"), dtype=torch.int64).equal(torch.BoolTensor([True,False]).to(torch.device("mps")).cumsum(0)) torch.cumsum = lambda input, *args, **kwargs: ( cumsum_fix(input, orig_cumsum, *args, **kwargs) ) torch.Tensor.cumsum = lambda self, *args, **kwargs: ( cumsum_fix(self, orig_Tensor_cumsum, *args, **kwargs) ) + orig_narrow = torch.narrow + torch.narrow = lambda *args, **kwargs: ( orig_narrow(*args, **kwargs).clone() ) + |