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: Prepare TOSA validation and lowering for int64 - #24128
Map torch.int64 to TOSA INT64 and accept it in TosaArg when the
specification enables EXT-INT64. Extend dialect validators and node
visitors to accept int64 for operators covered by the extension.
Add dialect tests that verify int64 acceptance with the extension and
rejection without it.
Existing narrowing passes still convert int64 to int32. Preserving
int64 through those passes is deferred to a follow-up change.
Part 1 of 3.
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
The reason will be displayed to describe this comment to others. Learn more.
EXT-INT64 doesn't require PRO-INT. PRO-FP + EXT-INT64 is valid. For example, GATHER with FP32 input and INT64 indices is supported under this combination.
This might become clearer once EXT-INT64 is included in an officially released version of the TOSA specification.
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that makes sense. keeps_int64 is out of this PR now, but the same question comes up in the second one, so I tried dropping the INT check there and ran single-op models under TOSA-1.1+FP+int64.
Data movement ops on int64 (squeeze, unsqueeze, permute, expand, select, stack, transpose, concat, flip, tile) start failing in InsertDataLayoutCastsPass. Under an FP-only spec it moves integer data by casting it to float, and _int_to_fp_map stops at int32, so int64 raises TypeError: Data type torch.int64 of operator aten.view_copy.default is not supported by TOSA-1.1+FP+int64. Integer arithmetic on int64 (add, sub, mul, maximum, minimum, abs, neg) also gets delegated, which the FP profile rejects for int32 today.
Handling PRO-FP + EXT-INT64 fully looks like it would need per-profile capability lists and per-node narrowing, so for now I'd lean toward scoping this series to PRO-INT + EXT-INT64. I'm not attached to the INT check itself, though. If you have a cleaner way to express this, or would rather structure it differently, I'm happy to rework it.
YufengShi-dudu
changed the title
Arm backend: Make int64 representable under EXT-INT64 (1/3)
Arm backend: Prepare TOSA validation and lowering for int64
Oct 29, 2026
I do not expect and problems so this is mostly for you info. :) It should be the exact same tests that as was runned on the PR but just once more on them merged version.
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
6 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.
Map torch.int64 to TOSA INT64 and accept it in TosaArg when the
specification enables EXT-INT64. Extend dialect validators and node
visitors to accept int64 for operators covered by the extension.
Add dialect tests that verify int64 acceptance with the extension and
rejection without it.
Existing narrowing passes still convert int64 to int32. Preserving
int64 through those passes is deferred to a follow-up change.
Part 1 of 3.
This PR was authored with Claude Code.
cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani