Skip to content
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

Update final CPU offloading code for more diffusion pipelines #5589

Merged

Conversation

clarencechen
Copy link
Contributor

@clarencechen clarencechen commented Oct 30, 2023

What does this PR do?

Propagates changes in #4514 updating CPU model offloading to use maybe_free_model_hooks() to more diffusion pipelines, and adds a test to ensure all offloading-enabled pipeline components are returned to the CPU after a pipeline call is finished.

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

Add test to ensure all pipeline components are returned to CPU after
execution with model offloading
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 30, 2023

The documentation is not available anymore as the PR was closed or merged.

@patrickvonplaten
Copy link
Contributor

Great job @clarencechen, that's a very nice clean-up!

@patrickvonplaten patrickvonplaten merged commit 151998e into huggingface:main Nov 1, 2023
11 checks passed
@clarencechen clarencechen deleted the cleanup-final-offload-hook branch November 1, 2023 23:25
@alexisrolland
Copy link
Contributor

Hello @clarencechen

I'm wondering if this PR would help with the following bug? Any idea? #5281

Thanks

kashif pushed a commit to kashif/diffusers that referenced this pull request Nov 11, 2023
…gface#5589)

* Update final model offload for more pipelines

Add test to ensure all pipeline components are returned to CPU after
execution with model offloading

* Add comment to explain early UNet offload in Text-to-Video pipeline

* Style
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
…gface#5589)

* Update final model offload for more pipelines

Add test to ensure all pipeline components are returned to CPU after
execution with model offloading

* Add comment to explain early UNet offload in Text-to-Video pipeline

* Style
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
…gface#5589)

* Update final model offload for more pipelines

Add test to ensure all pipeline components are returned to CPU after
execution with model offloading

* Add comment to explain early UNet offload in Text-to-Video pipeline

* Style
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.

4 participants