From 41055307d47ed94d12a1d7b70ee9ebef42cfc698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Leszko?= Date: Mon, 15 Jun 2026 14:15:59 +0000 Subject: [PATCH] feat(trt): register 30s decoder profile for the loop-focused workflow Acts on the latent-size experiment finding (loop window of 20-30s is viable). Adds a 30.0 TRT engine profile so the loop-focused / short- source path runs on a decoder opt-tuned for a 750-frame (30s) window instead of borrowing the 60s engine. - The walk-window path (acestep/streaming/session.py) already resolves decoder + vae_decode at walk_window_s; with this profile, walk_window_s=30 now picks a real 30s decoder. Sources <=30s also pick it directly. - Decoder-only profile: it reuses the existing 60s VAE engines. The walk path keeps vae_encode at full-song size, and the 60s vae_decode accepts <=1500-frame inputs, so 750-frame decodes need no dedicated engine. A sub-60s VAE engine is also not buildable today (TRT optimization-profile failure on Blackwell, see docs/TRT.md). - Build: python -m acestep.engine.trt.build --all --decoder-only --duration 30 Engine binaries live under ~/.daydream-scope (not in the repo), same as the 60s/120s/240s engines. Validated on a 5090: 30s decoder loads via TRT, generates a 750-frame latent, decodes OK, LoRA refit works. vs the same 750-frame window on the 60s engine: ~12% faster warm generate (0.121s vs 0.137s), ~0.25 GB less process VRAM. resolve(): <=30s -> 30s engine, 31-60s -> 60s (unchanged). Quality at a 30s loop window is the ear test this unblocks (set walk_window=true, walk_window_s=30 in web/public/config.json). Co-Authored-By: Claude Opus 4.8 (1M context) --- acestep/paths.py | 13 +++++++++++++ docs/TRT.md | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/acestep/paths.py b/acestep/paths.py index 618bdca8..35c08d71 100644 --- a/acestep/paths.py +++ b/acestep/paths.py @@ -312,6 +312,19 @@ def trt_engine_path(engine_name: str) -> Path: # scripts/benchmarks/vram_60s_vs_240s_results.md. Pick the smallest profile # that fits the audio (see `select_trt_engines` and `available_trt_engines`). _TRT_ENGINE_PROFILES: dict[float, dict[str, str]] = { + # 30s decoder for the loop-focused / short-source workflow: a smaller + # seq_max (750 frames vs 1500) reserves less DiT activation workspace + # (VRAM headroom) and is opt-tuned at 750 for lower param-update + # latency. The VAE engines are intentionally the 60s builds — the + # walk-window path keeps vae_encode sized to the full song, and the + # 60s vae_decode already accepts ≤1500 frames, so 750-frame decodes + # need no dedicated engine. Build with + # ``python -m acestep.engine.trt.build --all --duration 30 --decoder-only``. + 30.0: { + "decoder": "spectral_decoder_mixed_refit_b8_30s", + "vae_encode": "vae_encode_fp16_60s", + "vae_decode": "vae_decode_fp16_60s", + }, 60.0: { "decoder": "spectral_decoder_mixed_refit_b8_60s", "vae_encode": "vae_encode_fp16_60s", diff --git a/docs/TRT.md b/docs/TRT.md index 522c8a08..eb4cfa0e 100644 --- a/docs/TRT.md +++ b/docs/TRT.md @@ -176,6 +176,25 @@ Build only decoder engines: uv run python -m acestep.engine.trt.build --all --decoder-only --duration 60 ``` +Build the 30s loop-window decoder (decoder-only): + +```powershell +uv run python -m acestep.engine.trt.build --all --decoder-only --duration 30 +``` + +The `30.0` profile in `acestep/paths.py` serves the loop-focused / +short-source workflow (`walk_window_s = 30`, or any source ≤ 30s). Its +`seq_max` is 750 frames (vs 1500 for 60s), so the DiT context reserves +less activation workspace and is opt-tuned at 750 for lower +param-update latency. It is **decoder-only**: the profile reuses the +existing 60s VAE engines, because the walk-window path keeps +`vae_encode` sized to the full song and the 60s `vae_decode` already +accepts ≤ 1500-frame inputs. (A dedicated sub-60s VAE engine is not +needed and currently fails the TRT optimization-profile check on +Blackwell — see `RTX 5090 / Blackwell VAE Builds` above.) Measured on a +5090 vs running the same 750-frame window on the 60s engine: ~12% faster +warm generate (0.121s vs 0.137s) and ~0.25 GB less process VRAM. + Build only VAE engines: ```powershell