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 12, 02:15 UTC
enable multi-node in external launcher mode (#29833)
Xieyang Xu committed
Dec 3, 2025 at 17:02 UTC
ad32e3e19ccf0526cb6744a5fed09a138a5fb2f9
2 files changed
+27
-20
vllm/config/parallel.py
+6
-2
@@ -593,10 +593,14 @@ class ParallelConfig:
593
"max_parallel_loading_workers is currently "
594
"not supported and will be ignored."
595
)
596
- if self.distributed_executor_backend not in ("mp", "uni") and self.nnodes > 1:
596
+ allowed_backends = ("mp", "uni", "external_launcher")
597
+ if (
598
+ self.distributed_executor_backend not in allowed_backends
599
+ and self.nnodes > 1
600
+ ):
601
raise ValueError(
602
"nnodes > 1 can only be set when distributed executor "
599
- "backend is mp or uni."
603
+ "backend is mp, uni or external_launcher."
604
)
605
606
@property
vllm/distributed/parallel_state.py
+21
-18
@@ -1169,17 +1169,13 @@ def init_distributed_environment(
1169
from vllm.config import get_current_vllm_config
1170
1171
config = get_current_vllm_config()
1172
- if config is not None and config.parallel_config.nnodes > 1:
1173
- parallel_config = config.parallel_config
1174
- ip = parallel_config.master_addr
1175
- rank = parallel_config.data_parallel_rank * world_size + rank
1176
- world_size = parallel_config.world_size_across_dp
1177
- port = parallel_config.master_port
1178
- distributed_init_method = get_distributed_init_method(ip, port)
1179
- elif (
1172
+ if (
1173
config is not None
1181
- and config.parallel_config.data_parallel_size > 1
1174
and config.parallel_config.distributed_executor_backend != "external_launcher"
1175
+ and (
1176
+ config.parallel_config.nnodes > 1
1177
+ or config.parallel_config.data_parallel_size > 1
1178
+ )
1179
):
1180
parallel_config = config.parallel_config
1181
# adjust to take into account data parallelism
@@ -1187,15 +1183,22 @@ def init_distributed_environment(
1183
rank = parallel_config.data_parallel_rank * world_size + rank
1184
# adjust the world size to take into account data parallelism
1185
world_size = parallel_config.world_size_across_dp
1190
- ip = parallel_config.data_parallel_master_ip
1191
- port = parallel_config.get_next_dp_init_port()
1192
- distributed_init_method = get_distributed_init_method(ip, port)
1193
- logger.debug(
1194
- "Adjusting world_size=%d rank=%d distributed_init_method=%s for DP",
1195
- world_size,
1196
- rank,
1197
- distributed_init_method,
1198
- )
1186
+
1187
+ # Use appropriate IP and port based on configuration
1188
+ if parallel_config.nnodes > 1:
1189
+ ip = parallel_config.master_addr
1190
+ port = parallel_config.master_port
1191
+ distributed_init_method = get_distributed_init_method(ip, port)
1192
+ else:
1193
+ ip = parallel_config.data_parallel_master_ip
1194
+ port = parallel_config.get_next_dp_init_port()
1195
+ distributed_init_method = get_distributed_init_method(ip, port)
1196
+ logger.debug(
1197
+ "Adjusting world_size=%d rank=%d distributed_init_method=%s for DP",
1198
+ world_size,
1199
+ rank,
1200
+ distributed_init_method,
1201
+ )
1202
if not torch.distributed.is_initialized():
1203
logger.info(
1204
"world_size=%d rank=%d local_rank=%d distributed_init_method=%s backend=%s",