Arm backend: Support a8w4 for convolution and linear.#16577
Merged
Erik-Lundell merged 2 commits intopytorch:mainfrom Jan 14, 2026
Merged
Arm backend: Support a8w4 for convolution and linear.#16577Erik-Lundell merged 2 commits intopytorch:mainfrom
Erik-Lundell merged 2 commits intopytorch:mainfrom
Conversation
Int4 is added as a TosaSpecialDtype. Since torch.dtype doesn't have int4, the dtype is carried in an int8, quantized with qmin=-7, qmax=7. This can then be detected when folding qparams to add the tosa_special_dtype meta. Some additional changes are needed to make sure the meta survives all the way to TOSA. Tests are added to conv2d, conv3d, depthwise conv, and linear. One conv2d test case was actually dw conv, so it was modified. Signed-off-by: Erik Lundell <erik.lundell@arm.com> Change-Id: Iedcc45f2e419c261fd3205981fa632736c69524d
Signed-off-by: Erik Lundell <erik.lundell@arm.com> Change-Id: Id0cd35dead7558346424bba9e7712b36e90f5429
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16577
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 1 New Failure, 1 Unrelated FailureAs of commit 4d157fc with merge base 9ba1b5d ( NEW FAILURE - The following job has failed:
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
zingo
approved these changes
Jan 14, 2026
Collaborator
zingo
left a comment
There was a problem hiding this comment.
OK to merge if/when all Arm backend and cortex-m tests passes!
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.
Int4 is added as a TosaSpecialDtype. Since torch.dtype doesn't
have int4, the dtype is carried in an int8, quantized with
qmin=-7, qmax=7. This can then be detected when folding qparams
to add the tosa_special_dtype meta.
Some additional changes are needed to make sure the meta survives
all the way to TOSA.
Tests are added to conv2d, conv3d, depthwise conv, and linear.
One conv2d test case was actually dw conv, so it was modified.
cc @freddan80 @per @zingo @oscarandersson8218 @digantdesai