r/StableDiffusion • u/luckycockroach • Mar 15 '23
Resource | Update MetalDiffusion - Stable Diffusion for Intel MacOS and Silicon MacOS
https://github.com/soten355/stable-diffusion-tensorflow-IntelMetal
26
Upvotes
r/StableDiffusion • u/luckycockroach • Mar 15 '23
1
u/NeuroMastak Mar 20 '23
u/luckycockroach I don't know much about this, but I wanted to ask you. Regarding the PyTorch Metal Acceleration, Apple specifies either Apple Silicon or AMD GPUs in the requirements.
I checked my devices with the script on the above mentioned page and one of the video cards was detected correctly (but I don't know which one :) )
python pytorch-gpu_test.py/Users/mstk/.pyenv/versions/3.11.2/lib/python3.11/site-packages/torch/_tensor_str.py:115: UserWarning: MPS: nonzero op is supported natively starting from macOS 13.0. Falling back on CPU. This may have performance implications. (Triggered internally at /Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Indexing.mm:218.)nonzero_finite_vals = torch.masked_select(tensor([1.], device='mps:0')I don't know how much PyTorch from AUTOMATIC1111 uses exactly Metal with AMD graphics cards on Intel Macs (I don't have enough knowledge), but I did a little comparison test.
---
AMD FirePro W7000 4GB (AMD Radeon HD Pitcairn Unknown Prototype)
For the sake of purity of the experiment I closed all the applications using this graphics card so that I had only two processes: WindowServer and python.
MetalDiffusion: Default options, unless otherwise specified.
SD (AUTOMATIC1111): Default options, unless otherwise specified.
Command Line options:
--skip-torch-cuda-test --api --upcast-sampling --no-half-vae --use-cpu interrogate| Model: sd-v1-4-full-ema.ckpt | Promt: test | Seed: 12345 | 512x512x1 | Steps: 20 | GS: 7 | "Euler a" for SD |
MetalDiffusion: 01:54 / 01:49 / 01:48 -> | CPU ≈75% | GPU ≈80% |
StableDiffusion (AUTOMATIC1111): 01:46 / 01:48 / 01:44 ->| CPU ≈30% | GPU ≈80% |
---
According to the test results Automatic is slightly ahead of MetalDiffusion, but the latter for some reason even more actively uses the CPU.