Add device_map="auto" support for the diffusers pipelines with higher VRAM occupancy #12187
+86
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Improves denoising performance on high end consumer GPUs for larger than VRAM models by adding the 'auto' strategy that attempts to fill available VRAM by targeting 85% capacity.
What happened?
I noticed that for diffusion models like Qwen Image that do not entirely fit in RTX 5090/4090 the default and 'balanced' strategy was underutilizing the total amount of VRAM available to the pipeline. (~15GB of usage vs the ~30GB max). The denoising steps took about 14+ seconds per iteration... so with this 'auto' more aggressive memory mapping strategy changes I see a ~4x speedup over the default at 3.5s per iteration.
Fixes #11555
(and QwenLM/Qwen-Image#44, QwenLM/Qwen-Image#24)