-
Notifications
You must be signed in to change notification settings - Fork 735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add flux support for Intel xpu #1162
base: main
Are you sure you want to change the base?
Conversation
I was able to get Flux to work on DirectML following the changes here. (GGUFs don't work, errors out on the de-quant with DirectML, but FP8 works for sure. Can't test NF4 on my AMD card.)
Command:
After the changes:
Which is reasonably surprising considering this is on a RX 570 4GB. |
it works on macs too, thank you for including the mps handling code as well. |
Is there a reason this is on hold? Would love to use this as the official version instead of having to fork just to run forge on a mac. Thank you! |
I had to update the torch version otherwise i would get the same error as #979 (i know this PR doesn't address this but thought to mention). I did the flux fix somewhat differently : gameblabla@c9adf48 |
I did change float32 first, just because A770 doesn't support float64. Then I thought there must be reason to set float64. By the way, fp8 is already about 12GB, and it consume about 3+GB, so it is almost run out of memory. |
Unfortunately, does not seem to solve the issue for me - no matter what, I still end up with
Windows, Intel Arc A770, default settings for "flux" preset, flux.py patched with the changes from this PR. Anyone else having this issue? |
I have checked mine with latest commit, but It was okay with here is my option by the way.
|
Yeah, I ran the quantized one, but apparently this is not the culprit - I am having this "mat1 and mat2 shapes cannot be multiplied" exception for any model type now, and even between different installations (tried reforge and A1111 today, clean install w/torch-ipex 2.1.0 build). Can you please let me know what driver version you use with A770? I probably need to downgrade. |
It runs fine for me, didn't encounter any "mat1 and mat2 shapes cannot be multiplied" error. Driver 32.0.101.5971 |
I always use latest. intel extension for torch also latest, which is 2.1.40+xpu. If there's still problem, it seems better open issue with very detailed infomation (because there's no many people who use Intel GPU) |
Thanks for the details! Tried 2.1.40 (patched similarly to Nuuuull releases, with Intel libs baked into wheels) but that did not change the behavior either. Still got no idea what is causing this issue, but I was able to workaround it with the following dirty patch:
UPD: oh, and that was an issue present without any extensions or LORAs at all, just a simple prompt like "forest" on default settings, no hires fix, no controlnet, nothing at all. |
FP64 might be added in whatever they next environment version is? |
Can any XPU users confirm if this simple change to the current line 22 works as expected:
(i.e. using float32, rather than changing device). |
intel/torch-xpu-ops#628 |
Intel XPU doesn't support float64, so change torch device to "cpu".
refered https://github.com/comfyanonymous/ComfyUI/blob/3f5939add69c2a8fea2b892a46a48c2937dc4128/comfy/ldm/flux/math.py#L15
I have tested on A770.
I also tested on RTX4090 and it doesn't seem performance drop (but not sure).