-
Notifications
You must be signed in to change notification settings - Fork 6.2k
[training] add an offload utility that can be used as a context manager. #11775
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
Conversation
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. |
nice @sayakpaul, thanks! should we also add a test to [test_dreambooth_lora_hidream.py]?(https://github.com/huggingface/diffusers/blob/main/examples/dreambooth/test_dreambooth_lora_hidream.py) |
I think it should be added as a utility test under |
@DN6 okay regarding?
|
@linoytsaban two things:
|
…er. (huggingface#11775) * add an offload utility that can be used as a context manager. * update --------- Co-authored-by: Linoy Tsaban <57615435+linoytsaban@users.noreply.github.com>
…er. (huggingface#11775) * add an offload utility that can be used as a context manager. * update --------- Co-authored-by: Linoy Tsaban <57615435+linoytsaban@users.noreply.github.com>
What does this PR do?
Useful for handling offloading in a simple and easy manner. Currently, in some of our training scripts, we have code patterns like so:
Instead of having those conditionals, this PR introduces an
offload_models()
method that turns this into a simple block of code:@DN6 I am including changes to
examples/**/*.py
to also trigger the fast PR tests on GPU. Hope, that's okay?Cc: @a-r-r-o-w for visibility.