Skip to content

Remove pass-local ExportPass replays (#22091) - #22091

Merged
meta-codesync[bot] merged 1 commit into
mainfrom
export-D115472301
Aug 25, 2026
Merged

Remove pass-local ExportPass replays (#22091)#22091
meta-codesync[bot] merged 1 commit into
mainfrom
export-D115472301

Conversation

@mcremon-meta

@mcremon-meta mcremon-meta commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary:

Remove full-graph ExportPass replay from four Tier 1 pass-local transformations. BindOptionalArgsPass and RemoveBranchedQuantDequant now update existing nodes in place, ReplaceEmptyTensorsWithFullPass copies metadata to its equivalent replacement node and recompiles modified nested modules, and CombinePermuteWithMatmul recomputes fake tensors only across its affected frontier. The shared cascaded-permute transform exposes an in-place entry point so Helios retains immediate cleanup without reconstructing the graph.

These changes preserve graph, unaffected-node, and metadata identity while keeping no-op modified=False behavior. Each modifying invocation avoids one full replay; CombinePermuteWithMatmul can avoid two when its follow-up fusion also modifies the graph. Based on existing replay measurements, each avoided replay saves approximately 4-8 ms for 10 nodes, 40-75 ms for 100 nodes, and 0.4-0.75 s for 1,000 nodes. Already-normalized no-op invocations are unchanged.

Reviewed By: aliafzal, ethansfng

Differential Revision: D115472301

@pytorch-bot

pytorch-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22091

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 f813415 with merge base 368a849 (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 24, 2026
@meta-codesync

meta-codesync Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

@mcremon-meta has exported this pull request. If you are a Meta employee, you can view the originating Diff in D115472301.

@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@meta-codesync meta-codesync Bot changed the title Remove pass-local ExportPass replays Remove pass-local ExportPass replays (#22091) Aug 24, 2026
meta-codesync Bot pushed a commit that referenced this pull request Aug 24, 2026
Summary:

Remove full-graph `ExportPass` replay from four Tier 1 pass-local transformations. `BindOptionalArgsPass` and `RemoveBranchedQuantDequant` now update existing nodes in place, `ReplaceEmptyTensorsWithFullPass` copies metadata to its equivalent replacement node and recompiles modified nested modules, and `CombinePermuteWithMatmul` recomputes fake tensors only across its affected frontier. The shared cascaded-permute transform exposes an in-place entry point so Helios retains immediate cleanup without reconstructing the graph.

These changes preserve graph, unaffected-node, and metadata identity while keeping no-op `modified=False` behavior. Each modifying invocation avoids one full replay; `CombinePermuteWithMatmul` can avoid two when its follow-up fusion also modifies the graph. Based on existing replay measurements, each avoided replay saves approximately 4-8 ms for 10 nodes, 40-75 ms for 100 nodes, and 0.4-0.75 s for 1,000 nodes. Already-normalized no-op invocations are unchanged.

Reviewed By: aliafzal, ethansfng

Differential Revision: D115472301
@meta-codesync
meta-codesync Bot force-pushed the export-D115472301 branch from 9f6ce1b to a064788 Compare August 24, 2026 18:07
Summary:

Remove full-graph `ExportPass` replay from four Tier 1 pass-local transformations. `BindOptionalArgsPass` and `RemoveBranchedQuantDequant` now update existing nodes in place, `ReplaceEmptyTensorsWithFullPass` copies metadata to its equivalent replacement node and recompiles modified nested modules, and `CombinePermuteWithMatmul` recomputes fake tensors only across its affected frontier. The shared cascaded-permute transform exposes an in-place entry point so Helios retains immediate cleanup without reconstructing the graph.

These changes preserve graph, unaffected-node, and metadata identity while keeping no-op `modified=False` behavior. Each modifying invocation avoids one full replay; `CombinePermuteWithMatmul` can avoid two when its follow-up fusion also modifies the graph. Based on existing replay measurements, each avoided replay saves approximately 4-8 ms for 10 nodes, 40-75 ms for 100 nodes, and 0.4-0.75 s for 1,000 nodes. Already-normalized no-op invocations are unchanged.

Reviewed By: aliafzal, ethansfng

Differential Revision: D115472301
@meta-codesync
meta-codesync Bot merged commit a7e7e99 into main Aug 25, 2026
197 of 199 checks passed
@meta-codesync
meta-codesync Bot deleted the export-D115472301 branch August 25, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants