SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.18723 · 2023

Towards Accurate Post-training Quantization for Diffusion Models

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 5 functions out of this paper's own repositories and ran 5 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
changyuanwang17/apq-dm canonical 3 of 3
copy not recorded — 2 of 2
FunctionStatusWhere it lives
GroupWise_Quantizaion Ran changyuanwang17/apq-dm/utils/quant_util.py
code served (permissive licence) · get_code("ec2dd88094ddb515")
get_beta_schedule Ran this paper's copy was not recorded; identical code first harvested from weizhigao/modiff
pointer only · get_code("ca0cea1ca1eeec89")
lp_loss Ran changyuanwang17/apq-dm/utils/quant_util.py
code served (permissive licence) · get_code("08c6ea7576220a13")
reconstruct_weight_from_k_means_result Ran changyuanwang17/apq-dm/utils/quant_util.py
code served (permissive licence) · get_code("c92ad46f04fdeb81")
torch2hwcuint8 Ran this paper's copy was not recorded; identical code first harvested from weizhigao/modiff
pointer only · get_code("c27a10ca9f6b75f3")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2305.18723")
get_code_for_paper("2305.18723")
have("2305.18723")

Connect an agent — have() is free.