From 7924beef84ff2846833f01b123e3c52f7ddaa1c6 Mon Sep 17 00:00:00 2001 From: SYLAR <125541396+lishunyang12@users.noreply.github.com> Date: Tue, 21 Jul 2026 20:28:31 +0800 Subject: [PATCH] [Refactor] Migrate replica-DP Wan2.2 example to --deploy-config (#5267) Signed-off-by: lishunyang12 Co-authored-by: lishunyang12 --- .../replica_data_parallel/README.md | 11 +++-- .../replica_data_parallel/run_server.sh | 2 +- .../replica_data_parallel/wan2_2_ti2v_dp.yaml | 42 ++++++------------- 3 files changed, 19 insertions(+), 36 deletions(-) diff --git a/examples/online_serving/replica_data_parallel/README.md b/examples/online_serving/replica_data_parallel/README.md index 4bc98d6f7..a230d71eb 100644 --- a/examples/online_serving/replica_data_parallel/README.md +++ b/examples/online_serving/replica_data_parallel/README.md @@ -12,7 +12,7 @@ This example uses `Wan-AI/Wan2.2-TI2V-5B-Diffusers` with one GPU per replica. | File | Purpose | |------|---------| -| `wan2_2_ti2v_dp.yaml` | Diffusion stage config; `runtime.num_replicas` + `runtime.devices` drive the fan-out. | +| `wan2_2_ti2v_dp.yaml` | Deploy config; `num_replicas` + `devices` drive the fan-out. | | `run_server.sh` | Substitutes `NUM_REPLICAS` / `DEVICES` into the config and serves. | | `bench_replica_dp.py` | Replica-agnostic load driver; reports throughput, latency, and a per-input isolation check. | @@ -82,10 +82,9 @@ output under `N>=2` concurrency must match its own single-replica baseline. - `runtime.num_replicas: N` fans out `N` replicas; `runtime.devices` assigns their GPUs. With `tensor_parallel_size = 1`, list one GPU per replica (`num_replicas * tensor_parallel_size` entries, pool mode). -- Replica fan-out here comes from the stage config, not a CLI flag. (The headless / +- Replica fan-out here comes from the deploy config, not a CLI flag. (The headless / multi-runtime launch path uses the process-local `--omni-dp-size-local`, which requires `--stage-id`.) -- This recipe serves via `--stage-configs-path`. Expressing replica-DP under the - newer `--deploy-config` schema is part of the ongoing serving-config alignment - (see the diffusion parallelism guide and the `#4707` discussion); `num_replicas` - is accepted by both paths. +- This recipe serves via `--deploy-config`. Replica fan-out comes from the deploy + config's `num_replicas` / `devices`; stage topology comes from the registered + `WanPipeline`. diff --git a/examples/online_serving/replica_data_parallel/run_server.sh b/examples/online_serving/replica_data_parallel/run_server.sh index 915732eee..6b6f641fd 100755 --- a/examples/online_serving/replica_data_parallel/run_server.sh +++ b/examples/online_serving/replica_data_parallel/run_server.sh @@ -30,4 +30,4 @@ echo "Serving ${MODEL}: num_replicas=${NUM_REPLICAS} devices=${DEVICES} (config vllm serve "$MODEL" --omni \ --host "$HOST" \ --port "$PORT" \ - --stage-configs-path "$CFG" + --deploy-config "$CFG" diff --git a/examples/online_serving/replica_data_parallel/wan2_2_ti2v_dp.yaml b/examples/online_serving/replica_data_parallel/wan2_2_ti2v_dp.yaml index b472d7e2d..52cf99778 100644 --- a/examples/online_serving/replica_data_parallel/wan2_2_ti2v_dp.yaml +++ b/examples/online_serving/replica_data_parallel/wan2_2_ti2v_dp.yaml @@ -8,36 +8,20 @@ # run_server.sh substitutes __NUM_REPLICAS__ / __DEVICES__ from env before serving. # For tensor_parallel_size = 1, `devices` lists one GPU per replica (pool mode): # num_replicas=4 -> devices "0,1,2,3". +# +# Stage topology (diffusion DiT, video output) comes from the registered +# WanPipeline, which auto-detects TI2V-5B mode from model_index.json; this file +# carries deployment knobs only. +trust_remote_code: true +distributed_executor_backend: mp -stage_args: +stages: - stage_id: 0 - stage_type: diffusion - runtime: - num_replicas: __NUM_REPLICAS__ - devices: "__DEVICES__" - max_batch_size: 1 - engine_args: - model_stage: dit - # `model_class_name` takes the diffusion registry KEY (WanPipeline), which - # resolves to the Wan22Pipeline class. Wan2.2 TI2V-5B is served by the base - # WanPipeline, which auto-detects TI2V-5B mode from model_index.json. - model_class_name: WanPipeline - max_num_seqs: 1 - enforce_eager: true - trust_remote_code: true - distributed_executor_backend: "mp" - vae_use_tiling: true - parallel_config: - tensor_parallel_size: 1 - - final_output: true - final_output_type: video - is_comprehension: false + num_replicas: __NUM_REPLICAS__ + devices: "__DEVICES__" + max_num_seqs: 1 + tensor_parallel_size: 1 + enforce_eager: true + vae_use_tiling: true default_sampling_params: seed: 42 - -runtime: - enabled: true - defaults: - window_size: -1 - max_inflight: 1