-
Notifications
You must be signed in to change notification settings - Fork 25.9k
[dynamo][hops] Support non proxyable outputs in hops #167377
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/167377
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 4325dd1 with merge base 47acdea ( BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
| backend = AotEagerAndRecordGraphs() | ||
|
|
||
| opt_fn = torch.compile(fn, backend=backend, fullgraph=True) |
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: Use aot_eager if you're not going to do anything with the graphs :P
Stack from ghstack (oldest at bottom):
PR Description and code-comments generated by claude
Summary
Refactors speculate_subgraph to decouple graph outputs from output VariableTrackers (VTs), enabling better support for higher-order operators (HOPs) with non-proxyable outputs.
Motivation
Previously, speculate_subgraph unnecessarily entangled the graph output and the call_function VTs that needed to be sent for later tracing. In Dynamo (outside of speculate subgraph), VTs and graph are separate concepts: VTs can run ahead while the graph is just a side data structure of computation seen so far.
This entanglement caused issues with HOP support where subgraph outputs are not proxyable. The old implementation would call pytree flatten because it was unnecessarily coupling graph_output and output VTs, leading to complications with non-tensor/non-proxyable returns.
Changes
Core Refactoring:
Key Benefits:
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames @Lucaskabela