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

扩散模型的后训练Quantization

Post-training Quantization on Diffusion Models

Illinois Institute of Technology(伊利诺伊理工学院);Houmo AI(后摩智能);Tencent AI Lab(腾讯人工智能实验室);Cisco Research(思科研究院)

Yuzhang Shang, Zhihang Yuan, Bin Xie, Bingzhe Wu, Yan Yan

摘要:

去噪扩散(基于分数)生成模型最近在生成真实和多样化的数据方面取得了重大成就。这些方法定义了用于将数据转换为噪声的前向扩散过程和用于从噪声中采样数据的后向去噪过程。不幸的是,由于依赖于繁琐的神经网络的冗长的迭代噪声估计,当前去噪扩散模型的生成过程是非常缓慢的。它阻止了扩散模型的广泛部署,特别是在边缘设备上。以往的工作通过寻找更短而有效的采样轨迹来加速扩散模型(DM)的生成过程。然而,他们忽略了在每次迭代中使用重型网络进行噪声估计的成本。在这项工作中,我们从压缩噪声估计网络的角度加速生成。由于再训练DM的困难,我们排除了主流的训练感知压缩范例,并将训练后量化(PTQ)引入DM加速。然而,噪声估计网络的输出分布随时间步长而变化,使得以前的PTQ方法在DM中失败,因为它们是针对单时间步长场景设计的。为了设计一种针对DM的PTQ方法,我们从量化操作、校准数据集和校准度量三个方面探讨了DM的PTQ。我们总结和使用来自所有包容性的调查,制定我们的方法,特别是针对DM的独特的多时间步长结构的几个观察。实验上,我们的方法可以直接将全精度DM转换为8位模型,同时以免训练的方式保持甚至提高其性能。重要的是,我们的方法可以作为其他快速采样方法的即插即用模块,例如,DDIM。该代码可在https://github.com/42Shawn/PTQ4DM上获得。

英文摘要:

Denoising diffusion (score-based) generative models have recently achieved significant accomplishments in generating realistic and diverse data. These approaches define a forward diffusion process for transforming data into noise and a backward denoising process for sampling data from noise. Unfortunately, the generation process of current denoising diffusion models is notoriously slow due to the lengthy iterative noise estimations, which rely on cumbersome neural networks. It prevents the diffusion models from being widely deployed, especially on edge devices. Previous works accelerate the generation process of diffusion model (DM) via finding shorter yet effective sampling trajectories. However, they overlook the cost of noise estimation with a heavy network in every iteration. In this work, we accelerate generation from the perspective of compressing the noise estimation network. Due to the difficulty of retraining DMs, we exclude mainstream training-aware compression paradigms and introduce post-training quantization (PTQ) into DM acceleration. However, the output distributions of noise estimation networks change with time-step, making previous PTQ methods fail in DMs since they are designed for single-time step scenarios. To devise a DM-specific PTQ method, we explore PTQ on DM in three aspects: quantized operations, calibration dataset, and calibration metric. We summarize and use several observations derived from all-inclusive investigations to formulate our method, which especially targets the unique multi-time-step structure of DMs. Experimentally, our method can directly quantize full-precision DMs into 8-bit models while maintaining or even improving their performance in a training-free manner. Importantly, our method can serve as a plug-and-play module on other fast-sampling methods, e.g., DDIM. The code is available at https://github.com/42Shawn/PTQ4DM .

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

↑