Skip to content

Arm backend: Update _adjust_weight_qspec_for_conv_transpose#18094

Open
mansnils wants to merge 2 commits intopytorch:mainfrom
mansnils:ops
Open

Arm backend: Update _adjust_weight_qspec_for_conv_transpose#18094
mansnils wants to merge 2 commits intopytorch:mainfrom
mansnils:ops

Conversation

@mansnils
Copy link
Collaborator

@mansnils mansnils commented Mar 11, 2026

  • FusedMovingAvgObsFakeQuantize only supports channel axis 0, fall back to non-fused (MovingAveragePerChannelMinMaxObserver + FakeQuantize) when applicable.
  • Always check/update ch_axis for FakeQuantize/observer constructor regardless if ch axis is correct in Qspec.
  • Adds unit tests.

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

* FusedMovingAvgObsFakeQuantize only supports channel axis 0, fall
back to non-fused (MovingAveragePerChannelMinMaxObserver +
FakeQuantize) when applicable.

* Always check/update ch_axis for FakeQuantize/observer constructor
regardless if ch axis is correct in Qspec.

* Add unit tests.

Jira: MLCE-1708

Signed-off-by: Måns Nilsson <mans.nilsson@arm.com>
Change-Id: Ie707c3f446bbc23a454d2ce7bbf9c0cd32582e05
@mansnils mansnils requested a review from digantdesai as a code owner March 11, 2026 08:26
@mansnils mansnils added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm ciflow/trunk release notes: arm Changes to the ARM backend delegate labels Mar 11, 2026
Copilot AI review requested due to automatic review settings March 11, 2026 08:26
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 11, 2026

🔗 Helpful Links

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

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

❌ 1 New Failure, 1 Cancelled Job

As of commit b2e6040 with merge base 569e7a9 (image):

NEW FAILURE - The following job has failed:

CANCELLED JOB - The following job was cancelled. Please retry:

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 Mar 11, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Arm backend’s conv_transpose2d weight-qspec adjustment to correctly handle per-channel axis selection (including TorchAO ctor rebuilding) and adds unit tests validating the behavior for both PTQ and QAT flows.

Changes:

  • Update _adjust_weight_qspec_for_conv_transpose to always fix ch_axis (including rebuilding QAT/PTQ observer/fake-quant ctors) and to fall back from fused fake-quant when axis != 0.
  • Add targeted unit tests for axis correction and fused→non-fused fallback behavior in conv_transpose2d quantization preparation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
backends/arm/quantizer/quantization_annotator.py Adjusts conv_transpose2d weight qspec axis handling and rebuilds TorchAO constructors (with fused fallback behavior).
backends/arm/test/ops/test_transpose_conv2d.py Adds unit tests covering QAT/PTQ axis correction and fused/non-fused fake-quant selection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Måns Nilsson <mans.nilsson@arm.com>
Change-Id: I592b4326001baba0eebf7951ef3f625f934bc9c9
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 skip-url-lint

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants