From 9b1a4f86b1b2316e93710be1cc7220cf7f76dcb1 Mon Sep 17 00:00:00 2001 From: Johan de Ruiter Date: Thu, 9 Jul 2026 01:00:09 +0000 Subject: [PATCH] ltx23: compile the VAE in the SPEED profile (vae_enabled: true) Adds vae_enabled: true to streaming_speed.yaml's compile block. The SPEED profile already compiles the DiT and text encoder but left the VAE decode running eager -- the single largest warm stage (~2.6s). Measured A/B on the FA4 image (2026-07-09, di-slc-140 B200, single 1920x1088 shape, only variable = this flag): warm end-to-end gen 7.16s -> 5.02s (~2.1s, ~30%). Boots cleanly with NVFP4 + max-autotune + FA4, no OOM; cold-compile +~3min (absorbed by the Mega-Cache). torch.compile is numerically ~identical, so output is quality-neutral (seed-locked sample pairs visually indistinguishable). This aligns SPEED with FastVideo's own batch recipe (video_generation.py sets vae_enabled=ENABLE_TORCH_COMPILE, default on); streaming_demo.yaml -- which this file mirrors -- omitted it for the streaming/segment path, which we don't use. Requires a re-bake: the Mega-Cache save_cache_artifacts() call after the first forward now snapshots the VAE inductor/triton graphs into the per-shape blobs. New image tag 2.1.5-ltx23-fa4vae-d333ce5e (recipe change; shape hash unchanged). Co-Authored-By: Claude Opus 4.8 (1M context) --- examples/diffusers/ltx23/streaming_speed.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/diffusers/ltx23/streaming_speed.yaml b/examples/diffusers/ltx23/streaming_speed.yaml index 83257254338b..425d31f35d14 100644 --- a/examples/diffusers/ltx23/streaming_speed.yaml +++ b/examples/diffusers/ltx23/streaming_speed.yaml @@ -50,12 +50,20 @@ generator: pin_cpu_memory: true # internal: gpu_pool.py:251-258 + the just-uncommented "mode" line - # — torch.compile on for transformer + text encoder, inductor + # — torch.compile on for transformer + text encoder + VAE, inductor # backend, fullgraph for graph-break debugging, max-autotune- # no-cudagraphs for the kernel sweep, dynamic off (static shapes). + # vae_enabled matches FastVideo's batch path (video_generation.py sets + # vae_enabled=ENABLE_TORCH_COMPILE, default on); measured A/B on the FA4 + # image (2026-07-09, di-slc-140 B200) cut warm gen 7.16s -> 5.02s (~2.1s, + # ~30%) by compiling the VAE decode. Quality-neutral (torch.compile is + # numerically ~identical). Requires a re-bake so the Mega-Cache captures + # the VAE graphs (save_cache_artifacts snapshots them after the first + # forward); a stale blob just cold-compiles the VAE, never wedges. compile: enabled: true text_encoder_enabled: true + vae_enabled: true backend: inductor fullgraph: true mode: max-autotune-no-cudagraphs