[pytorch] add manual registration for trace type#40903
[pytorch] add manual registration for trace type#40903ljk53 wants to merge 6 commits intogh/ljk53/154/basefrom
Conversation
This PR continues the work of #38467 - decoupling Autograd and Trace for manually registered ops. Differential Revision: [D22354804](https://our.internmc.facebook.com/intern/diff/D22354804/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D22354804/)! [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit 1790bba (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:
|
This PR continues the work of #38467 - decoupling Autograd and Trace for manually registered ops. Differential Revision: [D22354804](https://our.internmc.facebook.com/intern/diff/D22354804/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D22354804/)! [ghstack-poisoned]
Pull Request resolved: #40903 This PR continues the work of #38467 - decoupling Autograd and Trace for manually registered ops. ghstack-source-id: 107042483 Differential Revision: [D22354804](https://our.internmc.facebook.com/intern/diff/D22354804/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D22354804/)!
This PR continues the work of #38467 - decoupling Autograd and Trace for manually registered ops. Differential Revision: [D22354804](https://our.internmc.facebook.com/intern/diff/D22354804/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D22354804/)! [ghstack-poisoned]
This PR continues the work of #38467 - decoupling Autograd and Trace for manually registered ops. Differential Revision: [D22354804](https://our.internmc.facebook.com/intern/diff/D22354804/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D22354804/)! [ghstack-poisoned]
Pull Request resolved: #40903 This PR continues the work of #38467 - decoupling Autograd and Trace for manually registered ops. ghstack-source-id: 107087630 Differential Revision: [D22354804](https://our.internmc.facebook.com/intern/diff/D22354804/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D22354804/)!
This PR continues the work of #38467 - decoupling Autograd and Trace for manually registered ops. Differential Revision: [D22354804](https://our.internmc.facebook.com/intern/diff/D22354804/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D22354804/)! [ghstack-poisoned]
Pull Request resolved: #40903 This PR continues the work of #38467 - decoupling Autograd and Trace for manually registered ops. ghstack-source-id: 107106964 Differential Revision: [D22354804](https://our.internmc.facebook.com/intern/diff/D22354804/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D22354804/)!
This PR continues the work of #38467 - decoupling Autograd and Trace for manually registered ops. Differential Revision: [D22354804](https://our.internmc.facebook.com/intern/diff/D22354804/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D22354804/)! [ghstack-poisoned]
|
This is good stuff, but I think there's a decent chance the tracing logic here didn't need to be manually written out. Looking at the original manual code, you can see that there are bits that were codegenned, and then bits that were edited up to do some sort of custom logic. In most of the cases, the tracing logic was outside of the "this was manually edited sections." How hard would it be to wire up the codegen to generate tracing for those cases too? (Maybe this is not worth it, since the PoR is to shortly delete all this code and replace it with boxed fallback.) |
| x = torch.randn(4, 4, requires_grad=True) | ||
|
|
||
| def f(x): | ||
| out = Variable(torch.zeros(x.size())) |
ezyang
left a comment
There was a problem hiding this comment.
There is not too much manual code that was carried over, so I think this is fine as is to go in.
Yeah, most ops here are simply falling through, among all the 5 manually registered ops: |
|
This pull request has been merged in 7f60642. |
Summary: Pull Request resolved: pytorch#40903 This PR continues the work of pytorch#38467 - decoupling Autograd and Trace for manually registered ops. ghstack-source-id: 107158638 Test Plan: CI Differential Revision: D22354804 fbshipit-source-id: f5ea45ade2850296c62707a2a4449d7d67a9f5b5
Stack from ghstack:
This PR continues the work of #38467 - decoupling Autograd and Trace for manually registered ops.
Differential Revision: D22354804
NOTE FOR REVIEWERS: This PR has internal Facebook specific changes or comments, please review them on Phabricator!