-
Notifications
You must be signed in to change notification settings - Fork 741
Cortex_m backend: Add permute op #15848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
🔗 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 ( 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. |
There was a problem hiding this 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
transposeoperation 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.
Signed-off-by: Adrian Lundell <adrian.lundell@arm.com> Change-Id: I753b65577783fd6b238eb919b0fa73b63c803662
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.