-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Change register_autograd to reflect ordering of setup_context and backward #124403
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
…kward old: `register_autograd(setup_context, backward, /)` new: `register_autograd(backward, /, *, setup_context=None)` Motivations: - We introduce these APIs as "give us a backward and use setup_context to save things for backward". - setup_context isn't always necessary. Test Plan: - tests [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/124403
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 86d679b with merge base 4a0900d ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
SGTM
Skipping bc-linter since this was added just below in the stack and we don't need to document this bc-breaking change.
…ext and backward" old: `register_autograd(setup_context, backward, /)` new: `register_autograd(backward, /, *, setup_context=None)` Motivations: - We introduce these APIs as "give us a backward and use setup_context to save things for backward". - setup_context isn't always necessary. Test Plan: - tests [ghstack-poisoned]
…ext and backward" old: `register_autograd(setup_context, backward, /)` new: `register_autograd(backward, /, *, setup_context=None)` Motivations: - We introduce these APIs as "give us a backward and use setup_context to save things for backward". - setup_context isn't always necessary. Test Plan: - tests [ghstack-poisoned]
…ext and backward" old: `register_autograd(setup_context, backward, /)` new: `register_autograd(backward, /, *, setup_context=None)` Motivations: - We introduce these APIs as "give us a backward and use setup_context to save things for backward". - setup_context isn't always necessary. Test Plan: - tests [ghstack-poisoned]
@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 |
- the op is automatically "pt2-compliant" - In general we want to turn on needs_fixed_stride_order for all customm ops, but this needs some more work, so we're just going to turn it on for the new custom op API. Test Plan: - existing tests Pull Request resolved: #124414 Approved by: https://github.com/albanD ghstack dependencies: #124180, #124200, #124299, #124134, #124199, #124403
Motivations: - this is pretty redundant with test_aot_dispatch_dynamic. - The user story for opcheck is that a user should use opcheck to see if their operator was "registered correctly". If a user's custom op only supports dynamic shapes, then it's a bit awkward for one of the tests (e.g. `test_aot_dispatch_static`) to fail. - We've already stopped running test_aot_dispatch_static in all of our opcheck tests. Test Plan: - wait for CI Pull Request resolved: #124495 Approved by: https://github.com/williamwen42 ghstack dependencies: #124180, #124200, #124299, #124134, #124199, #124403, #124414
…kward (#124403) old: `register_autograd(setup_context, backward, /)` new: `register_autograd(backward, /, *, setup_context=None)` Motivations: - We introduce these APIs as "give us a backward and use setup_context to save things for backward". - setup_context isn't always necessary. Test Plan: - tests Pull Request resolved: #124403 Approved by: https://github.com/albanD ghstack dependencies: #124180, #124200, #124299, #124134, #124199
- the op is automatically "pt2-compliant" - In general we want to turn on needs_fixed_stride_order for all customm ops, but this needs some more work, so we're just going to turn it on for the new custom op API. Test Plan: - existing tests Pull Request resolved: #124414 Approved by: https://github.com/albanD ghstack dependencies: #124180, #124200, #124299, #124134, #124199, #124403
Motivations: - this is pretty redundant with test_aot_dispatch_dynamic. - The user story for opcheck is that a user should use opcheck to see if their operator was "registered correctly". If a user's custom op only supports dynamic shapes, then it's a bit awkward for one of the tests (e.g. `test_aot_dispatch_static`) to fail. - We've already stopped running test_aot_dispatch_static in all of our opcheck tests. Test Plan: - wait for CI Pull Request resolved: #124495 Approved by: https://github.com/williamwen42 ghstack dependencies: #124180, #124200, #124299, #124134, #124199, #124403, #124414
…kward (#124403) old: `register_autograd(setup_context, backward, /)` new: `register_autograd(backward, /, *, setup_context=None)` Motivations: - We introduce these APIs as "give us a backward and use setup_context to save things for backward". - setup_context isn't always necessary. Test Plan: - tests Pull Request resolved: #124403 Approved by: https://github.com/albanD ghstack dependencies: #124180, #124200, #124299, #124134, #124199
- the op is automatically "pt2-compliant" - In general we want to turn on needs_fixed_stride_order for all customm ops, but this needs some more work, so we're just going to turn it on for the new custom op API. Test Plan: - existing tests Pull Request resolved: #124414 Approved by: https://github.com/albanD ghstack dependencies: #124180, #124200, #124299, #124134, #124199, #124403
) Motivations: - this is pretty redundant with test_aot_dispatch_dynamic. - The user story for opcheck is that a user should use opcheck to see if their operator was "registered correctly". If a user's custom op only supports dynamic shapes, then it's a bit awkward for one of the tests (e.g. `test_aot_dispatch_static`) to fail. - We've already stopped running test_aot_dispatch_static in all of our opcheck tests. Test Plan: - wait for CI Pull Request resolved: pytorch#124495 Approved by: https://github.com/williamwen42 ghstack dependencies: pytorch#124180, pytorch#124200, pytorch#124299, pytorch#124134, pytorch#124199, pytorch#124403, pytorch#124414
Stack from ghstack (oldest at bottom):
old:
register_autograd(setup_context, backward, /)
new:
register_autograd(backward, /, *, setup_context=None)
Motivations:
to save things for backward".
Test Plan: