Diffusion models have gained popularity for generating images from textual descriptions. Nonetheless, the substantial need for computational resources continues to present a noteworthy challenge, contributing to time-consuming processes. Quantization, a technique employed to compress deep learning models for enhanced efficiency, presents challenges when applied to diffusion models. These models are notably more sensitive to quantization compared to other model types, potentially resulting in a degradation of image quality. In this paper, we introduce a novel approach to quantize the diffusion models by leveraging both quantization-aware training and distillation. Our results show the quantized models can maintain the high image quality while demonstrating the inference efficiency on CPUs. The code is publicly available at: https://github.com/intel/intel-extension-for-transformers.
翻译:扩散模型已广泛用于根据文本描述生成图像。然而,其巨大的计算资源需求仍构成显著挑战,导致处理过程耗时。量化作为一种提升深度模型效率的压缩技术,在应用于扩散模型时面临特殊困难——这类模型对量化的敏感度远高于其他模型类型,可能导致图像质量下降。本文提出一种创新的扩散模型量化方法,通过联合运用量化感知训练与蒸馏技术。实验结果表明,量化模型在保持高图像质量的同时,在CPU上展现出高效的推理性能。相关代码已开源:https://github.com/intel/intel-extension-for-transformers。