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
[FSDP][state_dict] Restore the state_dict_config for NO_SHARD #100855
Conversation
Any change to the user configurations should be temporary. This PR fixes the issue when NO_SHARD state_dict/load_state_dict is called, the state_dict_config and state_dict_type are changed permanently. Differential Revision: [D45593313](https://our.internmc.facebook.com/intern/diff/D45593313/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D45593313/)! [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/100855
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 4d43a7d: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Any change to the user configurations should be temporary. This PR fixes the issue when NO_SHARD state_dict/load_state_dict is called, the state_dict_config and state_dict_type are changed permanently. Differential Revision: [D45593313](https://our.internmc.facebook.com/intern/diff/D45593313/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D45593313/)! [ghstack-poisoned]
…ARD" Any change to the user configurations should be temporary. This PR fixes the issue when NO_SHARD state_dict/load_state_dict is called, the state_dict_config and state_dict_type are changed permanently. Differential Revision: [D45593313](https://our.internmc.facebook.com/intern/diff/D45593313/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D45593313/)! [ghstack-poisoned]
@@ -302,6 +302,8 @@ def test_state_dict_fsdp_submodules(self): | |||
self.assertIsInstance(tensor, ShardedTensor) | |||
elif "u2" in fqn: | |||
self.assertIsInstance(tensor, torch.Tensor) | |||
# Ensure that get_state_dict_type can still correctly get the settings. | |||
_ = FSDP.get_state_dict_type(model) |
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.
Is this meant to have some assert on the return value?
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.
get_state_dict_type
will assert if the state_dict_config is not restored.
…ARD" Any change to the user configurations should be temporary. This PR fixes the issue when NO_SHARD state_dict/load_state_dict is called, the state_dict_config and state_dict_type are changed permanently. Differential Revision: [D45593313](https://our.internmc.facebook.com/intern/diff/D45593313/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D45593313/)! [ghstack-poisoned]
Merge failedReason: Comment with id 1540563109 not found Details for Dev Infra teamRaised by workflow job |
…ARD" Any change to the user configurations should be temporary. This PR fixes the issue when NO_SHARD state_dict/load_state_dict is called, the state_dict_config and state_dict_type are changed permanently. Differential Revision: [D45593313](https://our.internmc.facebook.com/intern/diff/D45593313/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D45593313/)! [ghstack-poisoned]
Pull Request resolved: #100855 Any change to the user configurations should be temporary. This PR fixes the issue when NO_SHARD state_dict/load_state_dict is called, the state_dict_config and state_dict_type are changed permanently. ghstack-source-id: 188583060 Differential Revision: [D45593313](https://our.internmc.facebook.com/intern/diff/D45593313/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D45593313/)!
…ARD" Any change to the user configurations should be temporary. This PR fixes the issue when NO_SHARD state_dict/load_state_dict is called, the state_dict_config and state_dict_type are changed permanently. Differential Revision: [D45593313](https://our.internmc.facebook.com/intern/diff/D45593313/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D45593313/)! [ghstack-poisoned]
@pytorchbot merge (Initiating merge automatically since Phabricator Diff has merged) |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Stack from ghstack (oldest at bottom):
Any change to the user configurations should be temporary. This PR fixes the issue when NO_SHARD state_dict/load_state_dict is called, the state_dict_config and state_dict_type are changed permanently.
Differential Revision: D45593313
NOTE FOR REVIEWERS: This PR has internal Meta-specific changes or comments, please review them on Phabricator!