arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.16732cs.CVcs.LG
收藏

DiRotQ:面向4位扩散变换器的旋转感知量化

DiRotQ: Rotation-Aware Quantization for 4-bit Diffusion Transformers

d-Matrix

Sayeh Sharify, Mahsa Salmani, Hesham Mostafa

AI总结:

本文提出DiRotQ,一种W4A4量化框架,通过旋转感知激活量化缓解扩散变换器在4位精度下的性能下降问题,同时引入VLM-as-a-Judge评估协议和Triton定制内核提升压缩下的效率与质量。

摘要:

扩散变换器(DiTs)在图像生成质量上达到最先进的水平,但在推理过程中带来显著的内存和计算成本。尽管激进的后训练量化(PTQ)到4位精度能带来显著的效率提升,但通常会导致严重的质量下降。现有方法,包括基于平滑的方法、混合精度方案、旋转技术以及低秩残差方法,部分缓解了这一问题,但仍与FP16/BF16性能存在明显差距。在本工作中,我们引入DiRotQ,一种W4A4 PTQ框架,通过旋转感知的激活量化来缓解这种降级。DiRotQ通过主成分分析(PCA)识别出捕捉主导激活方差的低秩子空间,在该子空间中保留系数以较高精度,同时将剩余组件量化为4位。在推理时,通过校准得出的正交变换将激活旋转到PCA基底中,而逆旋转被融合到层权重中,离线。结合基于GPTQ的权重量化,DiRotQ在PixArt-Σ数据集上实现了FID(更低越好)为15.9和PSNR(越高越好)为19.1 dB,优于先前最先进的SVDQuant(FID 18.9,PSNR 17.6)在同一INT W4A4设置下的表现。除了标准指标外,我们引入了VLM-as-a-Judge评估协议,这是该设置下的首次此类评估,提供了更全面的感知质量和提示对齐评估。在系统层面,我们实现了基于Triton的定制内核,以实现高效的端到端推理,将12B FLUX.1-dev模型的内存使用减少了2.1倍,并在24 GB RTX 4090 GPU上实现了2.3倍的加速。

英文摘要:

Diffusion Transformers (DiTs) achieve state-of-the-art image generation quality but incur substantial memory and computational costs at inference. While aggressive Post-Training Quantization (PTQ) to 4-bit precision offers significant efficiency gains, it typically results in severe quality degradation. Existing approaches, including smoothing-based methods, mixed-precision schemes, rotation techniques, and low-rank residual methods, partially mitigate this issue but still leave a noticeable gap to FP16/BF16 performance. In this work, we introduce DiRotQ, a W4A4 PTQ framework that mitigates this degradation through rotation-aware activation quantization. DiRotQ identifies a low-rank subspace capturing dominant activation variance via Principal Component Analysis (PCA), preserving coefficients in this subspace at higher precision while quantizing the remaining components to 4-bit. Activations are rotated into the PCA basis at inference time using calibration-derived orthogonal transformations, while the inverse rotation is fused into the layer weights offline. Combined with GPTQ-based weight quantization, DiRotQ achieves an FID of 15.9 and PSNR of 19.1 dB on PixArt over the MJHQ-30K dataset, outperforming the prior state-of-the-art SVDQuant (FID 18.9, PSNR 17.6) under the same INT W4A4 setting. Beyond standard metrics, we introduce a VLM-as-a-Judge evaluation protocol for diffusion model quantization, the first such evaluation in this setting, providing a more holistic assessment of perceptual quality and prompt alignment under aggressive compression. On the systems side, our Triton-based custom kernel enables efficient end-to-end inference, reducing memory usage of the 12B FLUX.1-dev model by 2.1x and achieving a 2.3x speedup over BF16 on an RTX 4090. On the RTX PRO 6000 with Blackwell architecture, DiRotQ achieves a 2.0x speedup and memory reduction over BF16 using NVFP4.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑