arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.15465cs.CV
收藏

FP4DiT: 向有效浮点量化扩散变换器迈进

FP4DiT: Towards Effective Floating Point Quantization for Diffusion Transformers

Department of Electrical and Computer Engineering, Faculty of Engineering University of Alberta(电气与计算机工程系,工程学院,阿尔伯塔大学);Division of Computer Science and Engineering, College of Engineering Louisiana State University(计算机科学与工程系,工程学院,路易斯安那州立大学)

Ruichen Chen, Keith G. Mills, Di Niu

AI总结:

FP4DiT通过浮点量化技术实现更高效的扩散变换器量化,提升图像生成性能。

摘要:

扩散模型(DM)已彻底改变了文本到图像的视觉生成过程。然而,DMs巨大的计算成本和模型体积阻碍了实际部署,尤其是在边缘设备上。后训练量化(PTQ)是一种轻量级方法,可以减轻这些负担,而无需训练或微调。尽管最近的DM PTQ方法在整数基的PTQ上实现了W4A8(即4位权重和8位激活),但仍然有两个关键限制:首先,虽然大多数现有的DM PTQ方法在经典DMs如Stable Diffusion XL 1.5或更早版本上进行评估,这些版本使用卷积U-Net,而新的扩散变换器(DiT)模型如PixArt系列、Hunyuan等采用根本不同的变换器骨干网络来实现更优的图像合成。其次,整数(INT)量化在DM PTQ中占主导地位,但并不适合网络权重和激活分布,而浮点量化(FPQ)仍处于研究初期,然而它在低比特设置中能够更好地对齐权重和激活分布。在本文中,我们引入了FP4DiT,一种利用FPQ实现W4A6量化的PTQ方法。具体来说,我们扩展并推广了自适应四舍五入PTQ技术,以充分校准FPQ的权重量化,并展示了DiT激活依赖于输入补丁数据,需要鲁棒的在线激活量化技术。实验结果表明,FP4DiT在W4A6和W4A8精度水平上相比整数基PTQ实现了更高的CLIP、ImageReward和HPSv2性能,同时在PixArt-α、PixArt-Σ和Hunyuan上生成逼真的视觉内容。

英文摘要:

Diffusion Models (DM) have revolutionized the text-to-image visual generation process. However, the large computational cost and model footprint of DMs hinders practical deployment, especially on edge devices. Post-training quantization (PTQ) is a lightweight method to alleviate these burdens without the need for training or fine-tuning. While recent DM PTQ methods achieve W4A8 \blue{(i.e., 4-bit weights and 8-bit activations)} on integer-based PTQ, two key limitations remain: First, while most existing DM PTQ methods evaluate on classical DMs like Stable Diffusion XL, 1.5 or earlier, which use convolutional U-Nets, newer Diffusion Transformer (DiT) models like the PixArt series, Hunyuan and others adopt fundamentally different transformer backbones to achieve superior image synthesis. Second, integer (INT) quantization is prevailing in DM PTQ but does not align well with the network weight and activation distribution, while Floating-Point Quantization (FPQ) is still under-investigated, yet it holds the potential to better align the weight and activation distributions in low-bit settings for DiT. In this paper, we introduce FP4DiT, a PTQ method that leverages FPQ to achieve W4A6 quantization. Specifically, we extend and generalize the Adaptive Rounding PTQ technique to adequately calibrate weight quantization for FPQ and demonstrate that DiT activations depend on input patch data, necessitating robust online activation quantization techniques. Experimental results demonstrate that FP4DiT achieves higher CLIP, ImageReward and HPSv2 performance compared to integer-based PTQ at the W4A6 and W4A8 precision levels while generating convincing visual content on PixArt-$α$, PixArt-$Σ$ and Hunyuan.

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

↑