stable_diffusion.openvino icon indicating copy to clipboard operation
stable_diffusion.openvino copied to clipboard

Does this project work on Mac M1 CPU?

Open IPL opened this issue 2 years ago • 9 comments

I tried but always failed in below line of code: self.unet = self.core.compile_model(self._unet, device) There is error when compiling unet, with error "node input index is out of range". Does the error due to unsupported M1 CPU? Thanks.

IPL avatar Aug 31 '22 10:08 IPL

@IPL no, this project doesn't work on Mac M1 CPU, only x86_64 compatible CPU

bes-dev avatar Aug 31 '22 13:08 bes-dev

@IPL By first installing the rust compiler with "brew install rust", then editing requirements.txt to delete the version number from numpy and switching openvino to openvino-arm I was able to get it to fully install on my M1. However, the diffusion is failing now due to lack of weights being installed. I haven't had time to debug that but hopefully this information helps you make progress on your system.

JanzenMark avatar Aug 31 '22 15:08 JanzenMark

even if it would work the speed would be horrible, as the m1 would emulate the x86_64 stuff

JustinGuese avatar Sep 01 '22 07:09 JustinGuese

@IPL and @JanzenMark see this https://replicate.com/blog/run-stable-diffusion-on-m1-mac

tfmoraes avatar Sep 02 '22 01:09 tfmoraes

Thanks @tfmoraes . Worked great! And fast too. Getting 1.5s / iteration.

JanzenMark avatar Sep 02 '22 16:09 JanzenMark

@tfmoraes @IPL @JustinGuese you can try to use non-official OpenVINO ARM package https://pypi.org/project/openvino-arm with OpenVINO ARM plugin https://github.com/openvinotoolkit/openvino_contrib/tree/master/modules/arm_plugin underneath

ilya-lavrenov avatar Sep 07 '22 15:09 ilya-lavrenov

If you are willing to run the docker version then try forcing docker to run in x86-64 emulation mode on the Mac M1:

Dockerfile:

Change

FROM python:3.9.9-bullseye

To

FROM --platform=linux/amd64 python:3.9.9-bullseye

zackees avatar Sep 07 '22 19:09 zackees

Since OpenVINO 2022.3, pip openvino package is available natively for Apple M1 / M2 https://pypi.org/project/openvino/2022.3.0/#files

ilya-lavrenov avatar Jan 04 '23 21:01 ilya-lavrenov

even if it would work the speed would be horrible, as the m1 would emulate the x86_64 stuff

M1 can emulate any x86 code as if it's nothing, I don't think that is an issue at all.

blinkguy182 avatar Mar 30 '23 18:03 blinkguy182