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
[fx] Add Graph option for replace_pattern #112409
Conversation
Summary: Allow doing pattern replacement with just an fx.Graph instead of a fx.GraphModule, which can let callers avoid paying the cost of `recompile()` for a small graph if they don't need the module. This is a significant speedup if you use hundreds of small patterns for replacement. Test Plan: Tested in a diff stacked on top of this: {D50756722} Reviewed By: SherlockNoMad, angelayi Differential Revision: D50756723
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/112409
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit 43149f3 with merge base 92cc52a (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This pull request was exported from Phabricator. Differential Revision: D50756723 |
@pytorchbot merge -f 'Landed internally' (Initiating merge automatically since Phabricator Diff has merged, using force because this PR might not pass merge_rules.json but landed internally) |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: PR #112409 has not been reviewed yet |
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.
diff already approved internally
@pytorchbot merge -f 'Landed internally' |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Summary: Allow doing pattern replacement with just an fx.Graph instead of a fx.GraphModule, which can let callers avoid paying the cost of `recompile()` for a small graph if they don't need the module. This is a significant speedup if you use hundreds of small patterns for replacement. Test Plan: Tested in a diff stacked on top of this: {D50756722} Reviewed By: SherlockNoMad, angelayi Differential Revision: D50756723 @diff-train-skip-merge Pull Request resolved: pytorch#112409 Approved by: https://github.com/ZainRizvi
Summary: Allow doing pattern replacement with just an fx.Graph instead of a fx.GraphModule, which can let callers avoid paying the cost of `recompile()` for a small graph if they don't need the module. This is a significant speedup if you use hundreds of small patterns for replacement. Test Plan: Tested in a diff stacked on top of this: {D50756722} Reviewed By: SherlockNoMad, angelayi Differential Revision: D50756723 @diff-train-skip-merge Pull Request resolved: pytorch#112409 Approved by: https://github.com/ZainRizvi
Summary: Allow doing pattern replacement with just an fx.Graph instead of a fx.GraphModule, which can let callers avoid paying the cost of `recompile()` for a small graph if they don't need the module. This is a significant speedup if you use hundreds of small patterns for replacement. Test Plan: Tested in a diff stacked on top of this: {D50756722} Reviewed By: SherlockNoMad, angelayi Differential Revision: D50756723 @diff-train-skip-merge Pull Request resolved: pytorch#112409 Approved by: https://github.com/ZainRizvi
Summary:
Allow doing pattern replacement with just an fx.Graph instead of a fx.GraphModule,
which can let callers avoid paying the cost of
recompile()
for a small graph if theydon't need the module.
This is a significant speedup if you use hundreds of small patterns for replacement.
Test Plan: Tested in a diff stacked on top of this: {D50756722}
Reviewed By: SherlockNoMad, angelayi
Differential Revision: D50756723
@diff-train-skip-merge