-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Consistently getting noise as output with Intel Arc #556
Comments
are you getting this with all samplers/schedulers? |
I think this is more likely to be an upstream (Intel Extension for PyTorch, Intel Compute Runtime, etc...) issue. in general, lower resolutions (e.g. 512*512 or lower) have a lower probability of noise. Possibly related: intel/intel-extension-for-pytorch#325 |
@comfyanonymous Yes, I tried multiple combinations. |
Anything under 512x512, you'll actually get latent noise artifacting and strange results if it's not img2img. I think this is cause of the internal upscaling used from source 64x64 (for 1.4/1.5) |
Can confirm, finally got xpu acceleration working via the guide from this merge: |
I didn't add |
Between the strange results and the pure noise/black images, I think I have to choose the former... So Intel, F--k You! Note: The last time I used ComfyUI the maximum size was about 768*704, exceeding that would produce a black image. |
Finally got it working using the wheel files from this tutorial: https://github.com/TotalDay/Intel_ARC_GPU_WSL_Stable_Diffusion_WEBUI |
Where did you add ipex.optimize?
It looks like TotalDay/Intel_ARC_GPU_WSL_Stable_Diffusion_WEBUI provides IPEX that has not been released yet, so this is in line with expectations. Btw, are you now able to generate high resolution images? |
comfy/model_management.py
YMMV on the improvement from ipex.optimize though.
Yes, but only upto 1024x1024 |
IPEX has released |
So good news, months later. Intel finally released an XPU version of their Pytorch extension with Pytorch 2.0 support, |
@simonlui |
@BA8F0D39 Yeah, I've hit that but I am pretty sure though that isn't a ComfyUI issue, it's an Intel issue specifically with how they are handling allocation on GPU because of wanting to preserve their stateful addressing model. I'm currently digging into their stack and have seen the bug reports you made on that regarding how 4GB is the max you can allocate. But remember, that is the limit for 1 single allocation. I will probably open an issue or two and update those issues so keep an eye out on that. In the meantime, you can try and get the program to chunk its allocations into smaller units so it doesn't hit the limit and uses VRAM better. Using FP16 where possible and using some memory saving nodes in your workflow like using the testing nodes with Tiled VAE Encode/Decode and TomePatchModel nodes helps. ComfyUI's latest change as of barely an hour ago will also help with text encoder weights being able to be stored in FP16. With that, I am able to use SD1.5 and generate 768x768 and latent upscale to 1024x1024 without hitting any image corruption or blackout issues. |
@simonlui oneapi-src/oneDNN@42a1895#diff-21a382a12fc4d58cceb2ab97c73746f53439a1f739f1573ccdd6060ea62949e1 I think we can try to enable 4GB and greater allocation using |
@BrosnanYuen Both IPEX and oneDNN use SYCL for allocation. See here and here respectively. That's not the main issue here though. If you read https://github.com/intel/compute-runtime/blob/master/programmers-guide/ALLOCATIONS_GREATER_THAN_4GB.md, you will realize that there are two requirements to making >4GB allocations happen. You need build flags, true, but you also need to pass a flag or struct through with the allocation function call to make it happen. The document only specifies Level Zero and OpenCL. IPEX and OneDNN both use SYCL instead and that's the problem as there is no provision to do this same thing in SYCL. I've opened an enhancement report in Intel's LLVM to try and propagate something to get through this limitation but it is going to take a long time if Intel even considers it. Again, what can be done at this time is mitigation so IPEX doesn't allocate more than 4GB for any single allocation and that will allow for more VRAM to be used using the strategies mentioned but it is unavoidable hitting that limit for big images, batches and more complex workflows which limits what the GPU can do at this time. The other thing that can be done is ComfyUI actually splitting allocations into 4GB chunks if possible but I think it is untenable to actually ask any projects that would use IPEX to do something to mitigate something that shouldn't be their problem and implement what is essentially manual memory management in Python. |
Closing as this is long fixed |
I set up ComfyUI following the tutorial for Intel Arc. However I am consistently getting noise as output.
System spec: Windows 10 WSL, Ubuntu 22.04.2 LTS, Python 3.10, Arc A770
The text was updated successfully, but these errors were encountered: