ltx23 SPEED: 25s→10.9s — distilled-preset path fix, exact from_file recipe, dreamverse-based image, LTX23_PROFILE pinning#12
Conversation
…o the image
Shipping the validated ~10s SPEED recipe to prod needs the recipe to travel
with the image, not a fragile redis deploy-config flag. Two defaults that the
SPEED path needs were not coupled to the profile:
- attention backend: hardcoded FLASH_ATTN in worker.py + warmup.py. We
validated SPEED end-to-end on TORCH_SDPA (~10s, quality OK'd); FastVideo's
streaming_demo SPEED path uses FLASH_ATTN (~4.5s) but we have NOT validated
SPEED+FLASH_ATTN, so ship what we tested.
- --enable-optimizations: store_true / default off, so NVFP4 only applied if
a launch arg was passed (redis).
Couple both to LTX23_PROFILE via config.py helpers (profile_attention_backend,
profile_default_optimizations), used by BOTH the warmup bake and the serving
worker so the compile cache always matches. Now a SPEED ship image only needs
`ENV LTX23_PROFILE=speed` baked in -> NVFP4 + TORCH_SDPA + speed kwargs, no
deploy-config flags. QUALITY is unchanged (FLASH_ATTN + bf16, what prod runs).
Both still overridable via --attention-backend / --[no-]enable-optimizations.
factory.load_model still hardware-gates NVFP4 to Blackwell, so non-Blackwell
hosts safely fall back to bf16 regardless of profile.
RUNBOOK: document the SPEED bake (LTX23_PROFILE=speed pins recipe+attention).
ltx23/test_config.py: 5 passed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A ship image needs the per-shape *.megacache.bin blobs, not just the inductor
/cache -- without them a fresh pod cold-compiles the torch.compile front-end
(~33 min/shape SPEED) on every boot instead of the ~12 min Mega-Cache boot-warm.
The trigger is LTX_MEGACACHE_DIR being set during warmup, and it's easy to forget
(I did). Two safeguards so the next person can't:
- warmup.py: print a loud WARNING at driver start if LTX_MEGACACHE_DIR is unset.
- RUNBOOK: the SPEED bake now sets LTX_MEGACACHE_DIR=/cache/megacache at warmup
(under /cache so the existing cache.tar captures the blobs -- no separate
megacache.tar) and bakes `ENV LTX_MEGACACHE_DIR` into the image so the serving
side doesn't need a redis extra_env flag either. Cross-refs ltx23/CACHING.md.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…amverse-based image Root cause of the 10s-vs-25s serving gap: FastVideo picks the pipeline preset by string-matching the weights path (registry.py). /data/default misses the detector -> BASE preset -> extra guidance forwards per denoise step (~2.4x). Fix: detector-matching alias path + yaml. Also: speed profile now builds via VideoGenerator.from_file(streaming_speed.yaml) (the exact validated recipe, no re-derivation), and Dockerfile.dreamverse builds the serving image FROM the dreamverse env (prerelease FP4 kernel stack) with ai-dynamo layered on top. Validated: dynamo pool + prod weights = 10.9s/clip warm (was 25s). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Root cause of the 10s-vs-25s serving gap found and fixed (validated end-to-end tonight): FastVideo selects its pipeline preset by string-matching the weights path ( Fix in this branch: Validation: dynamo pool + production weights = 10.9s/clip warm (musician), 11.0s (dog); warm refine 5.29s; preset proof in logs ( Remaining before merge: Mega-Cache bake + fresh-boot validation + quality sign-off (clips with Johan). 🤖 Generated with Claude Code |
…v bake helper The preset comes from FastVideo path-string detection; a mount/rename that misses the detector must be a boot error, not a silent 2.4x regression. bake_i2v.py extends the Mega-Cache blob with i2v graphs (t2v-only bake gap). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…oot-cause attribution Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… a warm-latency gate The bake now FAILS if a warm generation exceeds LTX23_MAX_WARM_S (default 14s), so any future silent slowdown (preset drift, package/env change) goes red at bake time instead of reaching prod. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Final validation PASSED — ship image All technical gates on the checklist are green: t2v+i2v Mega-Cache blob baked, fresh-boot validated, boot assertion + bake latency gate exercised end-to-end in the shipped artifacts. Remaining: quality sign-off (clips with Johan) → merge → registry push + model repoint (separate cutover step, rollback = 🤖 Generated with Claude Code |
|
Quality sign-off: Johan approved the fixed-path clips (musician + dog, distilled preset, 10.7-10.8s renders). All merge gates are now green. 🤖 Generated with Claude Code |
What
Ships the LTX-2.3 SPEED profile (~10.9s/clip warm, 1920×1088@121f, NVFP4 + TORCH_SDPA + 5+2 steps) through the dynamo serving path. Four pieces:
fastvideo/registry.py: needsltx-2/ltx2ANDdistilled). Our serving mounts weights at/data/default→ detector misses → silent fallback to the base preset → extra guidance forward passes per denoising step (mod=3.0/rescale/STG) → ~2.4× slower with visually fine output. Fix:/models/ltx-2.3-distilled-diffusers → /data/defaultsymlink in the image; the speed yaml references the alias.factory.pyhard-fails the worker at boot if the distilled preset doesn't resolve, so any future mount change is an error, not a silent regression.VideoGenerator.from_file(ltx23/streaming_speed.yaml)— the literal validated recipe. The previous factory re-derived compile/quant/inductor settings by hand, which is where deviations kept creeping in.Dockerfile.dreamverse: serving image builds FROM FastVideo's own validated dreamverse env (their prerelease FP4 kernel stack; our from-scratch build silently resolved older stable packages because uv'sprerelease=allowonly applies from the FastVideo CWD). ai-dynamo layered on top with kernel/torch versions constraint-frozen. Environment fidelity, not a measured package speedup — the measured cause was the preset.LTX23_PROFILEpins the full recipe into the image (earlier commits): profile → attention backend + NVFP4 + compile mode, Mega-Cache guard, RUNBOOK.Validation (di-slc-47, B200, prod weights, prod mount topology)
mod_video=3.0(base)mod_video=1.0(distilled)Bisect chain proving the root cause (each single-variable): golden context reproduces 10.7s deterministically; only-weights-path-swap flips 10.7↔25.1s; full-content-via-anonymous-path still slow; sha256 audit shows weight files bit-identical; registry resolves
ltx2_basefor/data/defaultandltx2_distilledfor the alias.Remaining before merge
Rollback: current prod quality image
2.1.5-ltx23-mc-i2v3(untouched by this PR).🤖 Generated with Claude Code