Skip to content

[docs] Parallel loading of shards #12135

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

Merged
merged 5 commits into from
Aug 14, 2025
Merged

Conversation

stevhliu
Copy link
Member

Docs to go along with #12028.

I didn't mention #11904 since it doesn't appear to require any action on a user's behalf and it just works in the background. It's a cool design/implementation detail though and I think it'd be pretty interesting to maybe do a blog post about optimizations like this.

@stevhliu stevhliu requested a review from sayakpaul August 13, 2025 03:47
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

pipeline = DiffusionPipeline.from_pretrained(
"Wan-AI/Wan2.2-I2V-A14B-Diffusers",
torch_dtype=torch.bfloat16,
device_map="cuda"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to talk a bit about device_map? The motivation behind passing device_map essentially comes from this PR: #11904. I have also tried providing a bit of motivation behind adding it at the pipeline-level here: #12122 (comment).

@sayakpaul
Copy link
Member

I didn't mention #11904 since it doesn't appear to require any action on a user's behalf and it just works in the background. It's a cool design/implementation detail though and I think it'd be pretty interesting to maybe do a blog post about optimizations like this.

@stevhliu it comes to fruition when we initialize the model directly on the accelerator device through device_map instead of doing to("cuda"). So, it could be important to mention I guess.

@sayakpaul sayakpaul merged commit 421ee07 into huggingface:main Aug 14, 2025
1 check passed
@stevhliu stevhliu deleted the parallel-loading branch August 14, 2025 16:47
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.

3 participants