Skip to content

Conversation

@AdrianLundell
Copy link
Collaborator

Since the transpose op doesn't require qparams but still expects input to be int8, the check in quantized_op_fusion_pass is moved from the call_operator level to the _get_replacement level. This way different ops can have different checks.

Since the transpose op doesn't require qparams but still
expects input to be int8, the check in quantized_op_fusion_pass
is moved from the call_operator level to the _get_replacement level.
This way different ops can have different checks.

Signed-off-by: Adrian Lundell <adrian.lundell@arm.com>
Change-Id: I7a069207c3c48a1a0882fa8076dbb69f564e1471
@pytorch-bot
Copy link

pytorch-bot bot commented Nov 17, 2025

🔗 Helpful Links

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

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

✅ You can merge normally! (2 Unrelated Failures)

As of commit 8487927 with merge base 0769abc (image):

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 Nov 17, 2025
@AdrianLundell AdrianLundell added module: arm Issues related to arm backend release notes: none Do not include this in the release notes labels Nov 17, 2025
@mergennachin mergennachin requested a review from Copilot November 17, 2025 16:31
Copilot finished reviewing on behalf of mergennachin November 17, 2025 16:35
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 adds permute/transpose operation support to the Cortex_M backend and refactors the quantization parameter check logic in the quantized operation fusion pass. The key change moves the qparams validation from the call_operator level to individual _get_replacement methods, allowing different operations to have different requirements—specifically enabling the transpose operation to work with int8 tensors without requiring quantization parameters.

  • Adds new transpose operation for the Cortex_M backend with CMSIS-NN integration
  • Refactors qparams checking to be per-operation in quantized_op_fusion_pass.py
  • Adds comprehensive test coverage for permute, transpose, and t() operations

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
backends/cortex_m/test/ops/test_transpose.py New test file with comprehensive test cases for permute, transpose, and t() operations
backends/cortex_m/passes/quantized_op_fusion_pass.py Moves qparams check from call_operator to individual replacement methods; adds _get_permute_replacement method
backends/cortex_m/ops/operators.yaml Adds transpose.out operator declaration to the operator schema
backends/cortex_m/ops/operators.py Implements transpose operation definition, meta function, and functional implementation
backends/cortex_m/ops/op_transpose.cpp C++ kernel implementation using CMSIS-NN's arm_transpose_s8 function
backends/cortex_m/CMakeLists.txt Adds op_transpose.cpp to build sources

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

AdrianLundell and others added 2 commits November 18, 2025 09:38
Signed-off-by: Adrian Lundell <adrian.lundell@arm.com>
Change-Id: I753b65577783fd6b238eb919b0fa73b63c803662
@AdrianLundell AdrianLundell requested a review from zingo November 18, 2025 08:40
@mansnils mansnils merged commit 2f9e574 into pytorch:main Nov 18, 2025
141 of 143 checks passed
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. module: arm Issues related to arm backend release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants