-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
Add FSDP config for CPU RAM efficient loading through accelerate #30002
Add FSDP config for CPU RAM efficient loading through accelerate #30002
Conversation
68033fa
to
8719a0f
Compare
cf40b24
to
5443e5b
Compare
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Overall this looks much better to me, just a slight documentation nit. cc @pacman100 so you're aware
Thanks for the suggestion. @muellerzr would you re-approve? |
No need for a reapproval in those cases :) The green checkmark in transformers is end-all-be-all approval unless something radically changed outside that. cc @amyeroberts for final review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding!
Just a small nit and request for input validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @helloworld1 for adding this!
Co-authored-by: Zach Mueller <[email protected]>
Co-authored-by: amyeroberts <[email protected]>
e7a1c8f
to
e81cd98
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding and iterating - looks great!
Running |
Co-authored-by: amyeroberts <[email protected]>
73d8e4a
to
a2978fb
Compare
…gingface#30002) * Add FSDP config for CPU RAM efficient loading * Style fix * Update src/transformers/training_args.py Co-authored-by: Zach Mueller <[email protected]> * Update src/transformers/training_args.py Co-authored-by: amyeroberts <[email protected]> * Add sync_module_states and cpu_ram_efficient_loading validation logic * Update src/transformers/training_args.py Co-authored-by: amyeroberts <[email protected]> * Style --------- Co-authored-by: Zach Mueller <[email protected]> Co-authored-by: amyeroberts <[email protected]>
) * Add FSDP config for CPU RAM efficient loading * Style fix * Update src/transformers/training_args.py Co-authored-by: Zach Mueller <[email protected]> * Update src/transformers/training_args.py Co-authored-by: amyeroberts <[email protected]> * Add sync_module_states and cpu_ram_efficient_loading validation logic * Update src/transformers/training_args.py Co-authored-by: amyeroberts <[email protected]> * Style --------- Co-authored-by: Zach Mueller <[email protected]> Co-authored-by: amyeroberts <[email protected]>
What does this PR do?
Currently the environment variable
FSDP_CPU_RAM_EFFICIENT_LOADING
is being read here but are set intransformers
codebase. This change added option to setFSDP_CPU_RAM_EFFICIENT_LOADING
throughcpu_ram_efficient_loading
FSDP option so jobs launched fromtorchrun
or other means can take advantage ofFSDP_CPU_RAM_EFFICIENT_LOADING
through configs.Fixes # (issue)
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@pacman100
@muellerzr
@ArthurZucker
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.