Skip to content

Optimize FuseViewCopyTransform pass#20591

Open
Erik-Lundell wants to merge 1 commit into
pytorch:mainfrom
Erik-Lundell:martins-patch
Open

Optimize FuseViewCopyTransform pass#20591
Erik-Lundell wants to merge 1 commit into
pytorch:mainfrom
Erik-Lundell:martins-patch

Conversation

@Erik-Lundell

@Erik-Lundell Erik-Lundell commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

This is an optimizing and refactoring patch targeting the FuseViewCopyTransform pass.

Prior to this patch, the pass worked in two full iterations and recompilations of the graph: The first iteration updated view nodes, recompiled the graph and the second iteration removed any redundant view nodes.

Optimize this pass to instead do the same work in just one graph iteration and compilation. The pass now works by finding fusible chains, removing redundant view nodes, and form updated node edges within a single iteration.

The table below shows the improvement when lowering models on a computer using the TOSA FP profile.

Model Before After Fuse delta Total delta
mobilenet_v2 3.21s 1.61s -1.61s / -50.0% -2.7%
deit_tiny 10.51s 5.27s -5.24s / -49.9% -1.6%
swin2sr 2.55s 1.26s -1.29s / -50.7% -1.2%

Signed-off-by: Martin Lindström Martin.Lindstroem@arm.com

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani

This is an optimizing and refactoring patch targeting the
FuseViewCopyTransform pass.

Prior to this patch, the pass worked in two full iterations and
recompilations of the graph: The first iteration updated view nodes,
recompiled the graph and the second iteration removed any redundant view
nodes.

Optimize this pass to instead do the same work in just one graph
iteration and compilation. The pass now works by finding fusible chains,
removing redundant view nodes, and form updated node edges within a
single iteration.

The table below shows the improvement when lowering models on a computer
using the TOSA FP profile.

| Model        | Before | After | Fuse delta      | Total delta |
|--------------|-------:|------:|----------------:|------------:|
| mobilenet_v2 |  3.21s | 1.61s | -1.61s / -50.0% | -2.7%       |
| deit_tiny    | 10.51s | 5.27s | -5.24s / -49.9% | -1.6%       |
| swin2sr      |  2.55s | 1.26s | -1.29s / -50.7% | -1.2%       |

Signed-off-by: Martin Lindström <Martin.Lindstroem@arm.com>
Change-Id: Id8a9640814c3f146323f14a64c5a4a857273eed0
@pytorch-bot

pytorch-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures

As of commit d33e80a with merge base f11805c (image):

NEW FAILURES - The following jobs have failed:

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 Jun 29, 2026
@Erik-Lundell Erik-Lundell added ciflow/trunk release notes: none Do not include this in the release notes partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm labels Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants