Repository navigation
Qualcomm AI Engine Direct - Exact integer floor_divide and remainder - #24057
Open
msluszniak wants to merge 1 commit into
Open
msluszniak wants to merge 1 commit into
msluszniak wants to merge 1 commit into
Conversation
Integer // and % were decomposed into float div + floor, which is inexact on the HTP (23999 // 80 gave 300 in fp16; the floor_divide test had a "rounding issue" TODO). Integer remainder now lowers to QNN ElementWiseMod (the result takes the divisor's sign, like torch), and integer floor division to int32 (x - x mod y) / y, for both floor_divide and div(rounding_mode="floor"). DecomposeFloorDivide is removed; float paths are unchanged.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24057
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 Awaiting Approval, 4 New FailuresAs of commit 12ba70b with merge base e6cfbf8 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
borys3kk
pushed a commit
to borys3kk/swm_executorch
that referenced
this pull request
Oct 22, 2026
Integer // and % were decomposed into float div + floor, which is inexact on the HTP (23999 // 80 gave 300 in fp16). Integer remainder now lowers to QNN ElementWiseMod (the result takes the divisor's sign, like torch), and integer floor division to int32 (x - x mod y) / y, for both floor_divide and div(rounding_mode="floor"). DecomposeFloorDivide is removed; float paths are unchanged. Backport of pytorch/executorch#24057 (replaces the #24034 backport's DecomposeFloorDivide change; its scalar test stays). 1.4.1 has no rework pass tests.
This branch has not been deployed
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.
Summary
Integer
//and%went through float div + floor, which is inexact on the HTP (23999 // 80gives 300 in fp16; the floor_divide test had a "rounding issue" TODO). Integer remainder now lowers to QNNElementWiseModand integer floor division to int32(x - x mod y) / y, for bothfloor_divideanddiv(rounding_mode="floor").DecomposeFloorDivideis removed (supersedes #24034); float paths are unchanged.Test plan
New int cases in
test_qnn_backend_floor_divide/test_qnn_backend_remainder(including the re-enabled TODO case and a Python-scalar divisor) fail on main in fp16 and pass here (x86 simulator).test_passes.pyandrework/passes/test.pygive the same results as main; the fullTestQNNFloatingPointOperator/TestQNNQuantizedOperatorsuites pass.cc @cccclai @winskuo-quic @shewu-quic @haowhsu-quic @DannyYuyang-quic @cbilgin @abhinaykukkadapu @psiddh @nil-is-all