Repository navigation
[Torch] Preserve PT2E quantization as LinalgExt ops - #24918
Merged
Merged
Conversation
ziereis
force-pushed
the
users/ziereis/qdq-reshape-propagation
branch
from
September 11, 2026 07:24
6b7fe06 to
f5477f8
Compare
ziereis
force-pushed
the
users/ziereis/qdq-torch-conversion
branch
from
September 11, 2026 07:24
009c66d to
38febbf
Compare
ziereis
force-pushed
the
users/ziereis/qdq-reshape-propagation
branch
from
September 11, 2026 07:27
f5477f8 to
2bcf3a1
Compare
ziereis
force-pushed
the
users/ziereis/qdq-torch-conversion
branch
from
September 11, 2026 07:27
38febbf to
6ca5cd6
Compare
Manewing
force-pushed
the
users/ziereis/qdq-reshape-propagation
branch
from
September 15, 2026 08:38
2bcf3a1 to
719cc19
Compare
Manewing
force-pushed
the
users/ziereis/qdq-torch-conversion
branch
from
September 15, 2026 08:38
6ca5cd6 to
4fd9b48
Compare
ziereis
force-pushed
the
users/ziereis/qdq-reshape-propagation
branch
from
September 29, 2026 09:40
719cc19 to
8c34330
Compare
ziereis
force-pushed
the
users/ziereis/qdq-torch-conversion
branch
from
September 29, 2026 10:10
4fd9b48 to
594d13e
Compare
ziereis
changed the base branch from
users/ziereis/qdq-reshape-propagation
to
main
September 29, 2026 10:11
roberto-laudani
added a commit
to roberto-laudani/iree-test-suites
that referenced
this pull request
Oct 1, 2026
Adds end-to-end CPU quality regressions for MobileNetV2: the float32 model, and an int8 variant quantized with PT2E and the ExecuTorch XNNPACKQuantizer (int8 weights symmetric per channel, int8 activations asymmetric per tensor). IREE compiles the committed MLIR, fetches the externalized parameters and references from the Hugging Face Hub (pinned by revision), and compares the output logits against PyTorch. The PT2E test depends on iree-org/iree#24908 (torch-mlir update with typed quantized_decomposed ops) and iree-org/iree#24918 (PT2E quantization as LinalgExt ops). Signed-off-by: Roberto Laudani <[email protected]>
roberto-laudani
added a commit
to roberto-laudani/iree-test-suites
that referenced
this pull request
Oct 1, 2026
Adds end-to-end CPU quality regressions for MobileNetV2: the float32 model, and an int8 variant quantized with PT2E and the ExecuTorch XNNPACKQuantizer (int8 weights symmetric per channel, int8 activations asymmetric per tensor). IREE compiles the committed MLIR, fetches the externalized parameters and references from the Hugging Face Hub (pinned by revision), and compares the output logits against PyTorch. The PT2E test depends on iree-org/iree#24908 (torch-mlir update with typed quantized_decomposed ops) and iree-org/iree#24918 (PT2E quantization as LinalgExt ops). Signed-off-by: Roberto Laudani <[email protected]>
ziereis
force-pushed
the
users/ziereis/qdq-torch-conversion
branch
from
October 6, 2026 07:38
bd712df to
13f30e3
Compare
ziereis
marked this pull request as ready for review
October 6, 2026 08:15
ziereis
requested review from
jschuhmacher,
maxbartel and
zjgarvey
as code owners
October 6, 2026 08:15
Contributor
Author
|
@roberto-laudani Thanks for the review. I did quite a bunch of refactoring afterwards but i hope most of your comments stay addressed. Would be appreciated if you could take another look :) |
Contributor
|
Hi @ziereis, thanks for the changes. I added two more comments. Other than that the PR looks good to me. |
ziereis
force-pushed
the
users/ziereis/qdq-torch-conversion
branch
from
October 6, 2026 11:09
13f30e3 to
1723899
Compare
Convert the typed PT2E quantize_per_tensor, dequantize_per_tensor, quantize_per_channel, and dequantize_per_channel ops to iree_linalg_ext.quantize_affine and dequantize_affine before Torch-to-Linalg expands them, so later QDQ optimizations keep the scale, zero point, granularity, and range. Ops LinalgExt cannot express, such as fp8 storage, non-constant bounds or axis, an axis outside the input rank, and unknown dtypes, remain for the Torch-to-Linalg lowering. Well-formedness of the Torch ops is left to their verifiers. Per-tensor scales are applied in f32 for both directions, matching Inductor, which computes in f32 and rounds once to the result dtype. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Thomas Ziereis <[email protected]>
ziereis
force-pushed
the
users/ziereis/qdq-torch-conversion
branch
from
October 6, 2026 11:22
1723899 to
0898322
Compare
roberto-laudani
self-requested a review
October 6, 2026 15:07
roberto-laudani
approved these changes
Oct 6, 2026
This was referenced Oct 7, 2026
roberto-laudani
added a commit
that referenced
this pull request
Oct 15, 2026
Extends `ConvertTorchQuantizationToLinalgExt` (#24918) to `quantized_decomposed.quantize_per_token` and `dequantize_per_token`. Depends on #25008 and #25046. Part of #24862. Signed-off-by: Roberto Laudani <[email protected]>
7 of 8 tasks
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.
Converts the typed PT2E
quantized_decomposedper-tensor and per-channel quantize/dequantize ops toiree_linalg_ext.quantize_affine/dequantize_affineduring Torch input conversion, before Torch-to-Linalg expands them into scalar arithmetic.Ops LinalgExt cannot express (fp8 storage, non-constant bounds or axis, an axis outside the input rank, unknown dtypes) stay on the existing Torch-to-Linalg path. Well-formedness of the Torch ops is left to their verifiers.
Per-tensor scales are applied in f32 for both directions, matching Inductor, which computes in f32 and rounds once to the result dtype.
Part of #24862.
🤖 Generated with Claude Code