BitsFusion: 1.99 bits Weight Quantization of Diffusion Model

GenAI Diffusion AI Systems and Hardware MCPKD
2024年06月06日
最近几年,基于扩散的图像生成模型取得了巨大的成功,展示了合成高质量内容的能力。然而,这些模型包含大量参数,导致模型尺寸显著增大,保存和传输成为各种应用的瓶颈,尤其是在资源受限设备上运行的应用。在本研究中,我们开发了一种新的权重量化方法,将Stable Diffusion v1.5的UNet量化为1.99位,实现了一个模型,其尺寸比原始模型小7.9倍,同时展示了比原始模型更好的生成质量。我们的方法包括几种新颖的技术,如为每个层分配最优位数、初始化量化模型以获得更好的性能,以及改进训练策略以显著减少量化误差。此外,我们在各种基准数据集上广泛评估了我们的量化模型,并通过人类评估证明了其卓越的生成质量。
Diffusion-based image generation models have achieved great success in recent years by showing the capability of synthesizing high-quality content. However, these models contain a huge number of parameters, resulting in a significantly large model size. Saving and transferring them is a major bottleneck for various applications, especially those running on resource-constrained devices. In this work, we develop a novel weight quantization method that quantizes the UNet from Stable Diffusion v1.5 to 1.99 bits, achieving a model with 7.9X smaller size while exhibiting even better generation quality than the original one. Our approach includes several novel techniques, such as assigning optimal bits to each layer, initializing the quantized model for better performance, and improving the training strategy to dramatically reduce quantization error. Furthermore, we extensively evaluate our quantized model across various benchmark datasets and through human evaluation to demonstrate its superior generation quality.
许愿