Skip to content

Add device_map="auto" support for the diffusers pipelines with higher VRAM occupancy #12187

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

inarikami
Copy link

@inarikami inarikami commented Aug 19, 2025

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

device_map="auto" supported for diffusers pipelines?
1 participant