SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.16005 · NeurIPS · 2024

PTQ4DiT: Post-training Quantization for Diffusion Transformers

Mubarak Shah, Yan Yan, Yuzhang Shang, Junyi Wu, Haoxuan Wang

arXiv · PDF · Open in the Atlas

Code that ran

9 of 21 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (6 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 2 failures of our instrument; 12 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, measured 2026-11-21; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2405.16005.json · badge: /api/ran/2405.16005.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
adreamwu/ptq4dit canonical (classifier label)
classifier basis: classifier_2025
7 ran · 12 no recorded run
copy not recorded community
not in the paper's declared repositories
2 ran · 0 no recorded run
FunctionStatusWhere it lives
round_ste Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from modeltc/mqbench
pointer only · get_code("675da8641c602b03")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

Attention Ran
ran on a synthesized input · constructed an object; no result was computed
adreamwu/ptq4dit/quant/layer_recon.py
pointer only (licence: NONE) · get_code("623291d109e82c34")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adreamwu/ptq4dit when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

DataSaverHook Ran
ran on a synthesized input · constructed an object; no result was computed
adreamwu/ptq4dit/quant/layer_recon.py
pointer only (licence: NONE) · get_code("1d9158f89f879a34")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adreamwu/ptq4dit when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

LinearTempDecay Ran
ran on a synthesized input · constructed an object; no result was computed
adreamwu/ptq4dit/quant/layer_recon.py
pointer only (licence: NONE) · get_code("4c33b681b95218bb")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adreamwu/ptq4dit when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

Mlp Ran
ran on a synthesized input · constructed an object; no result was computed
adreamwu/ptq4dit/quant/layer_recon.py
pointer only (licence: NONE) · get_code("2cfea2de6e135773")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adreamwu/ptq4dit when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

StopForwardException Ran
ran on a synthesized input · constructed an object; no result was computed
adreamwu/ptq4dit/quant/layer_recon.py
pointer only (licence: NONE) · get_code("13900bea8f3b93a1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adreamwu/ptq4dit when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

StraightThrough Ran
ran on a synthesized input
adreamwu/ptq4dit/quant/layer_recon.py
pointer only (licence: NONE) · get_code("382e4d6d6d5d10b0")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adreamwu/ptq4dit when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

UniformAffineQuantizer Ran
ran on a synthesized input · constructed an object; no result was computed
adreamwu/ptq4dit/quant/layer_recon.py
pointer only (licence: NONE) · get_code("f237f023cdb441a9")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adreamwu/ptq4dit when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

lp_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from changyuanwang17/apq-dm
pointer only · get_code("08c6ea7576220a13")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

AdaRoundQuantizer Not yet run
unverified (harvested, no recorded run)
adreamwu/ptq4dit/quant/layer_recon.py
pointer only (licence: NONE) · get_code("e18ddf8148f56942")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adreamwu/ptq4dit when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

BaseQuantBlock Not yet run
unverified (harvested, no recorded run)
adreamwu/ptq4dit/quant/layer_recon.py
pointer only (licence: NONE) · get_code("7eb71652f7925d3a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adreamwu/ptq4dit when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

DiTBlock Not yet run
unverified (harvested, no recorded run)
adreamwu/ptq4dit/quant/layer_recon.py
pointer only (licence: NONE) · get_code("31126f616a1300f1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adreamwu/ptq4dit when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

GetLayerInpOut Not yet run
unverified (harvested, no recorded run)
adreamwu/ptq4dit/quant/layer_recon.py
pointer only (licence: NONE) · get_code("985822f943599470")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adreamwu/ptq4dit when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

LossFunction Not yet run
unverified (harvested, no recorded run)
adreamwu/ptq4dit/quant/layer_recon.py
pointer only (licence: NONE) · get_code("cc1d937a9352676a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adreamwu/ptq4dit when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

QuantDiTBlock Not yet run
unverified (harvested, no recorded run)
adreamwu/ptq4dit/quant/layer_recon.py
pointer only (licence: NONE) · get_code("dacb0f6316a59775")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adreamwu/ptq4dit when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

QuantFinalLayer Not yet run
unverified (harvested, no recorded run)
adreamwu/ptq4dit/quant/layer_recon.py
pointer only (licence: NONE) · get_code("7c760bf5741cff4d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adreamwu/ptq4dit when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

QuantModel Not yet run
unverified (harvested, no recorded run)
adreamwu/ptq4dit/quant/layer_recon.py
pointer only (licence: NONE) · get_code("7e5d23a4a2b80dbd")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adreamwu/ptq4dit when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

QuantModule Not yet run
unverified (harvested, no recorded run)
adreamwu/ptq4dit/quant/layer_recon.py
pointer only (licence: NONE) · get_code("384bed9ea057ffc6")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adreamwu/ptq4dit when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

get_specials Not yet run
unverified (harvested, no recorded run)
adreamwu/ptq4dit/quant/layer_recon.py
pointer only (licence: NONE) · get_code("190cc4466b584805")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adreamwu/ptq4dit when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

layer_reconstruction Not yet run
unverified (harvested, no recorded run)
adreamwu/ptq4dit/quant/layer_recon.py
pointer only (licence: NONE) · get_code("422a5c8d1d390767")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adreamwu/ptq4dit when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

save_inp_oup_data Not yet run
unverified (harvested, no recorded run)
adreamwu/ptq4dit/quant/layer_recon.py
pointer only (licence: NONE) · get_code("5d18164308d717eb")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adreamwu/ptq4dit when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 21 samples lifted from this paper's linked repositories, 21 carry a function identity and 0 do not. Of the 21 distinct functions with an identity, 7 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 1 the same month, 6 later) and 14 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
round_ste
brick of this paper's assembly: update_rule
27 other papers
14 dated earlier, 1 the same month, 12 later · 13 only as an assembly brick
2203.05740 (2022-03)
QDrop: Randomly Dropping Quantization for Extremely Low-bit Post-Training Quantization
2204.12322 (2022-04)
RAPQ: Rescuing Accuracy for Power-of-Two Low-bit Post-training Quantization
and 24 more not named here
lp_loss
brick of this paper's assembly: metric
18 other papers
11 dated earlier, 7 later · 7 only as an assembly brick
Li_RepQ-ViT_Scale_Reparameterization_for_Post-Training_Quantization_of_Vision_Transformers_ICCV_2023_paper (2023 (year only))
RepQ-ViT: Scale Reparameterization for Post-Training Quantization of Vision Transformers
2302.04304 (2023-02)
Q-Diffusion: Quantizing Diffusion Models
and 15 more not named here
StraightThrough
brick of this paper's assembly: helper
4 other papers
3 dated earlier, 1 later · 3 only as an assembly brick
2302.04304 (2023-02)
Q-Diffusion: Quantizing Diffusion Models
2307.10554 (2023-07)
EMQ: Evolving Training-free Proxies for Automated Mixed Precision Quantization
2310.03270 (2023-10)
EfficientDM: Efficient Quantization-Aware Fine-Tuning of Low-Bit Diffusion Models
and 1 more not named here
BaseQuantBlock
brick of this paper's assembly: helper
3 other papers
2 dated earlier, 1 later
2302.04304 (2023-02)
Q-Diffusion: Quantizing Diffusion Models
2307.10554 (2023-07)
EMQ: Evolving Training-free Proxies for Automated Mixed Precision Quantization
2506.22463 (2025-06)
Modulated Diffusion: Accelerating Generative Modeling with Modulated Quantization
LinearTempDecay
brick of this paper's assembly: helper
2 other papers
2 later · 2 only as an assembly brick
2504.02508 (2025-04)
APHQ-ViT: Post-Training Quantization with Average Perturbation Hessian Based Reconstruction for Vision Transformers
2510.10467 (2025-10)
AnyBCQ: Hardware Efficient Flexible Binary-Coded Quantization for Multi-Precision LLMs
StopForwardException
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 later · 2 only as an assembly brick
2203.05740 (2022-03)
QDrop: Randomly Dropping Quantization for Extremely Low-bit Post-Training Quantization
2510.10467 (2025-10)
AnyBCQ: Hardware Efficient Flexible Binary-Coded Quantization for Multi-Precision LLMs
DataSaverHook
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2203.05740 (2022-03)
QDrop: Randomly Dropping Quantization for Extremely Low-bit Post-Training Quantization

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-21.

Repositories linked to this paper

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

Abstract

The recent introduction of Diffusion Transformers (DiTs) has demonstrated exceptional capabilities in image generation by using a different backbone architecture, departing from traditional U-Nets and embracing the scalable nature of transformers. Despite their advanced capabilities, the wide deployment of DiTs, particularly for real-time applications, is currently hampered by considerable computational demands at the inference stage. Post-training Quantization (PTQ) has emerged as a fast and data-efficient solution that can significantly reduce computation and memory footprint by using low-bit weights and activations. However, its applicability to DiTs has not yet been explored and faces non-trivial difficulties due to the unique design of DiTs. In this paper, we propose PTQ4DiT, a specifically designed PTQ method for DiTs. We discover two primary quantization challenges inherent in DiTs, notably the presence of salient channels with extreme magnitudes and the temporal variability in distributions of salient activation over multiple timesteps. To tackle these challenges, we propose Channel-wise Salience Balancing (CSB) and Spearman's ρ-guided Salience Calibration (SSC). CSB leverages the complementarity property of channel magnitudes to redistribute the extremes, alleviating quantization errors for both activations and weights. SSC extends this approach by dynamically adjusting the balanced salience to capture the temporal variations in activation. Additionally, to eliminate extra computational costs caused by PTQ4DiT during inference, we design an offline re-parameterization strategy for DiTs. Experiments demonstrate that our PTQ4DiT successfully quantizes DiTs to 8-bit precision (W8A8) while preserving comparable generation ability and further enables effective quantization to 4-bit weight precision (W4A8) for the first time.

For agents

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

get_harvested_code_for_paper("2405.16005")
get_code_for_paper("2405.16005")
have("2405.16005")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2405.16005.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2405.16005.svg)](https://syntology.ai/paper/2405.16005)

Connect an agent — have() is free.