Repository navigation
[Torch] Convert PT2E per-token quantization to LinalgExt - #25024
Merged
Merged
Conversation
roberto-laudani
force-pushed
the
users/roberto-laudani/qdq-per-token
branch
2 times, most recently
from
October 12, 2026 09:27
0e09d8b to
9a9d397
Compare
roberto-laudani
force-pushed
the
users/roberto-laudani/qdq-per-channel-group
branch
from
October 13, 2026 13:32
322517e to
4927934
Compare
roberto-laudani
force-pushed
the
users/roberto-laudani/qdq-per-token
branch
from
October 13, 2026 13:32
9a9d397 to
0bb8b19
Compare
roberto-laudani
force-pushed
the
users/roberto-laudani/qdq-per-channel-group
branch
from
October 13, 2026 13:38
4927934 to
5b1e0e6
Compare
roberto-laudani
force-pushed
the
users/roberto-laudani/qdq-per-token
branch
2 times, most recently
from
October 13, 2026 13:38
0bb8b19 to
305cc4e
Compare
roberto-laudani
force-pushed
the
users/roberto-laudani/qdq-per-channel-group
branch
from
October 13, 2026 13:39
5b1e0e6 to
82748f9
Compare
roberto-laudani
force-pushed
the
users/roberto-laudani/qdq-per-token
branch
2 times, most recently
from
October 13, 2026 14:01
ee64b17 to
0f711c9
Compare
roberto-laudani
force-pushed
the
users/roberto-laudani/qdq-per-channel-group
branch
4 times, most recently
from
October 14, 2026 14:50
7079f29 to
9ce7cea
Compare
roberto-laudani
force-pushed
the
users/roberto-laudani/qdq-per-token
branch
from
October 14, 2026 14:52
0f711c9 to
ee12717
Compare
roberto-laudani
marked this pull request as ready for review
October 14, 2026 14:53
roberto-laudani
requested review from
AGindinson,
rsuderman,
ziereis and
zjgarvey
as code owners
October 14, 2026 14:53
ziereis
approved these changes
Oct 14, 2026
Base automatically changed from
users/roberto-laudani/qdq-per-channel-group
to
main
October 14, 2026 20:47
Convert quantized_decomposed.quantize_per_token and dequantize_per_token to iree_linalg_ext.quantize_affine and dequantize_affine. As in torchao's PerToken granularity, the block size is one along every input dimension but the last, which each block spans, so the parameters are indexed by the leading dimensions and the data path needs no reshape. The unit last dimension that PT2E keeps in the parameters is dropped like any other static unit dimension. Per-token needs no reshape, so only the checks shared with the other granularities apply. Quantization computes in the scale type, f64 for the scales that torch.ao computes per token, as the per-token reference does. Dequantization matches the PT2E reference. The per-token reference adds the zero point before rounding, so quantize ties with odd zero points differ from it and from the Torch-to-Linalg lowering, which follows it. Depends on the torch-mlir ops from llvm/torch-mlir#4765. Signed-off-by: Roberto Laudani <[email protected]>
roberto-laudani
force-pushed
the
users/roberto-laudani/qdq-per-token
branch
from
October 15, 2026 15:53
ee12717 to
33c6590
Compare
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.
Extends
ConvertTorchQuantizationToLinalgExt(#24918) toquantized_decomposed.quantize_per_tokenanddequantize_per_token.Depends on #25008 and #25046.
Part of #24862.