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

LRQ-DiT:面向图像与视频生成的扩散Transformer的对数旋转训练后量化

LRQ-DiT: Log-Rotation Post-Training Quantization of Diffusion Transformers for Image and Video Generation

Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院);Department of Electronic Engineering, Tsinghua University(清华大学电子工程系);School of Engineering and Applied Sciences, Harvard University(哈佛大学工程与应用科学学院);Department of Computer Science, City University of Hong Kong(香港城市大学计算机科学系)

Lianwei Yang, Haokun Lin, Tianchen Zhao, Yichen Wu, Hongyu Zhu, Ruiqi Xie, Zhenan Sun, Yu Wang, Qingyi Gu

AI总结:

本文提出LRQ-DiT框架,通过双对数量化和自适应旋转方案解决扩散Transformer低比特训练后量化中的权重长尾分布与激活异常值问题,在图像和视频生成中保持高质量。

摘要:

扩散Transformer(DiTs)在文本到图像和文本到视频生成中取得了令人瞩目的性能。然而,其高昂的计算成本和庞大的参数量给资源受限场景下的使用带来了重大挑战。模型的有效压缩已成为亟待解决的关键问题。训练后量化(PTQ)是减少内存占用和加速推理的一种有前景的解决方案,但现有PTQ方法在极低位设置下会遭受严重的性能退化。经过实验和分析,我们识别出DiT低比特PTQ的两个关键障碍:(1)DiT模型的权重遵循具有长尾的高斯型分布,导致均匀量化难以合理分配区间,从而产生显著的量化误差。这一问题已在不同DiT模型的线性层权重中被观察到,严重限制了性能。(2)DiT模型中存在两类激活异常值:(i)数值略微偏高的轻度异常值,以及(ii)集中在特定通道且幅度较大的显著异常值,它们干扰了激活量化。为解决这些问题,我们提出了LRQ-DiT,一个用于图像和视频生成的高效且准确的训练后量化框架。首先,我们引入双对数量化(TLQ),这是一种基于对数的方法,将更多量化区间分配给中间密集区域,有效实现与权重分布的对齐并减少量化误差。其次,我们提出自适应旋转方案(ARS),根据激活波动动态应用Hadamard旋转或异常值感知旋转,有效减轻两类异常值的影响。在多种文本到图像和文本到视频DiT模型上的大量实验表明,LRQ-DiT保持了较高的生成质量。

英文摘要:

Diffusion Transformers (DiTs) have achieved impressive performance in text-to-image and text-to-video generation. However, their high computational cost and large parameter sizes pose significant challenges for usage in resource-constrained scenarios. Effective compression of models has become a crucial issue that urgently needs to be addressed. Post-training quantization (PTQ) is a promising solution to reduce memory usage and accelerate inference, but existing PTQ methods suffer from severe performance degradation under extreme low-bit settings. After experiments and analysis, we identify two key obstacles to low-bit PTQ for DiTs: (1) the weights of DiT models follow a Gaussian-like distribution with long tails, causing uniform quantization to poorly allocate intervals and leading to significant quantization errors. This issue has been observed in the linear layer weights of different DiT models, which deeply limits the performance. (2) two types of activation outliers in DiT models: (i) Mild Outliers with slightly elevated values, and (ii) Salient Outliers with large magnitudes concentrated in specific channels, which disrupt activation quantization. To address these issues, we propose LRQ-DiT, an efficient and accurate post-training quantization framework for image and video generation. First, we introduce Twin-Log Quantization (TLQ), a log-based method that allocates more quantization intervals to the intermediate dense regions, effectively achieving alignment with the weight distribution and reducing quantization errors. Second, we propose an Adaptive Rotation Scheme (ARS) that dynamically applies Hadamard or outlier-aware rotations based on activation fluctuation, effectively mitigating the impact of both types of outliers. Extensive experiments on various text-to-image and text-to-video DiT models demonstrate that LRQ-DiT preserves high generation quality.

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

↑