Skip to content

Reland "Arm backend: Rerun duplicate-user fusion after TOSA lowering"#21380

Open
YufengShi-dudu wants to merge 1 commit into
pytorch:mainfrom
YufengShi-dudu:reland-rerun-deplicate-user-fusion
Open

Reland "Arm backend: Rerun duplicate-user fusion after TOSA lowering"#21380
YufengShi-dudu wants to merge 1 commit into
pytorch:mainfrom
YufengShi-dudu:reland-rerun-deplicate-user-fusion

Conversation

@YufengShi-dudu

@YufengShi-dudu YufengShi-dudu commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Late TOSA transformations can introduce equivalent operations after the first FuseDuplicateUsersPass invocation. Rerun it after TOSA and shape transformations, before output nodes are made unique.

Run InsertRescalePass after the final FuseDuplicateUsersPass. Fusing generated RESCALE users can merge distinct quantized paths and produce incorrect results.

TOSA-FP operator comparisons:

Model Before After Reduction
SD3 1,591 1,527 64 (4.0%)
Conformer delegate 544 498 46 (8.5%)

Reference-output tests pass with late fusion enabled.

Add regression coverage for late fusion, rescale insertion, and output uniqueness pass ordering.

Change-Id: Ia4e2335e05b18d16b93c7e035a5502b8f050855c

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

Late TOSA transformations can introduce equivalent operations after the
first FuseDuplicateUsersPass invocation. Rerun it after TOSA and shape
transformations, before output nodes are made unique.

Run InsertRescalePass after the final FuseDuplicateUsersPass. Fusing
generated RESCALE users can merge distinct quantized paths and produce
incorrect results.

TOSA-FP operator comparisons:

| Model              | Before | After | Reduction |
|--------------------|-------:|------:|----------:|
| SD3                |  1,591 | 1,527 | 64 (4.0%) |
| Conformer delegate |    544 |   498 | 46 (8.5%) |

Reference-output tests pass with late fusion enabled.

Add regression coverage for late fusion, rescale insertion, and output
uniqueness pass ordering.

Change-Id: Ia4e2335e05b18d16b93c7e035a5502b8f050855c
Signed-off-by: Yufeng Shi <yufeng.shi@arm.com>
@YufengShi-dudu YufengShi-dudu added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm ciflow/trunk module: arm Issues related to arm backend release notes: none Do not include this in the release notes labels Jul 24, 2026
@pytorch-bot pytorch-bot Bot added the ci-no-td label Jul 24, 2026
@pytorch-bot

pytorch-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit 12ef2f4 with merge base fbd14e6 (image):

NEW FAILURE - The following job has 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 Jul 24, 2026
@YufengShi-dudu

Copy link
Copy Markdown
Collaborator Author

The original PR #21041 was reverted in #21106
Reland the original PR after reordering the InsertRescalePass after FuseDuplicateUsersPass to avoid corrupting the quantized data flow in some corner cases.
@rascani

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: arm Issues related to arm backend 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.

1 participant