Skip to content

[Torch] Preserve PT2E quantization as LinalgExt ops - #24918

Draft
ziereis wants to merge 2 commits into
users/ziereis/qdq-reshape-propagationfrom
users/ziereis/qdq-torch-conversion
Draft

ziereis wants to merge 2 commits into
users/ziereis/qdq-reshape-propagationfrom
users/ziereis/qdq-torch-conversion

Conversation

@ziereis

@ziereis ziereis commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Preserves PT2E quantization during Torch input conversion as
iree_linalg_ext.quantize_affine and
iree_linalg_ext.dequantize_affine operations. This retains the affine
parameters needed by the propagation and integer-contraction rewrites instead
of expanding quantization into scalar arithmetic during Torch-to-Linalg
lowering.

The conversion handles the typed per-tensor and per-channel PT2E quantize and
dequantize operations. It carries constant quantization bounds, storage
signedness, optional zero points, and scalar or channel parameter maps into the
LinalgExt representation. Operations with dynamic bounds, dynamic axes, or
incompatible tensor metadata remain available to the general torch-mlir
lowering.

Builds on the QDQ propagation in #24906
and requires the typed PT2E operations supplied by the torch-mlir update in
#24908. Until #24908 lands, its
one-line submodule update also appears in this stacked diff. This completes the
Torch import portion of Linalg(_ext) native QDQ #24862.


Stack created with GitHub Stacks CLIGive Feedback 💬

@ziereis
ziereis added this pull request to stack #24903 September 11, 2026 06:50
@ziereis ziereis changed the title users/ziereis/qdq torch conversion [Torch] Preserve PT2E quantization as LinalgExt ops Sep 11, 2026
@ziereis
ziereis force-pushed the users/ziereis/qdq-torch-conversion branch from 009c66d to 38febbf Compare September 11, 2026 07:24
@ziereis
ziereis force-pushed the users/ziereis/qdq-torch-conversion branch from 38febbf to 6ca5cd6 Compare September 11, 2026 07:27
Update to current upstream torch-mlir through e447c3fa, using the IREE
integration revision adapted to the current LLVM pin.

Signed-off-by: Thomas Ziereis <ziereis@roofline.ai>
Convert the typed PT2E per-tensor and per-channel quantize and
dequantize operations before Torch-to-Linalg expands them. This keeps
affine parameter maps, ranges, and signedness available to later QDQ
optimizations.

Leave operations with dynamic or incompatible metadata for the
existing torch-mlir lowering.

Signed-off-by: Thomas Ziereis <ziereis@roofline.ai>
@Manewing
Manewing force-pushed the users/ziereis/qdq-torch-conversion branch from 6ca5cd6 to 4fd9b48 Compare September 15, 2026 08:38

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant