Arm backend: Fix int64 argmax delegation rejection#20765
Open
zingo wants to merge 1 commit into
Open
Conversation
TOSA 1.0 ARGMAX returns int32 indices, while aten.argmax returns
int64. If the graph consumes the raw aten.argmax result on CPU
fallback, delegating ARGMAX changes the dtype and can fail with an
Int-vs-Long mismatch.
Keep delegation enabled only when every user immediately casts the
argmax result to int32:
aten.argmax
-> _to_dim_order_copy(dtype=int32)
-> users
Otherwise reject the node during support checking so the
PyTorch-compatible int64 result is preserved.
Fixes the flow test:
test_argmax_dim[arm_tosa_fp]
Signed-off-by: Zingo Andersen <Zingo.Andersen@arm.com>
Change-Id: I7222ab7d0feb16eec0d83c841a87e671ca754680
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20765
Note: Links to docs will display an error until the docs builds have been completed. ❌ 3 New Failures, 9 Pending, 1 Unrelated FailureAs of commit 6f55027 with merge base b1ef9a5 ( 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. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
TOSA 1.0 ARGMAX returns int32 indices, while aten.argmax returns int64. If the graph consumes the raw aten.argmax result on CPU fallback, delegating ARGMAX changes the dtype and can fail with an Int-vs-Long mismatch.
Keep delegation enabled only when every user immediately casts the argmax result to int32:
aten.argmax
-> _to_dim_order_copy(dtype=int32)
-> users
Otherwise reject the node during support checking so the PyTorch-compatible int64 result is preserved.
Fixes the flow test:
test_argmax_dim[arm_tosa_fp]
cc @digantdesai @freddan80 @per @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani