Towards Accurate Post-training Quantization for Diffusion Models

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Wang, Changyuan, Wang, Ziwei, Xu, Xiuwei, Tang, Yansong, Zhou, Jie, Lu, Jiwen
Format: Preprint
Published: 2023
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914775695360000
author Wang, Changyuan
Wang, Ziwei
Xu, Xiuwei
Tang, Yansong
Zhou, Jie
Lu, Jiwen
author_facet Wang, Changyuan
Wang, Ziwei
Xu, Xiuwei
Tang, Yansong
Zhou, Jie
Lu, Jiwen
contents In this paper, we propose an accurate data-free post-training quantization framework of diffusion models (ADP-DM) for efficient image generation. Conventional data-free quantization methods learn shared quantization functions for tensor discretization regardless of the generation timesteps, while the activation distribution differs significantly across various timesteps. The calibration images are acquired in random timesteps which fail to provide sufficient information for generalizable quantization function learning. Both issues cause sizable quantization errors with obvious image generation performance degradation. On the contrary, we design group-wise quantization functions for activation discretization in different timesteps and sample the optimal timestep for informative calibration image generation, so that our quantized diffusion model can reduce the discretization errors with negligible computational overhead. Specifically, we partition the timesteps according to the importance weights of quantization functions in different groups, which are optimized by differentiable search algorithms. We also select the optimal timestep for calibration image generation by structural risk minimizing principle in order to enhance the generalization ability in the deployment of quantized diffusion model. Extensive experimental results show that our method outperforms the state-of-the-art post-training quantization of diffusion model by a sizable margin with similar computational cost.
format Preprint
id arxiv_https___arxiv_org_abs_2305_18723
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Towards Accurate Post-training Quantization for Diffusion Models
Wang, Changyuan
Wang, Ziwei
Xu, Xiuwei
Tang, Yansong
Zhou, Jie
Lu, Jiwen
Computer Vision and Pattern Recognition
In this paper, we propose an accurate data-free post-training quantization framework of diffusion models (ADP-DM) for efficient image generation. Conventional data-free quantization methods learn shared quantization functions for tensor discretization regardless of the generation timesteps, while the activation distribution differs significantly across various timesteps. The calibration images are acquired in random timesteps which fail to provide sufficient information for generalizable quantization function learning. Both issues cause sizable quantization errors with obvious image generation performance degradation. On the contrary, we design group-wise quantization functions for activation discretization in different timesteps and sample the optimal timestep for informative calibration image generation, so that our quantized diffusion model can reduce the discretization errors with negligible computational overhead. Specifically, we partition the timesteps according to the importance weights of quantization functions in different groups, which are optimized by differentiable search algorithms. We also select the optimal timestep for calibration image generation by structural risk minimizing principle in order to enhance the generalization ability in the deployment of quantized diffusion model. Extensive experimental results show that our method outperforms the state-of-the-art post-training quantization of diffusion model by a sizable margin with similar computational cost.
title Towards Accurate Post-training Quantization for Diffusion Models
topic Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2305.18723