Skip to content

Arm backend: Handle conv qparams from non-fused clamp#18778

Merged
bdemirb merged 2 commits intopytorch:mainfrom
bdemirb:baris_mletorch2004_RewriteConvPass_fails
Apr 9, 2026
Merged

Arm backend: Handle conv qparams from non-fused clamp#18778
bdemirb merged 2 commits intopytorch:mainfrom
bdemirb:baris_mletorch2004_RewriteConvPass_fails

Conversation

@bdemirb
Copy link
Copy Markdown
Collaborator

@bdemirb bdemirb commented Apr 8, 2026

The bug was caused by a pass-pipeline mismatch in the Arm
quantized lowering flow. For a delegated
conv -> relu/clamp -> cat branch under TOSA-1.0+INT+FP,
the activation can remain unfused when its output quantization
is non-fuseable (zp != qmin).

In that case, quantization annotation and qparam folding
legitimately leave input_qparams on the conv and
output_qparams on the surviving clamp, but
RewriteConvPass incorrectly assumed every quantized conv
would always own local output_qparams and crashed when
inserting the output rescale.

The fix makes RewriteConvPass resolve the conv's effective
output qparams from a following quantized clamp when needed,
which matches the real quantized output domain of the
unfused branch.

The patch also fixes synthetic bias creation for biasless
quantized convs by detecting quantization from
input_qparams instead of relying on local
output_qparams.

Signed-off-by: Baris Demir <baris.demir@arm.com>
Change-Id: I373e9eca8490148bc90dee487a2963612a494d8b
@bdemirb bdemirb requested a review from digantdesai as a code owner April 8, 2026 18:59
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Apr 8, 2026

🔗 Helpful Links

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

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

❌ 6 New Failures, 1 Pending, 6 Unrelated Failures

As of commit e184ca7 with merge base c72d176 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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 Apr 8, 2026
@bdemirb
Copy link
Copy Markdown
Collaborator Author

bdemirb commented Apr 8, 2026

@pytorchbot label ciflow/trunk

@bdemirb
Copy link
Copy Markdown
Collaborator Author

bdemirb commented Apr 8, 2026

@pytorchbot label "partner: arm"

@pytorch-bot pytorch-bot bot added the partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm label Apr 8, 2026
@bdemirb
Copy link
Copy Markdown
Collaborator Author

bdemirb commented Apr 8, 2026

@pytorchbot label "release notes: arm"

@pytorch-bot pytorch-bot bot added the release notes: arm Changes to the ARM backend delegate label Apr 8, 2026
@zingo
Copy link
Copy Markdown
Collaborator

zingo commented Apr 8, 2026

Zephyr fails due to that the cmake 3.29 pip package was removed from pip :( e.g. this line:
pip install west cmake==3.29 pyelftools ninja jsonschema
is unrelated and already fixed separatly, Ill rebase so the fix get included.

Copy link
Copy Markdown
Collaborator

@zingo zingo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK to merge is tests pass!

@bdemirb bdemirb merged commit 22867a9 into pytorch:main Apr 9, 2026
405 of 422 checks passed
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: arm Changes to the ARM backend delegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants