diff options
author | missionfloyd <missionfloyd@users.noreply.github.com> | 2023-05-26 00:53:33 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-26 00:53:33 +0000 |
commit | 6645f23c4c715b1bc704c88a499b2f4224d7f1e6 (patch) | |
tree | 6aeb51e366254fe8993856a3db341690bb39dca5 /modules/mac_specific.py | |
parent | 43bdaa2f0eda79c685792b06a2bd84c65806a48f (diff) | |
parent | a6e653be26cc05f4438145fa0082816e9fbbf5fc (diff) | |
download | stable-diffusion-webui-gfx803-6645f23c4c715b1bc704c88a499b2f4224d7f1e6.tar.gz stable-diffusion-webui-gfx803-6645f23c4c715b1bc704c88a499b2f4224d7f1e6.tar.bz2 stable-diffusion-webui-gfx803-6645f23c4c715b1bc704c88a499b2f4224d7f1e6.zip |
Merge branch 'dev' into reorder-hotkeys
Diffstat (limited to 'modules/mac_specific.py')
-rw-r--r-- | modules/mac_specific.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/mac_specific.py b/modules/mac_specific.py index 40ce2101..d74c6b95 100644 --- a/modules/mac_specific.py +++ b/modules/mac_specific.py @@ -1,6 +1,5 @@ import torch import platform -from modules import paths from modules.sd_hijack_utils import CondFunc from packaging import version @@ -43,7 +42,7 @@ if has_mps: # MPS workaround for https://github.com/pytorch/pytorch/issues/79383 CondFunc('torch.Tensor.to', lambda orig_func, self, *args, **kwargs: orig_func(self.contiguous(), *args, **kwargs), lambda _, self, *args, **kwargs: self.device.type != 'mps' and (args and isinstance(args[0], torch.device) and args[0].type == 'mps' or isinstance(kwargs.get('device'), torch.device) and kwargs['device'].type == 'mps')) - # MPS workaround for https://github.com/pytorch/pytorch/issues/80800 + # MPS workaround for https://github.com/pytorch/pytorch/issues/80800 CondFunc('torch.nn.functional.layer_norm', lambda orig_func, *args, **kwargs: orig_func(*([args[0].contiguous()] + list(args[1:])), **kwargs), lambda _, *args, **kwargs: args and isinstance(args[0], torch.Tensor) and args[0].device.type == 'mps') # MPS workaround for https://github.com/pytorch/pytorch/issues/90532 @@ -61,4 +60,4 @@ if has_mps: # MPS workaround for https://github.com/pytorch/pytorch/issues/92311 if platform.processor() == 'i386': for funcName in ['torch.argmax', 'torch.Tensor.argmax']: - CondFunc(funcName, lambda _, input, *args, **kwargs: torch.max(input.float() if input.dtype == torch.int64 else input, *args, **kwargs)[1], lambda _, input, *args, **kwargs: input.device.type == 'mps')
\ No newline at end of file + CondFunc(funcName, lambda _, input, *args, **kwargs: torch.max(input.float() if input.dtype == torch.int64 else input, *args, **kwargs)[1], lambda _, input, *args, **kwargs: input.device.type == 'mps') |