Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

dulinriley
Copy link
Contributor

@dulinriley dulinriley commented Oct 30, 2023

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

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
@pytorch-bot pytorch-bot bot added the release notes: fx release notes category label Oct 30, 2023
@pytorch-bot
Copy link

pytorch-bot bot commented Oct 30, 2023

🔗 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 Failure

As of commit 43149f3 with merge base 92cc52a (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D50756723

@facebook-github-bot
Copy link
Contributor

@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)

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: PR #112409 has not been reviewed yet

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

Copy link
Contributor

@ZainRizvi ZainRizvi left a 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

@ZainRizvi
Copy link
Contributor

@pytorchbot merge -f 'Landed internally'

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@dulinriley dulinriley deleted the export-D50756723 branch November 1, 2023 18:33
xuhancn pushed a commit to xuhancn/pytorch that referenced this pull request Nov 7, 2023
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
Skylion007 pushed a commit to Skylion007/pytorch that referenced this pull request Nov 14, 2023
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
andreigh pushed a commit to andreigh/pytorch that referenced this pull request Nov 19, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants