Skip to content

Conversation

@rascani
Copy link
Contributor

@rascani rascani commented Feb 9, 2026

Summary

Add cortex_m::pad that delegates to arm_pad_s8. The operator takes pre_pad/post_pad arrays in CMSIS-NN 4D format — the AoT fusion pass converts from PyTorch's constant_pad_nd padding format, validates rank/padding constraints, and quantizes the float pad value to int8.

Pad is a shared-qspec op (input/output share quantization parameters).

Fixes #16111

Test plan

source examples/arm/arm-scratch/setup_path.sh
backends/cortex_m/test/build_test_runner.sh
pytest --config-file=backends/arm/test/pytest.ini backends/cortex_m/test/ops/test_pad.py

Add cortex_m::pad that delegates to arm_pad_s8. The operator takes
pre_pad/post_pad arrays in CMSIS-NN 4D format — the AoT fusion pass
converts from PyTorch's constant_pad_nd padding format, validates
rank/padding constraints, and quantizes the float pad value to int8.

Pad is a shared-qspec op (input/output share quantization parameters).

Co-authored-by: Claude <[email protected]>
@pytorch-bot
Copy link

pytorch-bot bot commented Feb 9, 2026

🔗 Helpful Links

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

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

❌ 10 New Failures

As of commit 9285d58 with merge base f4ef59f (image):

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 Feb 9, 2026
@rascani rascani added ciflow/trunk and removed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Feb 9, 2026
@github-actions
Copy link

github-actions bot commented Feb 9, 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.

@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 Feb 10, 2026
Copy link
Collaborator

@AdrianLundell AdrianLundell left a comment

Choose a reason for hiding this comment

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

A few nits, but overall really nice job!

Fix copyright headers to use Meta-only format, tighten qtol from 1 to 0
(pad is exact), and use quantize_val helper instead of inline clamping.

Authored with Claude.
@rascani
Copy link
Contributor Author

rascani commented Feb 10, 2026

Failures unrelated.

@rascani rascani merged commit 38ebc35 into pytorch:main Feb 10, 2026
388 of 402 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pad: Add CMSIS NN Op support

2 participants