Skip to content

Support Qwen-Image-2.1 Turbo prequantized INT8 on CUDA and ROCm - #1767

Merged
helloyongyang merged 7 commits into
ModelTC:mainfrom
q6y6y6:codex/qwen21-prequantized-int8
Nov 30, 2026
Merged

helloyongyang merged 7 commits into
ModelTC:mainfrom
q6y6y6:codex/qwen21-prequantized-int8

Conversation

@q6y6y6

@q6y6y6 q6y6y6 commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Qwen-Image-2.1 can use the released Turbo INT8 transformer shards with int8-triton on CUDA and int8-rocm on ROCm. Both loaders retain INT8 weights and FP32 per-output-channel scales. ROCm also accepts the original BF16 input for online quantization. Includes single-GPU configuration examples.

Windows validation

Verified checkpoint revision b572c2d129f1f440c1643e1be730ac1336f2d5d5 on both machines. Checked both shard hashes, all 224 INT8 weight/scale pairs, all three projection dimensions against INT32 references, malformed scales and ROCm online quantization. Both platforms generated two 512×512 images with the same prompt, seed 42 and eight Turbo steps. Each platform's two INT8 images matched pixel for pixel.

Windows GPU BF16 first request INT8 first request INT8 second request Peak allocated by PyTorch, BF16 → INT8
RTX 5090 Laptop / PyTorch 2.11 cu128 10.71 s 12.57 s 1.75 s 15.83 → 22.59 GiB
Radeon 8060S / PyTorch 2.11 ROCm 7.14.1 12.17 s 14.61 s 11.86 s 29.15 → 22.66 GiB

Timings exclude model initialization. The first CUDA INT8 image request used a fresh Triton cache. The RTX BF16 baseline uses model-level offload (3.93 s for its second 512×512 request). The original resident DiT setup took 357.80 s and peaked at 29.08 GiB. Both phase-offloaded BF16 images matched the resident BF16 image pixel for pixel. At 1024×1024 the phase-offloaded BF16 profile took 15.60 s and 12.24 s for the first and second requests. RTX INT8 uses a resident DiT, so the RTX columns compare different memory strategies. On gfx1151, packing the INT8 weights once at load time reduced first/second request times from 118.78/115.61 seconds to 14.61/11.86 seconds. Both images matched their pre-optimization outputs pixel for pixel. These measurements cover one 512×512 prompt on each machine. Mean absolute RGB pixel differences versus each BF16 output were 2.63 and 9.00 on a 0–255 scale.

CUDA validation used matching CPython development files for the Windows Triton compiler. On gfx1151, the Windows application’s math SDPA setting was used for both precisions.

Local block offload and regression validation

On Radeon 8060S, ordinary block offload with the official prequantized checkpoint produced a 512×512 image pixel-identical to resident INT8 (8 steps, seed 42). CPU source blocks own the weights; the two accelerator slots reuse their storage. The local acceptance suite exercised two consecutive swaps, distinct per-token activation scales, and rank-local checkpoint loading for row/column TP on CPU. All six tests passed on ROCm; CUDA passed four applicable tests with two ROCm-only skips. TP coverage simulates two ranks and does not require a distributed job.

@q6y6y6
q6y6y6 marked this pull request as ready for review November 30, 2026 03:09
@q6y6y6
q6y6y6 force-pushed the codex/qwen21-prequantized-int8 branch from a4600bb to 17effb2 Compare November 30, 2026 04:26
@helloyongyang
helloyongyang merged commit acc30da into ModelTC:main Nov 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants