Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
8fead6f
Key image-gen LoRA rows by index so typing a repo id keeps input focus
danielhanchen Jul 8, 2026
55a81fa
Disable NVFP4 in the Blackwell auto ladder (explicit opt-in only)
danielhanchen Jul 8, 2026
40b285a
Auto-select text-encoder quantization by GPU and family (default on)
danielhanchen Jul 8, 2026
e7168ef
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 8, 2026
ca8f415
Auto-quantize the VAE (image/video decoder) to fp8 (default on, gated)
danielhanchen Jul 8, 2026
c0a4d38
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 8, 2026
b12a177
Gate VAE fp8 quant by decoded-image accuracy (auto layerwise fp8, fp8…
danielhanchen Jul 8, 2026
a98585d
Add missing AGPL-3.0 SPDX headers to krea2 / lora / controlnet sources
danielhanchen Jul 8, 2026
7bf470f
Size-gate VAE auto-quant: quantize large (video) VAEs only, skip tiny…
danielhanchen Jul 8, 2026
cbf24dd
Fix black frames on Wan video: deny fp8 DiT auto-quant, fall to int8
danielhanchen Jul 8, 2026
5d501f5
Add video speed/memory lever benchmark; extend quant bench with DiT mode
danielhanchen Jul 8, 2026
c947b33
Extend fp8 black-frame deny to HunyuanVideo-1.5; keep LTX-2 on fp8
danielhanchen Jul 8, 2026
ff853c3
Restore fp8 DiT quant for Wan video via a per-family embedder exclude
danielhanchen Jul 8, 2026
42a4c07
Make the video speed/mem bench MoE-aware; add A14B + Hunyuan-720p fam…
danielhanchen Jul 9, 2026
e58f30b
Run video DiT dense+compile when it fits instead of a slower int8 fal…
danielhanchen Jul 9, 2026
a592806
video: skip padded text tokens in HunyuanVideo-1.5 joint attention
danielhanchen Jul 9, 2026
390bfae
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 9, 2026
a4a03fe
tests: move HunyuanVideo trim tests to their own module (keep attenti…
danielhanchen Jul 9, 2026
4fd93b2
diffusion: accept vae_quant in the native sd.cpp backend load interface
danielhanchen Jul 9, 2026
934b3b3
video bench: fp32 VAE load + parameter-keyed reference cache
danielhanchen Jul 9, 2026
5eb64bd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 9, 2026
be04ba0
video/image: honor explicit Speed=off for companions + trim, probe ex…
danielhanchen Jul 9, 2026
65d33c8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 9, 2026
280ffa8
studio: drop duplicate listStoredChatThreads import in app-sidebar
danielhanchen Jul 9, 2026
7a42f6b
Merge remote-tracking branch 'origin/image-generation' into r7021
danielhanchen Jul 9, 2026
c6c614b
test(video routes): accept vae_quant in the fake backend stub
danielhanchen Jul 9, 2026
4ca2488
fix(te-quant): probe the weight-only NVFP4 kernel for explicit TE nvfp4
danielhanchen Jul 9, 2026
5c3c0ab
fix(speed-off): suppress explicit companion auto too; correct bench r…
danielhanchen Jul 9, 2026
d54bfd9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 9, 2026
8218c9b
studio: use largest single GPU for the diffusion catalog fit budget
danielhanchen Jul 10, 2026
726c0b6
fix(review): portable bench scripts, accurate VAE auto docs, explicit…
danielhanchen Jul 10, 2026
b9b1a4b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 10, 2026
a4694d1
fix(bench): mirror production contracts in the quant/video benchmarks
danielhanchen Jul 10, 2026
14eba1c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 10, 2026
6f887af
Probe fp8_dynamic per conv dimensionality and apply bench levers befo…
danielhanchen Jul 10, 2026
d54e2bc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 10, 2026
c998183
feat(video): step caching for HunyuanVideo-1.5 (MagCache auto, FBCach…
danielhanchen Jul 10, 2026
f7824b9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 10, 2026
7dbdd28
perf(video): accuracy-first round 2 for HunyuanVideo-1.5: compile par…
danielhanchen Jul 10, 2026
d879a90
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 10, 2026
d58141b
perf(video): generalize round-2 levers to Wan2.2 and LTX-2: per-famil…
danielhanchen Jul 10, 2026
28545b2
Harden CFG-parallel lifecycle and bench fidelity per review
danielhanchen Jul 10, 2026
61a5c91
Merge branch 'image-generation' into video-diffusion-improvements
danielhanchen Jul 10, 2026
0d378bc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 10, 2026
bd1c2e0
Bench fidelity: explicit MagCache step re-sizing, generation-time cac…
danielhanchen Jul 10, 2026
87054e7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 10, 2026
ce32c1e
Document why the cache fan-out invalidates only the replica registry
danielhanchen Jul 10, 2026
d7a5a01
Gate auto CFG parallel on Speed=off
danielhanchen Jul 10, 2026
b24a94d
Wire the Mega-cache compile prewarm into the video backend
danielhanchen Jul 11, 2026
d26ef75
Refuse the kernels auto-install on a pre-1.0 huggingface_hub
danielhanchen Jul 11, 2026
90ee1c3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 11, 2026
40e3747
Absorb the first-generation compile hitch with a post-load background…
danielhanchen Jul 11, 2026
6adcc34
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 11, 2026
47c202e
Let real generations preempt the background compile prewarm
danielhanchen Jul 11, 2026
35eb80c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 11, 2026
514f4c6
Harden the video speed stack: cache quality pin, device identity, tra…
danielhanchen Jul 11, 2026
a3593ba
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 11, 2026
226363c
Tighten comments across the video speed stack
danielhanchen Jul 12, 2026
e727b9e
Merge branch 'image-generation' into video-diffusion-improvements
danielhanchen Jul 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions scripts/build_prequant_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,17 @@ def main(argv = None) -> int:
args.base, subfolder = "transformer", torch_dtype = torch.bfloat16, token = args.hf_token
).to("cuda")
print(f" quantising in place ({scheme}) ...", flush = True)
# Mirror the runtime path EXACTLY (offline == runtime, LPIPS-0 invariant): for int8 also skip
# the M=1 AdaLN-modulation / conditioning-embedder projections, else the checkpoint bakes them
# as int8 and crashes (torch._int_mm needs M>16) at the first denoise step on Flux / Qwen. fp8
# / fp4 / mx use scaled_mm (no M limit) -> exclude_tokens_for_scheme returns ().
exclude_name_tokens = exclude_tokens_for_scheme(scheme)
# fp8 and mxfp8 assert a bf16 weight, so their filter must skip any non-bf16 Linear the
# transformer keeps: a mixed-precision DiT (Wan / Hunyuan) keeps its _keep_in_fp32_modules in
# fp32 even under torch_dtype=bf16, so quantising one raises inside quantize_ and aborts the
# pass. nvfp4 quantises fp32 fine, so it isn't gated. Runtime quantize_transformer gates on
# scheme membership; mirror it here so the offline checkpoint quantises the same layer set.
# Mirror the runtime path EXACTLY (offline == runtime, LPIPS-0 invariant): int8 skips the
# M=1 modulation / conditioning-embedder projections (else the checkpoint bakes them int8 and
# crashes at the first denoise step); the scaled_mm schemes exclude only a family's
# padded-conditioning embedder. Pass the family so the offline set matches runtime.
exclude_name_tokens = exclude_tokens_for_scheme(scheme, fam.name)
# fp8 / mxfp8 assert a bf16 weight, so skip any non-bf16 Linear the transformer keeps in fp32
# (a mixed-precision DiT's _keep_in_fp32_modules), else quantize_ raises. nvfp4 handles fp32.
# Mirrors the runtime scheme gate so the offline layer set matches.
require_bf16 = scheme in _REQUIRE_BF16_SCHEMES
# fp8 bakes the accumulate mode into the saved kernels; record the resolved choice so the
# loader can refuse a checkpoint whose baked value contradicts an explicit runtime request.
# fp8 bakes the accumulate mode into the kernels; record the resolved choice so the loader
# can refuse a checkpoint whose baked value contradicts an explicit runtime request.
fast_accum = _resolve_fast_accum(None) if scheme == TQ_FP8 else None
quantize_(
transformer,
Expand All @@ -117,10 +115,8 @@ def main(argv = None) -> int:
"family": fam.name,
"scheme": scheme,
"min_features": args.min_features,
# The layers skipped for this scheme (int8's M=1 modulation projections; () for the
# scaled_mm schemes), whether non-bf16 Linears were skipped (the scaled_mm bf16 gate), and,
# for fp8, the baked accumulate mode. All let the loader reject a checkpoint that wouldn't
# match the runtime path.
# Skipped layers, the non-bf16 gate, and (fp8) the baked accumulate mode -- all let the
# loader reject a checkpoint that would not match the runtime path.
"exclude_name_tokens": list(exclude_name_tokens),
"require_bf16": require_bf16,
"fast_accum": fast_accum,
Expand Down
Loading
Loading