Skip to content

Arm backend: Support a8w4 for convolution and linear.#16577

Merged
Erik-Lundell merged 2 commits intopytorch:mainfrom
Erik-Lundell:int4
Jan 14, 2026
Merged

Arm backend: Support a8w4 for convolution and linear.#16577
Erik-Lundell merged 2 commits intopytorch:mainfrom
Erik-Lundell:int4

Conversation

@Erik-Lundell
Copy link
Collaborator

@Erik-Lundell Erik-Lundell commented Jan 14, 2026

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

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
@pytorch-bot
Copy link

pytorch-bot bot commented Jan 14, 2026

🔗 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 SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 1 New Failure, 1 Unrelated Failure

As of commit 4d157fc with merge base 9ba1b5d (image):

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.

@meta-cla meta-cla bot 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 Jan 14, 2026
@Erik-Lundell Erik-Lundell added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: arm Changes to the ARM backend delegate ciflow/trunk and removed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Jan 14, 2026
Copy link
Collaborator

@zingo zingo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK to merge if/when all Arm backend and cortex-m tests passes!

@meta-cla meta-cla bot 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 Jan 14, 2026
@Erik-Lundell Erik-Lundell merged commit a9d8230 into pytorch:main Jan 14, 2026
306 of 321 checks passed
@Erik-Lundell Erik-Lundell deleted the int4 branch February 4, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: arm Changes to the ARM backend delegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants