Skip to content

Added TorchAO INT4 weight-only quantization + Linear, FLUX, and Qwen examples - #4588

Closed
micwill755 wants to merge 1 commit into
pytorch:torchao-workflowsfrom
micwill755:torchao-int4-woq
Closed

Added TorchAO INT4 weight-only quantization + Linear, FLUX, and Qwen examples#4588
micwill755 wants to merge 1 commit into
pytorch:torchao-workflowsfrom
micwill755:torchao-int4-woq

Conversation

@micwill755

@micwill755 micwill755 commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Extend torchao.dequantize_affine so group-wise INT4 is re-packed to trt.DataType.INT4 (symmetric zero-point; blocked DQ currently FP32 then cast).
  • Add TorchAO INT4 WOQ gallery examples: toy Linear, FLUX.1-dev, and Qwen3-8B Hub (pytorch/Qwen3-8B-INT4).
  • Document the path in the quantization user guide, troubleshooting, and example index.

This sits on top of #4577 (TorchAO FP8). INT4 compile needs immutable_weights=True.

Review note: GitHub native stacks do not support PRs from forks, so this is a regular PR with base torchao-workflows. Please review the latest commit (abe9274) — the INT4 delta vs #4577. After #4577 merges, the remaining diff vs main should be that commit only.

Test plan

  • tests/py/dynamo/models/test_torchao_fp8_woq.py::test_linear_int4_woq (CUDA)
  • python examples/dynamo/torchao/quantize_linear_int4_woq.py
  • FLUX / Qwen3 examples on a GPU with enough VRAM

…examples

Keep group-wise INT4 as packed TRT INT4 constants (symmetric DQ) instead of
folding weights to BF16, and document the Linear / FLUX / Qwen3 export paths.
@meta-cla meta-cla Bot added the cla signed label Aug 26, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation component: tests Issues re: Tests component: lowering Issues re: The lowering / preprocessing passes component: conversion Issues re: Conversion stage component: core Issues re: The core compiler component: converters Issues re: Specific op converters component: api [Python] Issues re: Python API component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths labels Aug 26, 2026
@micwill755

Copy link
Copy Markdown
Collaborator Author

Closing this fork-headed PR so we can reopen the same commits from pytorch/TensorRT branches. GitHub native Stacks cannot include PRs from forks. Replacement incoming.

@micwill755

Copy link
Copy Markdown
Collaborator Author

Replacement (same-repo stack 2/2): #4590

@micwill755
micwill755 deleted the torchao-int4-woq branch August 26, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed component: api [Python] Issues re: Python API component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: core Issues re: The core compiler component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: lowering Issues re: The lowering / preprocessing passes component: tests Issues re: Tests documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant