-
Notifications
You must be signed in to change notification settings - Fork 28.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
fix: fsdp sharded state dict wont work for save_only_model knob #36627
Conversation
Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. When it is ready for review, please click the |
3d7e6e4
to
3a16920
Compare
@SunMarc @muellerzr requesting review on this nit fix. Thanks |
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.
Nice, left a comment
src/transformers/trainer.py
Outdated
if ( | ||
hasattr(self.accelerator.state, "fsdp_plugin") | ||
and "SHARDED_STATE_DICT" in str(self.accelerator.state.fsdp_plugin.state_dict_type) | ||
and self.args.save_only_model is True | ||
): | ||
raise ValueError("save_only_model option is not compatible with FSDP state dict type 'SHARDED_STATE_DICT'") |
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.
let's put that in create_accelerator_and_postprocess
function ! There are already some checks that exist there for save_only_model arg
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.
updated thank you.
fe111ad
to
4a2e33b
Compare
Signed-off-by: Mehant Kammakomati <mehant.kammakomati2@ibm.com>
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.
SG !
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. |
What does this PR do?
Fixes #36626
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
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.
@ArthurZucker @Rocketknight1