{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/post-training-quantization-with-progressive","title":"Post-training Quantization for Text-to-Image Diffusion Models with Progressive Calibration and Activation Relaxing","arxiv_id":"2311.06322","date":"2023-11-10","proceeding":null,"authors":["Siao Tang","Xin Wang","Hong Chen","Chaoyu Guan","Zewen Wu","Yansong Tang","Wenwu Zhu"],"abstract":"High computational overhead is a troublesome problem for diffusion models. Recent studies have leveraged post-training quantization (PTQ) to compress diffusion models. However, most of them only focus on unconditional models, leaving the quantization of widely-used pretrained text-to-image models, e.g., Stable Diffusion, largely unexplored. In this paper, we propose a novel post-training quantization method PCR (Progressive Calibration and Relaxing) for text-to-image diffusion models, which consists of a progressive calibration strategy that considers the accumulated quantization error across timesteps, and an activation relaxing strategy that improves the performance with negligible cost. Additionally, we demonstrate the previous metrics for text-to-image diffusion model quantization are not accurate due to the distribution gap. To tackle the problem, we propose a novel QDiffBench benchmark, which utilizes data in the same domain for more accurate evaluation. Besides, QDiffBench also considers the generalization performance of the quantized model outside the calibration dataset. Extensive experiments on Stable Diffusion and Stable Diffusion XL demonstrate the superiority of our method and benchmark. Moreover, we are the first to achieve quantization for Stable Diffusion XL while maintaining the performance.","url_abs":"https://arxiv.org/abs/2311.06322v3","url_pdf":"https://arxiv.org/pdf/2311.06322v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"post-training-quantization-with-progressive","repo_url":"https://github.com/tsa18/PCR","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"quantization","task_name":"Quantization"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"focus","method_name":"Focus"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2311.06322","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2311.06322"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tsa18/PCR","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":1,"ran":7,"ran_fixture":2},"by_repo_kind":{"official":{"samples":10,"ran":10,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":10,"samples":[{"code_sha256_prefix":"675da8641c602b03","entry":"round_ste","repo":"tsa18/PCR","repo_kind":"official","path":"quantization_tools/quantization/loss.py","file_url":"https://github.com/tsa18/PCR/blob/HEAD/quantization_tools/quantization/loss.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":2,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"675da8641c602b03"}},{"code_sha256_prefix":"c8e5af5cd9debe67","entry":"calculate_activation_statistics","repo":"tsa18/PCR","repo_kind":"official","path":"quantization_tools/utils/evaluation.py","file_url":"https://github.com/tsa18/PCR/blob/HEAD/quantization_tools/utils/evaluation.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c8e5af5cd9debe67"}},{"code_sha256_prefix":"25ef415d07e43e6f","entry":"calculate_frechet_distance","repo":"tsa18/PCR","repo_kind":"official","path":"quantization_tools/utils/evaluation.py","file_url":"https://github.com/tsa18/PCR/blob/HEAD/quantization_tools/utils/evaluation.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"25ef415d07e43e6f"}},{"code_sha256_prefix":"819214853c3d34c7","entry":"find_layers","repo":"tsa18/PCR","repo_kind":"official","path":"quantization_tools/quantization/quantizer_utils.py","file_url":"https://github.com/tsa18/PCR/blob/HEAD/quantization_tools/quantization/quantizer_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"819214853c3d34c7"}},{"code_sha256_prefix":"0e50593a32adae82","entry":"generate_track_grad_hook","repo":"tsa18/PCR","repo_kind":"official","path":"quantization_tools/quantization/quantizer.py","file_url":"https://github.com/tsa18/PCR/blob/HEAD/quantization_tools/quantization/quantizer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0e50593a32adae82"}},{"code_sha256_prefix":"94f67aa80e10cd14","entry":"generate_track_input_hook","repo":"tsa18/PCR","repo_kind":"official","path":"quantization_tools/quantization/quantizer.py","file_url":"https://github.com/tsa18/PCR/blob/HEAD/quantization_tools/quantization/quantizer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"94f67aa80e10cd14"}},{"code_sha256_prefix":"1d1ba12cf2735f02","entry":"generate_track_input_output_hook","repo":"tsa18/PCR","repo_kind":"official","path":"quantization_tools/quantization/quantizer.py","file_url":"https://github.com/tsa18/PCR/blob/HEAD/quantization_tools/quantization/quantizer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1d1ba12cf2735f02"}},{"code_sha256_prefix":"be8e0dc7aa00a307","entry":"get_activations","repo":"tsa18/PCR","repo_kind":"official","path":"quantization_tools/utils/evaluation.py","file_url":"https://github.com/tsa18/PCR/blob/HEAD/quantization_tools/utils/evaluation.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"be8e0dc7aa00a307"}},{"code_sha256_prefix":"08c6ea7576220a13","entry":"lp_loss","repo":"tsa18/PCR","repo_kind":"official","path":"quantization_tools/quantization/loss.py","file_url":"https://github.com/tsa18/PCR/blob/HEAD/quantization_tools/quantization/loss.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"08c6ea7576220a13"}},{"code_sha256_prefix":"e47f2726d3fd53e2","entry":"process_to_name","repo":"tsa18/PCR","repo_kind":"official","path":"inference_sd.py","file_url":"https://github.com/tsa18/PCR/blob/HEAD/inference_sd.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e47f2726d3fd53e2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}