[DP] support torchrun external launcher with Data Parallelism (#24899)

Signed-off-by: Lu Fang <fanglu@fb.com>
Signed-off-by: Zhuohan Li <zhuohan123@gmail.com>
Co-authored-by: Zhuohan Li <zhuohan123@gmail.com>
This commit is contained in:
Lucia Fang
2025-09-22 12:06:05 -07:00
committed by GitHub
co-authored by Zhuohan Li
parent 239ef0c1ac
commit 922979bfcc
6 changed files with 202 additions and 7 deletions
+3 -1
View File
@@ -1032,7 +1032,9 @@ def init_distributed_environment(world_size: int = -1,
distributed_init_method, backend)
from vllm.config import get_current_vllm_config
config = get_current_vllm_config()
if config is not None and config.parallel_config.data_parallel_size > 1:
if config is not None and config.parallel_config.data_parallel_size > 1 \
and config.parallel_config.distributed_executor_backend \
!= "external_launcher":
parallel_config = config.parallel_config
# adjust to take into account data parallelism
# offset the rank by the data parallel rank