Skip to content

[Torch] Convert torchao affine quantization to LinalgExt - #25104

Merged
roberto-laudani merged 3 commits into
mainfrom
users/roberto-laudani/qdq-torchao-affine
Nov 2, 2026
Merged

roberto-laudani merged 3 commits into
mainfrom
users/roberto-laudani/qdq-torchao-affine

Conversation

@roberto-laudani

@roberto-laudani roberto-laudani commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Converts the typed torchao quantize_affine / dequantize_affine ops to iree_linalg_ext.quantize_affine / dequantize_affine, reusing the PT2E conversion. Ops whose parameters LinalgExt cannot index fall back to Torch-to-Linalg. This also fixes PT2E per-channel-group ops with flattened scales, which produced invalid IR. Also drops two unused includes from LinalgExtOps.cpp.

Part of #24862.

@roberto-laudani
roberto-laudani force-pushed the users/roberto-laudani/qdq-torchao-affine branch 2 times, most recently from 1771014 to acfe37c Compare October 22, 2026 08:37
@roberto-laudani
roberto-laudani marked this pull request as ready for review October 22, 2026 08:39
@roberto-laudani
roberto-laudani force-pushed the users/roberto-laudani/qdq-torchao-affine branch from acfe37c to e53bbf2 Compare October 22, 2026 08:44
@roberto-laudani
roberto-laudani force-pushed the users/roberto-laudani/qdq-torchao-affine branch from e53bbf2 to d36397f Compare October 22, 2026 08:49
@roberto-laudani roberto-laudani self-assigned this Oct 22, 2026
@roberto-laudani
roberto-laudani force-pushed the users/roberto-laudani/qdq-torchao-affine branch from d36397f to b5ab086 Compare October 23, 2026 09:00
@roberto-laudani
roberto-laudani changed the base branch from main to users/roberto-laudani/qdq-float-zero-points October 23, 2026 09:00
Base automatically changed from users/roberto-laudani/qdq-float-zero-points to main October 23, 2026 10:05
@roberto-laudani
roberto-laudani force-pushed the users/roberto-laudani/qdq-torchao-affine branch from b5ab086 to d904de5 Compare October 23, 2026 11:03

@ziereis ziereis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cool to see that the lowering of this falls into place quite nicely :)

@ziereis

ziereis commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

ci error looks legit though

@roberto-laudani

Copy link
Copy Markdown
Contributor Author

Yes, it's a real build failure, but only because IREE's torch-mlir pin doesn't have the typed torchao ops yet since it depends on llvm/torch-mlir#4843.

@roberto-laudani
roberto-laudani force-pushed the users/roberto-laudani/qdq-torchao-affine branch from d904de5 to 9cbffc8 Compare October 29, 2026 15:45
@roberto-laudani
roberto-laudani force-pushed the users/roberto-laudani/qdq-torchao-affine branch from 9cbffc8 to 0370ffa Compare October 29, 2026 15:54
@roberto-laudani
roberto-laudani merged commit 3c2b6b6 into main Nov 2, 2026
86 of 88 checks passed
@roberto-laudani
roberto-laudani deleted the users/roberto-laudani/qdq-torchao-affine branch November 2, 2026 10:09
@devtbi devtbi mentioned this pull request Nov 16, 2026
8 tasks done
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.

2 participants