arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2408.06995cs.CV
收藏

面向高效高质量扩散模型的低比特浮点量化

Low-Bitwidth Floating Point Quantization for Efficient High-Quality Diffusion Models

University of Toronto(多伦多大学);Vector Institute(矢量研究所)

Cheng Chen, Christina Giannoula, Andreas Moshovos

AI总结:

针对扩散模型低比特整数量化图像质量差的问题,提出适配扩散模型的低比特浮点量化方法,引入权重舍入学习,8比特浮点量化无明显质量下降,4比特权值+8比特激活配置下降极小,效果优于整数量化。

摘要:

扩散模型是一类通过深度神经网络对随机高斯噪声进行迭代去噪以生成图像的新兴模型。这类模型通常存在计算与内存需求高的问题,因此需要有效的训练后量化方案来实现高性能推理。近期研究提出了针对扩散模型的低比特(如8比特或4比特)量化方法,但4比特整数量化通常会导致生成图像质量低下。我们观察到,在多款广泛使用的硬件平台上,相同比特宽度(如8比特或4比特)的浮点运算与整数运算的计算能力几乎没有差异,甚至完全没有差异。因此,我们提出了一种适用于扩散模型的有效浮点量化方法,相比整数量化方法能提供更优的图像质量。我们采用了一种已在计算机视觉、自然语言处理等其他任务中被验证有效的浮点量化方法,并通过在量化过程中全精度值映射到量化值的阶段引入权重舍入学习,对其进行适配调整以适用于扩散模型。我们在当前最先进的扩散模型中对整数量化与浮点量化方法开展了全面研究。我们的浮点量化方法不仅生成的图像质量优于整数量化方法,而且当权值和激活值都被量化为8比特浮点值时,与全精度模型(32位浮点)相比没有明显的性能下降;而在4比特权值、8比特激活值的配置下,性能下降也极小。

英文摘要:

Diffusion models are emerging models that generate images by iteratively denoising random Gaussian noise using deep neural networks. These models typically exhibit high computational and memory demands, necessitating effective post-training quantization for high-performance inference. Recent works propose low-bitwidth (e.g., 8-bit or 4-bit) quantization for diffusion models, however 4-bit integer quantization typically results in low-quality images. We observe that on several widely used hardware platforms, there is little or no difference in compute capability between floating-point and integer arithmetic operations of the same bitwidth (e.g., 8-bit or 4-bit). Therefore, we propose an effective floating-point quantization method for diffusion models that provides better image quality compared to integer quantization methods. We employ a floating-point quantization method that was effective for other processing tasks, specifically computer vision and natural language tasks, and tailor it for diffusion models by integrating weight rounding learning during the mapping of the full-precision values to the quantized values in the quantization process. We comprehensively study integer and floating-point quantization methods in state-of-the-art diffusion models. Our floating-point quantization method not only generates higher-quality images than that of integer quantization methods, but also shows no noticeable degradation compared to full-precision models (32-bit floating-point), when both weights and activations are quantized to 8-bit floating-point values, while has minimal degradation with 4-bit weights and 8-bit activations.

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

↑