@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 0cd259b2d8
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 9, 13:33 UTC

[BugFix] Fix P/D with non-MoE DP (#33037)

Signed-off-by: Nick Hill <nickhill123@gmail.com>

Nick Hill committed Jan 27, 2026 at 08:03 UTC 0cd259b2d8b3f5cc237bea833b283db54d21529c
2 files changed +18 -11
vllm/v1/engine/core.py
+11 -11
@@ -911,6 +911,17 @@ class EngineCoreProc(EngineCore):
911 set_process_title("EngineCore")
912 decorate_logs()
913
914 + if data_parallel and vllm_config.kv_transfer_config is not None:
915 + # modify the engine_id and append the local_dp_rank to it to ensure
916 + # that the kv_transfer_config is unique for each DP rank.
917 + vllm_config.kv_transfer_config.engine_id = (
918 + f"{vllm_config.kv_transfer_config.engine_id}_dp{local_dp_rank}"
919 + )
920 + logger.debug(
921 + "Setting kv_transfer_config.engine_id to %s",
922 + vllm_config.kv_transfer_config.engine_id,
923 + )
924 +
925 parallel_config.data_parallel_index = dp_rank
926 if data_parallel and vllm_config.model_config.is_moe:
927 # Set data parallel rank for this engine process.
@@ -1285,17 +1296,6 @@ class DPEngineCoreProc(EngineCoreProc):
1296 assert local_dp_rank is not None
1297 assert 0 <= local_dp_rank <= dp_rank < dp_size
1298
1288 - if vllm_config.kv_transfer_config is not None:
1289 - # modify the engine_id and append the local_dp_rank to it to ensure
1290 - # that the kv_transfer_config is unique for each DP rank.
1291 - vllm_config.kv_transfer_config.engine_id = (
1292 - f"{vllm_config.kv_transfer_config.engine_id}_dp{local_dp_rank}"
1293 - )
1294 - logger.debug(
1295 - "Setting kv_transfer_config.engine_id to %s",
1296 - vllm_config.kv_transfer_config.engine_id,
1297 - )
1298 -
1299 self.dp_rank = dp_rank
1300 self.dp_group = vllm_config.parallel_config.stateless_init_dp_group()
1301
vllm/v1/engine/utils.py
+7
@@ -313,6 +313,13 @@ class CoreEngineActorManager:
313 dp_vllm_config.parallel_config.placement_group = pg
314 local_client = index < local_engine_count
315
316 + if dp_size > 1 and dp_vllm_config.kv_transfer_config is not None:
317 + # modify the engine_id and append the local_dp_rank to it to ensure
318 + # that the kv_transfer_config is unique for each DP rank.
319 + dp_vllm_config.kv_transfer_config.engine_id = (
320 + f"{dp_vllm_config.kv_transfer_config.engine_id}_dp{local_index}"
321 + )
322 +
323 # Ray XPU known issue: dpctl initializes the GPU runtime early, so
324 # setting device env vars in Ray actor's initialization method
325 # will not affect device selection. See: