aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mac_specific.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix the Ruff error about unused importhidenorly2023-11-281-1/+0
|
* Add FP32 fallback support on torch.nn.functional.interpolatehidenorly2023-11-281-0/+16
| | | | | | | | | | | | | | | | | | | | | This tries to execute interpolate with FP32 if it failed. Background is that on some environment such as Mx chip MacOS devices, we get error as follows: ``` "torch/nn/functional.py", line 3931, in interpolate return torch._C._nn.upsample_nearest2d(input, output_size, scale_factors) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: "upsample_nearest2d_channels_last" not implemented for 'Half' ``` In this case, ```--no-half``` doesn't help to solve. Therefore this commits add the FP32 fallback execution to solve it. Note that the ```upsample_nearest2d``` is called from ```torch.nn.functional.interpolate```. And the fallback for torch.nn.functional.interpolate is necessary at ```modules/sd_vae_approx.py``` 's ```VAEApprox.forward``` ```repositories/stable-diffusion-stability-ai/ldm/modules/diffusionmodules/openaimodel.py``` 's ```Upsample.forward```
* Remove duplicate code for torchsde randnbrkirch2023-08-131-3/+0
|
* split shared.py into multiple files; should resolve all circular reference ↵AUTOMATIC11112023-08-091-2/+2
| | | | import errors related to shared.py
* Don't do MPS GC when there's a latent that could still be sampledAarni Koskela2023-07-121-0/+4
|
* Add correct logger nameAarni Koskela2023-07-121-1/+1
|
* Fix MPS cache cleanupAarni Koskela2023-07-111-0/+14
| | | | Importing torch does not import torch.mps so the call failed.
* Fix warning of 'has_mps' is deprecated from PyTorchHao-Wu2023-07-061-9/+14
|
* Autofix Ruff W (not W605) (mostly whitespace)Aarni Koskela2023-05-111-2/+2
|
* imports cleanup for ruffAUTOMATIC2023-05-101-1/+0
|
* Fix generation with k-diffusion/UniPC on x64 Macsbrkirch2023-05-091-0/+5
|
* Remove PyTorch 2.0 checkbrkirch2023-05-091-2/+2
| | | | Apparently the commit in the main branch of pytorch/pytorch that fixes this issue didn't make it into PyTorch 2.0.1, and since it is unclear exactly which release will have it we'll just always apply the workaround so a crash doesn't occur regardless.
* Add workaround for MPS layer_norm on PyTorch 2.0brkirch2023-03-241-1/+3
| | | | On PyTorch 2.0, with MPS layer_norm only accepts float32 inputs. This was fixed shortly after 2.0 was finalized so the workaround can be applied with an exact version match.
* Add workaround for broken nn.Linear on macOS 13.2brkirch2023-03-241-0/+5
| | | | Credit to danieldk (https://github.com/explosion/curated-transformers/pull/124) for the workaround this is based on.
* Remove test, use bool tensor fix by defaultbrkirch2023-03-111-2/+1
| | | | The test isn't working correctly on macOS 13.3 and the bool tensor fix for cumsum is currently always needed anyway, so enable the fix by default.
* Remove unused codebrkirch2023-02-041-3/+0
|
* Refactor Mac specific code to a separate filebrkirch2023-02-011-0/+56
Move most Mac related code to a separate file, don't even load it unless web UI is run under macOS.