Repository navigation
[BugFix] Fix Wan2.2-VACE-Fun cache and serving lifecycle - #4667
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Follow-up from review/testing addressed through
Why this replacement is safe from the local validation: Validation after cleanup: pytest tests/diffusion/cache/test_cache_dit.py tests/diffusion/models/wan2_2/test_wan22_vace_pipeline.py tests/diffusion/offloader/test_layerwise_backend.py tests/entrypoints/openai_api/test_video_server.py::test_server_worker_keeps_engine_alive_until_http_shutdown -q
# 27 passed
pre-commit run --files docs/models/supported_models.md examples/offline_inference/vace/vace_video_generation.md recipes/Pyros13/Wan2.2-VACE-Fun-A14B-Diffusers.md tests/diffusion/cache/test_cache_dit.py tests/diffusion/models/wan2_2/test_wan22_vace_pipeline.py tests/entrypoints/openai_api/test_video_server.py vllm_omni/diffusion/cache/cache_dit_backend.py vllm_omni/diffusion/models/wan2_2/pipeline_wan2_2_vace.py vllm_omni/diffusion/models/wan2_2/wan2_2_vace_transformer.py vllm_omni/entrypoints/openai/api_server.py
# passed
Pyros13 2-step smoke after removing original loader:
# BASELINE: 28.2s total, 14.1s/step |
f9eff96 to
da8cb89
Compare
hsliuustc0106
left a comment
There was a problem hiding this comment.
Wan2.2-VACE-Fun bugfix looks correct. All gate checks pass, regression tests cover Cache-DiT, TaylorSeer calibrator, dual-transformer switching, layerwise offload, and server lifecycle issues documented in PR description.
convert_original_to_diffusers_key rewrites original key names (self_attn->attn1, q->to_q, ffn.0->ffn.net.0, modulation->scale_shift_table, VACE before_proj/after_proj) into diffusers form at the top of WanTransformer3DModel.load_weights, so the existing QKV-fusion/remapping handles them. No-op on already-diffusers keys. Signed-off-by: Ianniu <985683179yzy@gmail.com>
The original release has no top-level config.json/model_index.json; its DiT config lives in high_noise_model/config.json (model_type=vace). Add a shared _looks_like_wan2_2_vace_original detector (hf_utils) and route it through both gates: resolve_model_config_path returns None (same default diffusion path as diffusers VACE), enrich_config sets WanVACEPipeline. Signed-off-by: Ianniu <985683179yzy@gmail.com>
…eline For the original two-expert layout (high_noise_model/low_noise_model + .pth text-encoder/VAE), build via _init_original_format (S2V-style): both experts as transformer/transformer_2, the umt5-xxl tokenizer, and the .pth T5/VAE. convert_original_vace_config translates the VaceWanModel config field names to diffusers keys. Signed-off-by: Ianniu <985683179yzy@gmail.com>
Wan22VACEPipeline.diffuse() was written for single-transformer Wan2.1 and never selected an expert, so every step ran the high-noise transformer and the loaded low-noise transformer_2 was unused. Compute boundary_timestep in forward() and pick current_model per step, mirroring the Wan2.2 T2V/I2V pipelines. Signed-off-by: Ianniu <985683179yzy@gmail.com>
Signed-off-by: Ianniu <985683179yzy@gmail.com>
Add the original (non-diffusers) checkpoint to the supported-models table (NVIDIA-validated) and the VACE example's model list. Signed-off-by: Ianniu <985683179yzy@gmail.com>
Signed-off-by: Ianniu <985683179yzy@gmail.com>
Split __init__ into _init_runtime / _load_components / _finalize as a pure, behavior-preserving extraction. Wan22VACEPipeline's original-format path now reuses _init_runtime + _finalize and overrides only the component-loading middle (_load_components_original), removing the super(Wan22Pipeline, self) bypass and the duplicated init tail. T2V / T2V-DMD2 / diffusers-VACE behavior is unchanged. Signed-off-by: Ianniu <985683179yzy@gmail.com>
Narrow the original-checkpoint detector to except (OSError, ValueError);
get_hf_file_to_dict returns None for missing configs, so only a corrupt
config / bad repo-id or a local read error can reach the handler, while
unexpected errors (OOM, ImportError) now propagate.
Signed-off-by: Ianniu <985683179yzy@gmail.com>
Signed-off-by: Ianniu <985683179yzy@gmail.com>
Signed-off-by: david6666666 <530634352@qq.com>
Signed-off-by: david6666666 <530634352@qq.com>
Signed-off-by: david6666666 <530634352@qq.com>
Signed-off-by: david6666666 <530634352@qq.com>
f8f8410 to
5804d89
Compare
…t#4667) Signed-off-by: Ianniu <985683179yzy@gmail.com> Signed-off-by: david6666666 <530634352@qq.com> Co-authored-by: Ianniu <985683179yzy@gmail.com>
Purpose
This PR builds on #4249 after rebasing it onto current
upstream/mainand fixes the Wan2.2-VACE issues found while reproducing the supplied performance script with:MODEL_PATH=Pyros13/Wan2.2-VACE-Fun-A14B-DiffusersINPUT_VIDEO=mkt_part_000.mp4(61 frames)I also validated
Pyros13/Wan2.2-VACE-Fun-A14B-Diffusersagainst the originalalibaba-pai/Wan2.2-VACE-Fun-A14Bcheckpoint. Under the same vLLM-Omni pipeline, prompt, input video, seed, size, frame count, and 30 inference steps, both produced a byte-identical MP4. This lets the PR use the standard diffusers model layout and avoid adding original-format key remapping /.pthcomponent loading code.What changed
Wan22VACEPipelinein the Cache-DiT custom enabler registry so it uses the Wan2.2 block-level path instead of the generic transformer-level path.calibrator_configthroughenable_cache_for_wan22()for both single-transformer and dual-transformer Wan2.2 paths.AsyncOmniengine context alive until the HTTP shutdown task completes. Previouslyomni_run_server_worker()exitedbuild_async_omniimmediately afterserve_http()returned its shutdown task, which could close the engine while the server was still accepting requests.transformerandtransformer_2at the configured boundary timestep.WanVACETransformer3DModel._layerwise_offload_blocks_attrs = ["vace_blocks", "blocks"].Pyros13/Wan2.2-VACE-Fun-A14B-Diffusers.Issue reproduction notes
Wan22VACEPipelineWan22VACEPipelineentry inCUSTOM_DIT_ENABLERS, soCacheDiTBackend.enable()would fall back to the generic path.Wan22VACEPipeline -> enable_cache_for_wan22and a registry regression test.enable_cache_for_wan22()did not resolve or passcalibrator_config, unlike the generic path and S2V custom path._resolve_calibrator_config()usage and passed the same calibrator into bothParamsModifierandcache_dit.enable_cache().shutdown_taskafter exitingbuild_async_omni, so the engine context could shut down while HTTP serving continued.await shutdown_taskinside the engine context and added a lifecycle regression test.vace_blockswere not included in layerwise offload discovery.vace_blocksto layerwise offload discovery. The NPU allocator limit itself is outside this repo.Validation
Unit / CPU tests
Local GPU validation
Platform: single NVIDIA B300 for offline runs and
vllm serve.30-step V2V equivalence test, 736x1280, 61 frames,
seed=1,boundary_ratio=0.875:Pyros13 smoke test after removing original-format loader code:
Cache-DiT evidence after the fix:
Online serving validation for #4634:
Validation videos are attached in the PR discussion.