Open zou3519 opened 1 year ago
Note that if you do aten_graph
I would assume that this should evaporate. So the higher order op is mostly needed for pre-dispatch export. cc @andrewor14
@ezyang Is there a route where we can keep the autograd function op node without tracing into it, while doing aten_graph
?
You're kind of out of luck, because aten_graph
requires you to produce an aten op, but there is no aten op for a custom autograd function. Perhaps this can be worked around by relaxing requirements (you don't really want to produce an aten op only graph, you are ok with opaque autograd function blobs), but I don't have full context on what's going on for your case.
@ezyang @suo is preserving
You're kind of out of luck, because
aten_graph
requires you to produce an aten op, but there is no aten op for a custom autograd function. Perhaps this can be worked around by relaxing requirements (you don't really want to produce an aten op only graph, you are ok with opaque autograd function blobs), but I don't have full context on what's going on for your case.
We would certainly be interested in having a mechanism to keep custom autograd functions as opaque operators which we could then replace by a proper ops as a post process step.
@zou3519 is working on a new custom operator API that should do that: https://github.com/pytorch/pytorch/pull/120345
🐛 Describe the bug
A trampoline appears in the exported graph of autograd.Function:
returns:
We probably want to turn autograd.Function into a legit HigherOrderOp at some point.
Error logs
No response
Minified repro
No response
Versions
main
cc @ezyang @msaroufim @bdhirsh @anijain2305 @chauhang @wconstab