Skip to content

feat: cache_dit warm-up steps flag and per-request low-noise guidance - #58

Open
Johan-de-R wants to merge 1 commit into
deep-main-v1.1.1-videogenfrom
johan/wan22-warmup-steps-guidance
Open

Johan-de-R wants to merge 1 commit into
deep-main-v1.1.1-videogenfrom
johan/wan22-warmup-steps-guidance

Conversation

@Johan-de-R

Copy link
Copy Markdown

What

  • --cache-dit-max-warmup-steps (env DYN_TRTLLM_CACHE_DIT_MAX_WARMUP_STEPS): passed to CacheDiTConfig(max_warmup_steps=…), the leading steps cache_dit always computes before it starts reusing. On Wan 2.2 A14B this is the high-noise expert's warm-up (the low-noise expert keeps VisualGen's own). Unset keeps VisualGen's default (4).
  • Per-request guidance_scale_2: the video handler now reads it from the request's nvext (the frontend already carries the field) and falls back to --default-guidance-scale-2 as before. guidance_scale already worked this way.

Why

Under Wan's official A14B settings (40 steps, shift 12) the high-noise expert gets 26 of 40 steps, and with the default warm-up of 4 cache_dit reuses the steps that decide layout. In review that produced an extra milk jug, extra hands and impossible legs. LPIPS against the uncached render, 1xB200, 720p/81 frames:

High-noise steps computed up front s/clip LPIPS vs uncached
4 (default) 163 0.33
6 183 0.22 (moving cars lost)
8 193 0.17
10 213 0.16
uncached 412 0

8 is the chosen setting; reviewed by eye. It holds at 27 steps too (160 s/clip, 0.15 vs uncached 27 steps). One server alternating 27/40/50-step requests ran each at its steady-state time, so the step count does not trigger recompiles.

Per-request dual guidance lets deepapi expose both guidance values (e.g. Artificial Analysis sends 3.5 / 4).

Tests

TestCacheDitOverrides covers the new override; test_request_guidance_overrides_config_defaults covers the handler. 74/74 pass in the …-swenc-ea1a31ba image, including the async handler tests, which need pytest-asyncio (the image doesn't ship it, so these tests didn't run before). Mutation-checked: removing the override line, or restoring the config-only guidance_scale_2, each fails exactly its test.

Not enabled by this PR; the Wan config gets --cache-dit-max-warmup-steps=8 with the rollout.

🤖 Generated with Claude Code

--cache-dit-max-warmup-steps sets how many leading steps cache_dit always
computes before reusing (on Wan 2.2 A14B, the high-noise expert's). Under
Wan's official 40-step/shift-12 schedule the default 4 lets the cache reuse
layout-deciding steps (extra objects, broken limbs in review); 8 restores
uncached-level fidelity at 193 s/clip on 1xB200.

The video handler now takes guidance_scale_2 from the request's nvext, which
the frontend already carries, falling back to the config default as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch had an error being deployed

1 failed deployment
external_collaborator — 6ee45300 Deployed Oct 23, 2026 by Johan-de-R via ok-to-test #71
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant