[PERF] Extend NCCL symmetric memory to AllGather and ReduceScatter (#46703)

Signed-off-by: Woosuk Kwon <woosuk@inferact.ai>
Co-authored-by: snordmann <snordmann@nvidia.com>
This commit is contained in:
Woosuk Kwon
2026-06-30 11:38:18 -07:00
committed by GitHub
co-authored by snordmann
parent 3a9784b82c
commit 953bba488d
6 changed files with 405 additions and 112 deletions
@@ -134,6 +134,18 @@ def should_nccl_symm_mem_allreduce(world_size: int, input_tensor: torch.Tensor)
return world_size > NCCL_SYMM_MEM_ALL_REDUCE_CONFIG["always_use_above_world_size"]
def should_nccl_symm_mem_ag_rs() -> bool:
"""Check whether NCCL symmetric memory should be used for
AllGather / ReduceScatter collectives."""
from vllm.distributed.device_communicators.pynccl_allocator import (
is_symmetric_memory_enabled,
)
if envs.VLLM_BATCH_INVARIANT:
return False
return is_symmetric_memory_enabled()
def producer(
batch_src: Sequence[int],
producer_queue,