@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 9273a427b5
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 10, 06:30 UTC

[Misc] Allow enabling NCCL for DP sync when async scheduling (#32197)

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

Nick Hill committed Jan 12, 2026 at 18:03 UTC 9273a427b5ec1491f7e8420c8fdab8d203843b75
4 files changed +26 -16
vllm/config/parallel.py
+13 -3
@@ -2,10 +2,11 @@
2 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
4 import os
5 +from collections.abc import Callable
6 from typing import TYPE_CHECKING, Any, Literal
7
8 import torch
8 -from pydantic import Field, model_validator
9 +from pydantic import Field, field_validator, model_validator
10 from pydantic.dataclasses import dataclass
11 from torch.distributed import ProcessGroup, ReduceOp
12 from typing_extensions import Self
@@ -182,9 +183,12 @@ class ParallelConfig:
183 threshold, microbatching will be used. Otherwise, the request will be
184 processed in a single batch."""
185
185 - disable_nccl_for_dp_synchronization: bool = False
186 + disable_nccl_for_dp_synchronization: bool = Field(default=None)
187 """Forces the dp synchronization logic in vllm/v1/worker/dp_utils.py
187 - to use Gloo instead of NCCL for its all reduce"""
188 + to use Gloo instead of NCCL for its all reduce.
189 +
190 + Defaults to True when async scheduling is enabled, False otherwise.
191 + """
192
193 ray_workers_use_nsight: bool = False
194 """Whether to profile Ray workers with nsight, see https://docs.ray.io/en/latest/ray-observability/user-guides/profiling.html#profiling-nsight-profiler."""
@@ -292,6 +296,12 @@ class ParallelConfig:
296 should only be set by API server scale-out.
297 """
298
299 + @field_validator("disable_nccl_for_dp_synchronization", mode="wrap")
300 + @classmethod
301 + def _skip_none_validation(cls, value: Any, handler: Callable) -> Any:
302 + """Skip validation if the value is `None` when initialisation is delayed."""
303 + return None if value is None else handler(value)
304 +
305 @model_validator(mode="after")
306 def _validate_parallel_config(self) -> Self:
307 if self._api_process_rank >= self._api_process_count:
vllm/config/scheduler.py
+1 -3
@@ -209,9 +209,7 @@ class SchedulerConfig:
209 @classmethod
210 def _skip_none_validation(cls, value: Any, handler: Callable) -> Any:
211 """Skip validation if the value is `None` when initialisation is delayed."""
212 - if value is None:
213 - return value
214 - return handler(value)
212 + return None if value is None else handler(value)
213
214 def __post_init__(self, max_model_len: int, is_encoder_decoder: bool) -> None:
215 if is_encoder_decoder:
vllm/config/vllm.py
+11 -9
@@ -629,20 +629,22 @@ class VllmConfig:
629 else:
630 self.scheduler_config.async_scheduling = True
631
632 - if (
633 - self.scheduler_config.async_scheduling
634 - and not self.parallel_config.disable_nccl_for_dp_synchronization
635 - ):
636 - logger.info_once(
637 - "Disabling NCCL for DP synchronization when using async scheduling."
638 - )
639 - self.parallel_config.disable_nccl_for_dp_synchronization = True
640 -
632 logger.info_once(
633 "Asynchronous scheduling is %s.",
634 "enabled" if self.scheduler_config.async_scheduling else "disabled",
635 )
636
637 + if self.parallel_config.disable_nccl_for_dp_synchronization is None:
638 + if self.scheduler_config.async_scheduling:
639 + logger.info_once(
640 + "Disabling NCCL for DP synchronization "
641 + "when using async scheduling.",
642 + scope="local",
643 + )
644 + self.parallel_config.disable_nccl_for_dp_synchronization = True
645 + else:
646 + self.parallel_config.disable_nccl_for_dp_synchronization = False
647 +
648 from vllm.platforms import current_platform
649
650 if (
vllm/engine/arg_utils.py
+1 -1
@@ -413,7 +413,7 @@ class EngineArgs:
413 ubatch_size: int = ParallelConfig.ubatch_size
414 dbo_decode_token_threshold: int = ParallelConfig.dbo_decode_token_threshold
415 dbo_prefill_token_threshold: int = ParallelConfig.dbo_prefill_token_threshold
416 - disable_nccl_for_dp_synchronization: bool = (
416 + disable_nccl_for_dp_synchronization: bool | None = (
417 ParallelConfig.disable_nccl_for_dp_synchronization
418 )
419 eplb_config: EPLBConfig = get_field(ParallelConfig, "eplb_config")