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
Not flatten states when use_orig_param is True and sharding is NO_SHARD #100189
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/100189
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 90a560f: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
ghstack-source-id: 524ba5724383bd5f4dd7e2a9a6a6fc1de6166d88 Pull Request resolved: #100189
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.
This looks good to me. Maybe @fegin has any opinion about unit test organization.
) | ||
optim = torch.optim.Adam(model.parameters(), lr=1e-2) | ||
|
||
def step(): |
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.
nit: Curious, why do we define step()
here if we only call it once?
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.
copied from other unit tests:)
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.
I think it should be OK, it is neat to use a function
@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 |
When use_orig_param is True and sharding is NO_SHARD, parameters and states are not flattened, so optimizer states should not be flattened as well. The unit test will fail without the fix.
Stack from ghstack (oldest at bottom):