You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Arm backend: Keep int64 tensors under the int64 extension - #24128
The int64 narrowing passes predate EXT-INT64 and narrow even when the spec declares int64. This makes them consult the spec. Narrowing stays the default and is unchanged for existing spec strings; int64 is kept only when a spec asks for it.
keeps_int64() requires the INT profile and the extension, and gates the dtype mapping, narrowing passes, dialect validators and node visitors. TOSA_EXT_INT64_SupportList lists the operators the extension covers, alongside the other TOSA_EXT_*_SupportList lists. An operator absent from it narrows exactly as it does today, so ops the extension leaves out (clamp, matmul) and ops whose decomposition narrows (div.Tensor_mode, remainder) fall back to CPU instead of failing during serialization. int64 casts are restricted to bool and i32, and an operator with mixed int64/int32 operands falls back rather than reaching a validator requiring matching dtypes.
TOSA 1.1 is draft and EXT-INT64 is Experimental there, so it may change. TOSA-1.1+FP+int64 is unchanged, since the FP path never lowered int64. Follow-ups: FP+int64, and reductions over all axes.
Happy to split this up or rework it however the maintainers prefer.
Thank you for your pull request and welcome to our community.
Action Required
In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.
Process
In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.
Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.
If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Scalar precision loss and inconsistent partitioner checks can cause incorrect results or lowering failures, while the new tests do not verify int64 preservation.
Skipping placeholder narrowing lets unsupported int64 operators reach lowering. Under TOSA-1.1+INT+int64, BoolBitwiseSupported accepts int64 x | y, but the BITWISE_OR dialect validator and visitor only accept int8/int16/int32. Lowering then raises instead of leaving the operation on the portable path; BITWISE_XOR has the same mismatch. Keep the narrowing skip, but reject these unsupported dtype/operator combinations during partitioning, or implement int64 lowering where the TOSA specification permits it.
Assert delegation and preservation of INT64 operands
backends/arm/test/misc/test_int64.py:158
These cases only check that conversion completes; they do not assert delegation or preserved INT64 operands. They can therefore pass if the operators fall back to CPU or are silently narrowed. The small inputs would also hide narrowing in an output comparison. Assert that the expected operators delegate and retain INT64 operands, including the inputs to GREATER whose output is BOOL. Alternatively, assert delegation and compare execution results using values outside the int32 range.
Allow extension-enabled int64 comparison inputs in negative checks
The dialect now accepts int64 comparisons under TOSA-1.1+FP+int64, but _floating_profile_negative_checks() still installs CheckFPComparisonInputs whenever the INT profile is absent. That check rejects int64 inputs, so eq/gt/ge with int64 placeholders remain undelegated under this valid spec. Pass the specification to the negative check and allow extension-enabled int64 comparison inputs while preserving rejection for specs without the extension.
Add delegation, operator, and INT64 preservation assertions
backends/arm/test/misc/test_int64.py:158
This chain checks only that lowering completes. It still passes if every operation falls back to CPU or if tensors are narrowed to int32; it neither asserts delegation nor executes or inspects the lowered computation. Add delegate-count and no-leftover-operator assertions, then verify INT64 tensor dtypes in the delegated graph or compare exact outputs with width-sensitive inputs outside the int32 range. The current small inputs would not expose narrowing even if output comparison were added.
meta-claBot
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
Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ciflow/trunkCLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.community: contributionPRs coming from community (excluding hardware partners)module: armIssues related to arm backendpartner: armFor backend delegation, kernels, demo, etc. from the 3rd-party partner, Armrelease notes: armChanges to the ARM backend delegate
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The int64 narrowing passes predate
EXT-INT64and narrow even when the spec declares int64. This makes them consult the spec. Narrowing stays the default and is unchanged for existing spec strings; int64 is kept only when a spec asks for it.keeps_int64()requires the INT profile and the extension, and gates the dtype mapping, narrowing passes, dialect validators and node visitors.TOSA_EXT_INT64_SupportListlists the operators the extension covers, alongside the otherTOSA_EXT_*_SupportListlists. An operator absent from it narrows exactly as it does today, so ops the extension leaves out (clamp,matmul) and ops whose decomposition narrows (div.Tensor_mode,remainder) fall back to CPU instead of failing during serialization. int64 casts are restricted toboolandi32, and an operator with mixed int64/int32 operands falls back rather than reaching a validator requiring matching dtypes.TOSA 1.1 is draft and
EXT-INT64is Experimental there, so it may change.TOSA-1.1+FP+int64is unchanged, since the FP path never lowered int64. Follow-ups: FP+int64, and reductions over all axes.Happy to split this up or rework it however the maintainers prefer.
Fixes #24095
Test Plan
backends/arm/test/misc/test_int64.py: 14 pass, covering int64 add, sub, mul, a scalar comparison above 2**53, and matched and mixed-width SELECT.backends/arm/test/passes: 1049 pass, same failures as base.TOSA-1.0+INT; underTOSA-1.1+INT+int64no narrowing casts and no errors.TOSA-1.1+FP+int64against baseTOSA-1.1+FP: identical.This PR was authored with Claude Code.
cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani