You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Paper parity (arXiv 2607.02461): target_policy_version 2 (new default) also classifies AdaLN
projections and embedders by the parent-module class (AdaLayerNorm*, *NormZero, AdaNorm;
timestep, text and patch embedders). CogVideoX, HunyuanVideo, SD3 and PixArt norm.linear now
get INT4 RTN with BF16 activations instead of W4A4. New cogvideox and hunyuan_video policies.
New defaults that beat the paper recipe in measurements; recipe(name, paper=True) and
PAPER_FIELDS give the paper method as the baseline:
rotation_rounds="auto": an independent RPBH round in front of the paper round where the
block h < 512. On Z-Image-Turbo W4A4 (10 prompts x 3 seeds) LPIPS against BF16 fell from
0.438 to 0.348, better on 27 of 30 pairs. FLUX (every block >= 1024) keeps one round.
On CogVideoX-2B W4A6 the extra round showed no measurable gain and cost 7% time; set
rotation_rounds=1 there when speed matters.
activation_quantizer="auto": per-token absmax INT8 at 8 activation bits, Lloyd-Max below.
On Z-Image W4A8 absmax (LPIPS 0.331) matches 8-bit Lloyd-Max (0.330) at 3.4-6.6x less
GEMM time on an RTX 4090. recipe("w4a8") uses it.
codebook_version 3: a Newton solver builds 8-bit Lloyd-Max tables in about 0.1 s per width
up to d = 30720 (v2 did not converge for d >= 7680) and matches v2 within 1 float32 ULP.
Opt-in options, stored in the artifact config: adaln_scale="mse", output_gain_correction,
and outlier_channels with orbitquant.outliers.find_outlier_channels. output_gain_correction
stays off: on Z-Image it raised LPIPS at W2A4 (+0.016) and lowered it at no tested width.
The pre-rotation runs as one Triton kernel on CUDA (+40-50 us per call at d = 3840 and 256 tokens) and
one Metal kernel on MPS, and on the fused block runtime and Krea 2.
ExecuTorch Vulkan W4A8 absmax path: ExecuTorchVulkanW4A8Linear and
register_executorch_vulkan_w4a8(); the pre-rotation is exported as a dense block-Hadamard
matmul. Verified on Mesa lavapipe only.
Native suites flux1-dev-native (GenEval) and cogvideox-native (VBench). On a FLUX.1-dev
GenEval subset (96 prompts x 2 seeds) W4A4 scored 0.641 against 0.615 for BF16.
Compatibility: no public name was removed and no CLI option changed. Artifacts written by
earlier versions load unchanged (missing fields read as target_policy_version 1, one
rotation round, Lloyd-Max activations; codebook_version is stored per artifact). Quantizing
with default arguments now gives different weights; recipe(name, paper=True) restores one
rotation round and Lloyd-Max activations. Artifacts written by 0.16.0 do not load in 0.15.0.