Skip to content

Cortex-M: remove extractScalarToInt helpers, use static_cast directly#17543

Open
rascani wants to merge 2 commits intopytorch:mainfrom
rascani:cortex-m-remove-extractscalar
Open

Cortex-M: remove extractScalarToInt helpers, use static_cast directly#17543
rascani wants to merge 2 commits intopytorch:mainfrom
rascani:cortex-m-remove-extractscalar

Conversation

@rascani
Copy link
Contributor

@rascani rascani commented Feb 18, 2026

Summary

Since #16322 changed all Scalar parameters to int64_t, the extractScalarToInt32 and extractScalarToInt helpers in cortex_m_ops_common.h are unnecessary indirection — they called Scalar::to<int64_t>() then cast, but the values are already int64_t.

Replace all call sites with direct static_cast and remove the helpers, the unused Scalar type alias, and the scalar_utils.h include. Also update the quantized_mul Python schema in operators.py to use int instead of Scalar, matching the C++ kernel and operators.yaml.

Additionally remove a duplicate kernel_includes.h include from cortex_m_ops_common.h.

Test plan

pytest backends/cortex_m/test/

Since pytorch#16322 changed all Scalar parameters to int64_t, the
extractScalarToInt32 and extractScalarToInt helpers in
cortex_m_ops_common.h are unnecessary indirection — they called
Scalar::to<int64_t>() then cast, but the values are already int64_t.

Replace all call sites with direct static_cast and remove the helpers,
the unused Scalar type alias, and the scalar_utils.h include. Also
update the quantized_mul Python schema in operators.py to use int
instead of Scalar, matching the C++ kernel and operators.yaml.

Additionally remove a duplicate kernel_includes.h include from
cortex_m_ops_common.h.

Co-authored-by: Claude <noreply@anthropic.com>
@pytorch-bot
Copy link

pytorch-bot bot commented Feb 18, 2026

🔗 Helpful Links

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

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

❌ 5 New Failures, 1 Unrelated Failure

As of commit 79c13af with merge base 119a099 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@rascani rascani requested a review from psiddh February 18, 2026 23:16
@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 18, 2026
@github-actions
Copy link

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.

1 participant

Comments