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

TFMQ-DM:面向扩散模型的时序特征维护量化方法

TFMQ-DM: Temporal Feature Maintenance Quantization for Diffusion Models

Beihang University(北京航空航天大学);SenseTime Research(商汤科技研究院);Monash University(莫纳什大学);UT Austin(德克萨斯大学奥斯汀分校)

Yushi Huang, Ruihao Gong, Jing Liu, Tianlong Chen, Xianglong Liu

AI总结:

针对扩散模型现有训练后量化方法干扰时序特征、压缩效率低的问题,提出基于时序信息块的TFMQ框架,通过TIAR和FSC对齐全精度时序特征,首次在4位量化下达到接近全精度的生成效果,且量化速度提升2倍。

摘要:

扩散模型作为当前主流的图像生成框架,因推理耗时长、内存占用高,在广泛应用层面面临严峻挑战。高效的训练后量化(PTQ)是解决传统模型此类问题的关键手段。与传统模型不同,扩散模型高度依赖时间步$t$以实现理想的多轮去噪效果。通常,来自有限集合$\{1, \ldots, T\}$的$t$会由几个完全与采样数据无关的模块编码为时序特征。然而,现有PTQ方法并未对这些模块进行单独优化,它们采用了不合适的重建目标与复杂的校准方法,导致时序特征和去噪轨迹受到严重干扰,压缩效率也较为低下。为解决上述问题,我们提出了时序特征维护量化(TFMQ)框架,该框架基于仅与时间步$t$相关、与采样数据无关的时序信息块构建。依托这一创新性的模块设计,我们设计了时序信息感知重建(TIAR)与有限集合校准(FSC),以在有限时间内对齐全精度时序特征。借助该框架,我们能够保留绝大多数时序信息,保障端到端的生成质量。我们在多个数据集与多种扩散模型上开展了大量实验,结果证明该方法取得了当前最优的性能。值得注意的是,我们的量化方法首次在4位权重量化条件下实现了与全精度模型近乎相当的模型性能。此外,我们的方法几乎不会产生额外计算开销,在LSUN-Bedrooms $256 \times 256$数据集上,量化速度相比此前的方法提升了$2.0 \times$。我们的代码已公开于https://github.com/ModelTC/TFMQ-DM。

英文摘要:

The Diffusion model, a prevalent framework for image generation, encounters significant challenges in terms of broad applicability due to its extended inference times and substantial memory requirements. Efficient Post-training Quantization (PTQ) is pivotal for addressing these issues in traditional models. Different from traditional models, diffusion models heavily depend on the time-step $t$ to achieve satisfactory multi-round denoising. Usually, $t$ from the finite set $\{1, \ldots, T\}$ is encoded to a temporal feature by a few modules totally irrespective of the sampling data. However, existing PTQ methods do not optimize these modules separately. They adopt inappropriate reconstruction targets and complex calibration methods, resulting in a severe disturbance of the temporal feature and denoising trajectory, as well as a low compression efficiency. To solve these, we propose a Temporal Feature Maintenance Quantization (TFMQ) framework building upon a Temporal Information Block which is just related to the time-step $t$ and unrelated to the sampling data. Powered by the pioneering block design, we devise temporal information aware reconstruction (TIAR) and finite set calibration (FSC) to align the full-precision temporal features in a limited time. Equipped with the framework, we can maintain the most temporal information and ensure the end-to-end generation quality. Extensive experiments on various datasets and diffusion models prove our state-of-the-art results. Remarkably, our quantization approach, for the first time, achieves model performance nearly on par with the full-precision model under 4-bit weight quantization. Additionally, our method incurs almost no extra computational cost and accelerates quantization time by $2.0 \times$ on LSUN-Bedrooms $256 \times 256$ compared to previous works. Our code is publicly available at https://github.com/ModelTC/TFMQ-DM.

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

↑