[hoo] Invoke subgraph + effects Inductor support#167364
Closed
angelayi wants to merge 14 commits intogh/angelayi/135/basefrom
Closed
[hoo] Invoke subgraph + effects Inductor support#167364angelayi wants to merge 14 commits intogh/angelayi/135/basefrom
angelayi wants to merge 14 commits intogh/angelayi/135/basefrom
Conversation
[ghstack-poisoned]
This was referenced Nov 6, 2025
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/167364
Note: Links to docs will display an error until the docs builds have been completed. ⏳ 1 Pending, 2 Unrelated FailuresAs of commit 5df883f with merge base e3f24fd ( UNSTABLE - The following jobs are marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Nov 6, 2025
In order to support effect tokens with invoke subgraph in Inductor, I reimplemented how we handle with_effects, which now has a similar behavior as control_deps. Previously the behavior of with_effects is that we turn each with_effects(op, ..) call into an `ir.EffectfulKernel`, and the `op` is treated as a FallbackKernel. However in the case of `invoke_subgraph`, we want it to be an `ir.InvokeSubgraph` to trigger the invoke_subgraph inductor lowering logic. So now instead of turning with_effects into an `ir.EffectfulKernel`, I just add this dependency information to `V.graph.additional_star_deps`, similar to `V.graph.additional_buffer_deps` which is used by `control_deps`. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben [ghstack-poisoned]
In order to support effect tokens with invoke subgraph in Inductor, I reimplemented how we handle with_effects, which now has a similar behavior as control_deps. Previously the behavior of with_effects is that we turn each with_effects(op, ..) call into an `ir.EffectfulKernel`, and the `op` is treated as a FallbackKernel. However in the case of `invoke_subgraph`, we want it to be an `ir.InvokeSubgraph` to trigger the invoke_subgraph inductor lowering logic. So now instead of turning with_effects into an `ir.EffectfulKernel`, I just add this dependency information to `V.graph.additional_star_deps`, similar to `V.graph.additional_buffer_deps` which is used by `control_deps`. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben [ghstack-poisoned]
In order to support effect tokens with invoke subgraph in Inductor, I reimplemented how we handle with_effects, which now has a similar behavior as control_deps. Previously the behavior of with_effects is that we turn each with_effects(op, ..) call into an `ir.EffectfulKernel`, and the `op` is treated as a FallbackKernel. However in the case of `invoke_subgraph`, we want it to be an `ir.InvokeSubgraph` to trigger the invoke_subgraph inductor lowering logic. So now instead of turning with_effects into an `ir.EffectfulKernel`, I just add this dependency information to `V.graph.additional_star_deps`, similar to `V.graph.additional_buffer_deps` which is used by `control_deps`. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben [ghstack-poisoned]
This was referenced Nov 14, 2025
Closed
Closed
Contributor
|
follow for update |
Khanaksahu
pushed a commit
to Khanaksahu/pytorch
that referenced
this pull request
Nov 17, 2025
ghstack-source-id: 716b593 Pull Request resolved: pytorch/pytorch#167364
In order to support effect tokens with invoke subgraph in Inductor, I reimplemented how we handle with_effects, which now has a similar behavior as control_deps. Previously the behavior of with_effects is that we turn each with_effects(op, ..) call into an `ir.EffectfulKernel`, and the `op` is treated as a FallbackKernel. However in the case of `invoke_subgraph`, we want it to be an `ir.InvokeSubgraph` to trigger the invoke_subgraph inductor lowering logic. So now instead of turning with_effects into an `ir.EffectfulKernel`, I just add this dependency information to `V.graph.additional_star_deps`, similar to `V.graph.additional_buffer_deps` which is used by `control_deps`. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben [ghstack-poisoned]
In order to support effect tokens with invoke subgraph in Inductor, I reimplemented how we handle with_effects, which now has a similar behavior as control_deps. Previously the behavior of with_effects is that we turn each with_effects(op, ..) call into an `ir.EffectfulKernel`, and the `op` is treated as a FallbackKernel. However in the case of `invoke_subgraph`, we want it to be an `ir.InvokeSubgraph` to trigger the invoke_subgraph inductor lowering logic. So now instead of turning with_effects into an `ir.EffectfulKernel`, I just add this dependency information to `V.graph.additional_star_deps`, similar to `V.graph.additional_buffer_deps` which is used by `control_deps`. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben [ghstack-poisoned]
In order to support effect tokens with invoke subgraph in Inductor, I reimplemented how we handle with_effects, which now has a similar behavior as control_deps. Previously the behavior of with_effects is that we turn each with_effects(op, ..) call into an `ir.EffectfulKernel`, and the `op` is treated as a FallbackKernel. However in the case of `invoke_subgraph`, we want it to be an `ir.InvokeSubgraph` to trigger the invoke_subgraph inductor lowering logic. So now instead of turning with_effects into an `ir.EffectfulKernel`, I just add this dependency information to `V.graph.additional_star_deps`, similar to `V.graph.additional_buffer_deps` which is used by `control_deps`. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben [ghstack-poisoned]
fxdawnn
approved these changes
Nov 19, 2025
In order to support effect tokens with invoke subgraph in Inductor, I reimplemented how we handle with_effects, which now has a similar behavior as control_deps. Previously the behavior of with_effects is that we turn each with_effects(op, ..) call into an `ir.EffectfulKernel`, and the `op` is treated as a FallbackKernel. However in the case of `invoke_subgraph`, we want it to be an `ir.InvokeSubgraph` to trigger the invoke_subgraph inductor lowering logic. So now instead of turning with_effects into an `ir.EffectfulKernel`, I just add this dependency information to `V.graph.additional_star_deps`, similar to `V.graph.additional_buffer_deps` which is used by `control_deps`. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben [ghstack-poisoned]
Contributor
Author
|
@angelayi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
In order to support effect tokens with invoke subgraph in Inductor, I reimplemented how we handle with_effects, which now has a similar behavior as control_deps. Previously the behavior of with_effects is that we turn each with_effects(op, ..) call into an `ir.EffectfulKernel`, and the `op` is treated as a FallbackKernel. However in the case of `invoke_subgraph`, we want it to be an `ir.InvokeSubgraph` to trigger the invoke_subgraph inductor lowering logic. So now instead of turning with_effects into an `ir.EffectfulKernel`, I just add this dependency information to `V.graph.additional_star_deps`, similar to `V.graph.additional_buffer_deps` which is used by `control_deps`. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben Differential Revision: [D87668982](https://our.internmc.facebook.com/intern/diff/D87668982) [ghstack-poisoned]
Contributor
Author
|
@angelayi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
In order to support effect tokens with invoke subgraph in Inductor, I reimplemented how we handle with_effects, which now has a similar behavior as control_deps. Previously the behavior of with_effects is that we turn each with_effects(op, ..) call into an `ir.EffectfulKernel`, and the `op` is treated as a FallbackKernel. However in the case of `invoke_subgraph`, we want it to be an `ir.InvokeSubgraph` to trigger the invoke_subgraph inductor lowering logic. So now instead of turning with_effects into an `ir.EffectfulKernel`, I just add this dependency information to `V.graph.additional_star_deps`, similar to `V.graph.additional_buffer_deps` which is used by `control_deps`. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben Differential Revision: [D87668982](https://our.internmc.facebook.com/intern/diff/D87668982) [ghstack-poisoned]
In order to support effect tokens with invoke subgraph in Inductor, I reimplemented how we handle with_effects, which now has a similar behavior as control_deps. Previously the behavior of with_effects is that we turn each with_effects(op, ..) call into an `ir.EffectfulKernel`, and the `op` is treated as a FallbackKernel. However in the case of `invoke_subgraph`, we want it to be an `ir.InvokeSubgraph` to trigger the invoke_subgraph inductor lowering logic. So now instead of turning with_effects into an `ir.EffectfulKernel`, I just add this dependency information to `V.graph.additional_star_deps`, similar to `V.graph.additional_buffer_deps` which is used by `control_deps`. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben Differential Revision: [D87668982](https://our.internmc.facebook.com/intern/diff/D87668982) [ghstack-poisoned]
In order to support effect tokens with invoke subgraph in Inductor, I reimplemented how we handle with_effects, which now has a similar behavior as control_deps. Previously the behavior of with_effects is that we turn each with_effects(op, ..) call into an `ir.EffectfulKernel`, and the `op` is treated as a FallbackKernel. However in the case of `invoke_subgraph`, we want it to be an `ir.InvokeSubgraph` to trigger the invoke_subgraph inductor lowering logic. So now instead of turning with_effects into an `ir.EffectfulKernel`, I just add this dependency information to `V.graph.additional_star_deps`, similar to `V.graph.additional_buffer_deps` which is used by `control_deps`. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben Differential Revision: [D87668982](https://our.internmc.facebook.com/intern/diff/D87668982) [ghstack-poisoned]
In order to support effect tokens with invoke subgraph in Inductor, I reimplemented how we handle with_effects, which now has a similar behavior as control_deps. Previously the behavior of with_effects is that we turn each with_effects(op, ..) call into an `ir.EffectfulKernel`, and the `op` is treated as a FallbackKernel. However in the case of `invoke_subgraph`, we want it to be an `ir.InvokeSubgraph` to trigger the invoke_subgraph inductor lowering logic. So now instead of turning with_effects into an `ir.EffectfulKernel`, I just add this dependency information to `V.graph.additional_star_deps`, similar to `V.graph.additional_buffer_deps` which is used by `control_deps`. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben Differential Revision: [D87668982](https://our.internmc.facebook.com/intern/diff/D87668982) [ghstack-poisoned]
In order to support effect tokens with invoke subgraph in Inductor, I reimplemented how we handle with_effects, which now has a similar behavior as control_deps. Previously the behavior of with_effects is that we turn each with_effects(op, ..) call into an `ir.EffectfulKernel`, and the `op` is treated as a FallbackKernel. However in the case of `invoke_subgraph`, we want it to be an `ir.InvokeSubgraph` to trigger the invoke_subgraph inductor lowering logic. So now instead of turning with_effects into an `ir.EffectfulKernel`, I just add this dependency information to `V.graph.additional_star_deps`, similar to `V.graph.additional_buffer_deps` which is used by `control_deps`. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben Differential Revision: [D87668982](https://our.internmc.facebook.com/intern/diff/D87668982) [ghstack-poisoned]
Contributor
Author
|
@angelayi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Contributor
Author
|
@pytorchbot merge |
Collaborator
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 |
pytorchmergebot
pushed a commit
that referenced
this pull request
Dec 3, 2025
We shouldn't need this anymore as we have a registration for the op to have no effect Differential Revision: [D87680134](https://our.internmc.facebook.com/intern/diff/D87680134) Pull Request resolved: #168389 Approved by: https://github.com/zou3519 ghstack dependencies: #167364
pytorchmergebot
pushed a commit
that referenced
this pull request
Dec 4, 2025
We shouldn't need this anymore as we have a registration for the op to have no effect Differential Revision: [D87680134](https://our.internmc.facebook.com/intern/diff/D87680134) Pull Request resolved: #168389 Approved by: https://github.com/zou3519 ghstack dependencies: #167364
JacobSzwejbka
pushed a commit
that referenced
this pull request
Dec 8, 2025
In order to support effect tokens with invoke subgraph in Inductor, I reimplemented how we handle with_effects, which now has a similar behavior as control_deps. Previously the behavior of with_effects is that we turn each with_effects(op, ..) call into an `ir.EffectfulKernel`, and the `op` is treated as a FallbackKernel. However in the case of `invoke_subgraph`, we want it to be an `ir.InvokeSubgraph` to trigger the invoke_subgraph inductor lowering logic. So now instead of turning with_effects into an `ir.EffectfulKernel`, I just add this dependency information to `V.graph.additional_star_deps`, similar to `V.graph.additional_buffer_deps` which is used by `control_deps`. Differential Revision: [D87668982](https://our.internmc.facebook.com/intern/diff/D87668982) Pull Request resolved: #167364 Approved by: https://github.com/fxdawnn
JacobSzwejbka
pushed a commit
that referenced
this pull request
Dec 8, 2025
We shouldn't need this anymore as we have a registration for the op to have no effect Differential Revision: [D87680134](https://our.internmc.facebook.com/intern/diff/D87680134) Pull Request resolved: #168389 Approved by: https://github.com/zou3519 ghstack dependencies: #167364
JacobSzwejbka
pushed a commit
that referenced
this pull request
Dec 8, 2025
We shouldn't need this anymore as we have a registration for the op to have no effect Differential Revision: [D87680134](https://our.internmc.facebook.com/intern/diff/D87680134) Pull Request resolved: #168389 Approved by: https://github.com/zou3519 ghstack dependencies: #167364
tiendatngcs
pushed a commit
to tiendatngcs/pytorch-Dec25
that referenced
this pull request
Dec 10, 2025
ghstack-source-id: a13fea4 Pull Request resolved: pytorch/pytorch#167364
tiendatngcs
pushed a commit
to tiendatngcs/pytorch-Dec25
that referenced
this pull request
Dec 10, 2025
ghstack-source-id: 287c463 Pull Request resolved: pytorch/pytorch#167364
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In order to support effect tokens with invoke subgraph in Inductor, I reimplemented how we handle with_effects, which now has a similar behavior as control_deps.
Previously the behavior of with_effects is that we turn each with_effects(op, ..) call into an
ir.EffectfulKernel, and theopis treated as a FallbackKernel. However in the case ofinvoke_subgraph, we want it to be anir.InvokeSubgraphto trigger the invoke_subgraph inductor lowering logic. So now instead of turning with_effects into anir.EffectfulKernel, I just add this dependency information toV.graph.additional_star_deps, similar toV.graph.additional_buffer_depswhich is used bycontrol_deps.Stack from ghstack (oldest at bottom):
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo @chenyang78
Differential Revision: D87668982