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

扩散Transformer量化分析

An Analysis on Quantizing Diffusion Transformers

Meta GenAI

Yuewei Yang, Jialiang Wang, Xiaoliang Dai, Peizhao Zhang, Hongbo Zhang

AI总结:

本文首次针对仅Transformer结构的扩散模型提出无需优化的高效训练后量化方法,通过单步采样校准激活和分组权重量化实现低位量化,并在条件图像生成实验中验证其有效性。

摘要:

扩散模型(DMs)利用迭代去噪过程将随机噪声转化为合成数据。最初以UNet结构提出,扩散模型在生成图像方面表现出色,无论是否带有条件文本提示,生成的图像几乎无法区分。后来,仅使用Transformer的结构与扩散模型结合,以实现更好的性能。尽管潜在扩散模型(LDMs)通过在潜在空间中去噪降低了计算需求,但由于参数量和特征尺寸的巨大体量,在任何操作设备上进行图像推理仍然极其昂贵。训练后量化(PTQ)为在推理过程中实现更小的存储尺寸和更高内存效率的计算提供了一种即时补救措施。先前针对UNet结构上扩散模型PTQ的工作,通过适度优化解决了校准激活和权重参数的挑战。在这项工作中,我们首次在仅使用Transformer的结构上实现了无需任何优化的高效PTQ。通过分析量化扩散Transformer中激活和权重所面临的挑战,我们提出了一种对激活进行单步采样校准的方法,并对权重采用分组量化以实现低位量化。我们通过在条件图像生成上的初步实验,证明了所提方法的效率和有效性。

英文摘要:

Diffusion Models (DMs) utilize an iterative denoising process to transform random noise into synthetic data. Initally proposed with a UNet structure, DMs excel at producing images that are virtually indistinguishable with or without conditioned text prompts. Later transformer-only structure is composed with DMs to achieve better performance. Though Latent Diffusion Models (LDMs) reduce the computational requirement by denoising in a latent space, it is extremely expensive to inference images for any operating devices due to the shear volume of parameters and feature sizes. Post Training Quantization (PTQ) offers an immediate remedy for a smaller storage size and more memory-efficient computation during inferencing. Prior works address PTQ of DMs on UNet structures have addressed the challenges in calibrating parameters for both activations and weights via moderate optimization. In this work, we pioneer an efficient PTQ on transformer-only structure without any optimization. By analysing challenges in quantizing activations and weights for diffusion transformers, we propose a single-step sampling calibration on activations and adapt group-wise quantization on weights for low-bit quantization. We demonstrate the efficiency and effectiveness of proposed methods with preliminary experiments on conditional image generation.

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

↑