Skip to content

Cortex-M backend: Add quantized int8 batch matmul (CMSIS-NN)#17799

Open
rascani wants to merge 1 commit intopytorch:mainfrom
rascani:cortex-m-batch-mm
Open

Cortex-M backend: Add quantized int8 batch matmul (CMSIS-NN)#17799
rascani wants to merge 1 commit intopytorch:mainfrom
rascani:cortex-m-batch-mm

Conversation

@rascani
Copy link
Contributor

@rascani rascani commented Mar 2, 2026

Summary

Add cortex_m::quantized_batch_matmul wrapping arm_batch_matmul_s8. The RHS is always pre-transposed: constant RHS (parameters) are transposed at AOT time in the pass, dynamic RHS get a cortex_m::transpose node inserted in the graph.

It would be preferable if we could pre-compute or cache the constant RHS kernel sums, but I could not find any public CMSIS-NN APIs that would allow us to do so.

Fixes #16109

Authored with Claude.

Test plan

pytest backends/cortex_m/test/ops/test_batch_matmul.py

Add cortex_m::quantized_batch_matmul wrapping arm_batch_matmul_s8.
The RHS is always pre-transposed: constant RHS (parameters) are
transposed at AOT time in the pass, dynamic RHS get a
cortex_m::transpose node inserted in the graph.

Authored with Claude.
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 2, 2026

🔗 Helpful Links

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

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

❌ 1 Awaiting Approval, 3 New Failures

As of commit cb40758 with merge base 25f2a3f (image):

AWAITING APPROVAL - The following workflow needs approval before CI can run:

NEW FAILURES - The following jobs have 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 Mar 2, 2026
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BatchMatMul : Add CMSIS NN Op support

1 participant