Arm backend: Support division with integer tensors#20536
Open
Erik-Lundell wants to merge 2 commits into
Open
Conversation
torch.div() with two integer tensors and a rounding mode gives integer output. The decomposition for this case instead yielded floating point output, causing issues in indexing operations which is typically where such integer division happens. When supported, utilize the TOSA operator INTDIV. It directly corresponds to the trunc case, and can be adjusted in the floor case. When not supported, use float path by first casting int tensors to float, and then casting the output back. Additionally - Improve scalar handling. - Add cast op to u55 testrunner to match u85 better. Signed-off-by: Erik Lundell <erik.lundell@arm.com> Change-Id: Ia5e3c956d5b83b4183171a8a230a510fc7a52149
If a int to fp cast goes directly into a quantized operator, the cast is a noop if it is quantized with unit quantization parameters (scale=1, zp=0). This means it can be handled, even if the backend doesn't support fp. - Add Fixed unit qparam annotation to such a cast. - Allow it in the partitioner. - Finally, make sure the cast dtype is correct after folding quant nodes. This pattern can appear in the wild in a model, or in a decomposition where you want to quantize an integer tensor. Signed-off-by: Erik Lundell <erik.lundell@arm.com> Change-Id: I93bfd17ba51e25f121f61cbe3003e9c6b9891401
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20536
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New Failures, 4 Unrelated Failures, 1 Unclassified FailureAs of commit e55e878 with merge base a8cfb75 ( NEW FAILURES - The following jobs have failed:
UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following jobs failed but was present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
zingo
approved these changes
Jun 26, 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
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.
cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani