-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[FSDP][optim_state_dict] Ignore the state check on rank that does not own the corresponding parameter #93318
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
… own the corresponding parameter When a rank does not own a parameter (parameter.numel() == 0), its optim state is not valid and should not be checked against the current saved one. Differential Revision: [D42865237](https://our.internmc.facebook.com/intern/diff/D42865237/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/93318
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 1c9da19: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
… own the corresponding parameter When a rank does not own a parameter (parameter.numel() == 0), its optim state is not valid and should not be checked against the current saved one. Differential Revision: [D42865237](https://our.internmc.facebook.com/intern/diff/D42865237/) ghstack-source-id: 178833186 Pull Request resolved: #93318
…at does not own the corresponding parameter" When a rank does not own a parameter (parameter.numel() == 0), its optim state is not valid and should not be checked against the current saved one. Differential Revision: [D42865237](https://our.internmc.facebook.com/intern/diff/D42865237/) [ghstack-poisoned]
… own the corresponding parameter Pull Request resolved: #93318 When a rank does not own a parameter (parameter.numel() == 0), its optim state is not valid and should not be checked against the current saved one. ghstack-source-id: 178911152 Differential Revision: [D42865237](https://our.internmc.facebook.com/intern/diff/D42865237/)
rohan-varma
left a comment
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.
LGTM overall, but could we add an example unittest that would've raised an error / correctness issue that this change would fix?
| local_state = ( | ||
| optim_state[name] | ||
| if name in optim_state | ||
| else torch.empty(max_numel, dtype=dtype, device=fsdp_state.compute_device) |
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.
Valid lint?
…at does not own the corresponding parameter" When a rank does not own a parameter (parameter.numel() == 0), its optim state is not valid and should not be checked against the current saved one. Differential Revision: [D42865237](https://our.internmc.facebook.com/intern/diff/D42865237/) [ghstack-poisoned]
…at does not own the corresponding parameter" When a rank does not own a parameter (parameter.numel() == 0), its optim state is not valid and should not be checked against the current saved one. Differential Revision: [D42865237](https://our.internmc.facebook.com/intern/diff/D42865237/) [ghstack-poisoned]
… own the corresponding parameter Pull Request resolved: #93318 When a rank does not own a parameter (parameter.numel() == 0), its optim state is not valid and should not be checked against the current saved one. ghstack-source-id: 179074159 Differential Revision: [D42865237](https://our.internmc.facebook.com/intern/diff/D42865237/)
…at does not own the corresponding parameter" When a rank does not own a parameter (parameter.numel() == 0), its optim state is not valid and should not be checked against the current saved one. Differential Revision: [D42865237](https://our.internmc.facebook.com/intern/diff/D42865237/) [ghstack-poisoned]
… own the corresponding parameter Pull Request resolved: #93318 When a rank does not own a parameter (parameter.numel() == 0), its optim state is not valid and should not be checked against the current saved one. ghstack-source-id: 179122260 Differential Revision: [D42865237](https://our.internmc.facebook.com/intern/diff/D42865237/)
|
@pytorchbot merge |
|
This PR needs to be approved by an authorized maintainer before merge. |
rohan-varma
left a comment
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.
stamp to unblock but would be great if we can add the unittest or file an issue to do so.
Oh, this PR already has a UT for that. |
|
@pytorchbot merge |
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):
When a rank does not own a parameter (parameter.numel() == 0), its optim state is not valid and should not be checked against the current saved one.
Differential Revision: D42865237