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
Parity tests for functional optimizer step_param #61756
Conversation
DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)! [ghstack-poisoned]
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit c6c9554 (more details on the Dr. CI page):
🕵️ 1 new failure recognized by patternsThe following CI failures do not appear to be due to upstream breakages: Linux CI (pytorch-linux-bionic-py3.8-gcc9-coverage) / render_test_results (default) (1/1)Step: "Checkout PyTorch" (full log | diagnosis details | 🔁 rerun)
|
DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)! [ghstack-poisoned]
Pull Request resolved: #61756 DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. ghstack-source-id: 133659711 Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)!
DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)! [ghstack-poisoned]
Pull Request resolved: #61756 DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. ghstack-source-id: 133682132 Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)!
DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)! [ghstack-poisoned]
DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)! [ghstack-poisoned]
Pull Request resolved: #61756 DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. ghstack-source-id: 133919961 Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)!
# Functional optimizer step_param | ||
for param in module_functional.parameters(): | ||
grad = param.grad | ||
optim_functional.step_param(param, grad) |
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.
It seems that the first arg of step_param
should be a tensor instead of nn.parameter.Parameter
. Is there an implicit type casting here?
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.
Good point! According to these docs: https://github.com/pytorch/pytorch/blob/master/torch/nn/parameter.py#L7 a Parameter is a kind of tensor (and also subclasses from Tensor), so I think step_param
should work regardless of whether it is passed a parameter or tensor.
DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)! [ghstack-poisoned]
Pull Request resolved: #61756 DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. ghstack-source-id: 133945706 Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)!
DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)! [ghstack-poisoned]
DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)! [ghstack-poisoned]
Pull Request resolved: #61756 DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. ghstack-source-id: 134052041 Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)!
DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)! [ghstack-poisoned]
DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)! [ghstack-poisoned]
DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)! [ghstack-poisoned]
DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)! [ghstack-poisoned]
DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)! [ghstack-poisoned]
DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)! [ghstack-poisoned]
Pull Request resolved: #61756 DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. ghstack-source-id: 134272866 Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)!
DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)! [ghstack-poisoned]
DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)! [ghstack-poisoned]
This pull request has been merged in 69adb21. |
Pull Request resolved: pytorch/pytorch#61756 DDP will support running optimizer as communication hook with optimizers that support a per-parameter/gradient step function `step_param`. Add parity tests as we implement more optimizers that support step_param to ensure parity with regular optimizers. ghstack-source-id: 133985151 Differential Revision: [D29727549](https://our.internmc.facebook.com/intern/diff/D29727549/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D29727549/)!
Stack from ghstack:
DDP will support running optimizer as communication hook with
optimizers that support a per-parameter/gradient step function
step_param
.Add parity tests as we implement more optimizers that support step_param to
ensure parity with regular optimizers.
Differential Revision: D29727549
NOTE FOR REVIEWERS: This PR has internal Facebook specific changes or comments, please review them on Phabricator!