Is Parallel Processing Possible to Avoid Memory Overflow in ControlNet SD-XL? #7743
Replies: 4 comments 2 replies
-
Hello! |
Beta Was this translation helpful? Give feedback.
-
Hi Tolga, Thank you for your prompt response. I attempted your suggestion by removing I also explored the strategies outlined on Distributed inference page. For instance, I tried implementing It appears I'm missing a critical setup step somewhere. The example in the guide splits GPU resources into two processes. But in my case, there is only one process. Any insights or further guidance would be greatly appreciated. (I'm still unsure how to leverage all available 48GB of combined GPU memory, rather than being limited to a single 24GB.) Thanks very much. |
Beta Was this translation helpful? Give feedback.
-
cc @sayakpaul |
Beta Was this translation helpful? Give feedback.
-
If you want to keep the model-level components of your pipeline distributed across multiple devices, then you can use the However, you will be bottlenecked by the speed there. If you are still running into memory issues, I suggest doing the following (ordered):
|
Beta Was this translation helpful? Give feedback.
-
Hello,
I am using StableDiffusionXLControlNetImg2ImgPipeline from the diffusers library. My system is equipped with two GPUs, each with 24GB of memory. Despite this, I've noticed that only one GPU is actively being used during processing. The total available GPU memory is thus incorrectly perceived as 24GB, whereas it should be 48GB when considering both GPUs.
This limitation in GPU utilization is causing CUDA out-of-memory errors as the program exhausts available memory on the single active GPU. I am seeking advice on how to effectively modify my code to configure and leverage a multi-GPU setup, allowing me to fully utilize the combined resources of both GPUs. Below is a snippet of my code:
Thank you so very much!
Beta Was this translation helpful? Give feedback.
All reactions