Skip to content

vllm.distributed.device_communicators.custom_all_reduce

Classes:

CustomAllreduce

Methods:

  • __init__ –

    Args:

  • all_reduce –

    Performs an out-of-place all reduce.

  • capture –

    The main responsibility of this context manager is the

  • custom_all_reduce –

    The main allreduce API that provides support for cuda graph.

__init__(group, device, max_size=8192 * 1024, max_all_gather_size=_DEFAULT_ALL_GATHER_MAX_SIZE, max_mnnvl_all_gather_size=None, max_reduce_scatter_size=_DEFAULT_REDUCE_SCATTER_MAX_SIZE, max_mnnvl_reduce_scatter_size=_DEFAULT_MNNVL_REDUCE_SCATTER_MAX_SIZE, max_mnnvl_multimem_reduce_scatter_size=_DEFAULT_MNNVL_MULTIMEM_REDUCE_SCATTER_MAX_SIZE, symm_mem_enabled=False, *, register_graph_buffers=True)

Parameters:

  • group

    (ProcessGroup) –

    the process group to work on. If None, it will use the default process group.

  • device

    (int | str | device) –

    the device to bind the CustomAllreduce to. If None, it will be bound to f"cuda:{local_rank}".

  • register_graph_buffers

    (bool, default: True ) –

    whether graph capture IPC-registers its buffers.

It is the caller's responsibility to make sure each communicator is bound to a unique device. CUDA IPC collectives require all ranks to be on the same node; cross-node groups only support MNNVL all-gather and reduce-scatter.

all_reduce(inp, *, out=None, registered=False)

Performs an out-of-place all reduce.

If registered is True, this assumes inp's pointer is already IPC-registered. Otherwise, inp is first copied into a pre-registered buffer.

capture()

The main responsibility of this context manager is the register_graph_buffers call at the end of the context. It records all the buffer addresses used in the CUDA graph.

custom_all_reduce(input)

The main allreduce API that provides support for cuda graph.

_group_can_attempt_mnnvl(group, device)

Return whether every rank can enter the cross-node MNNVL path.

MNNVL is available only on Blackwell-class GPUs. Local multicast support is necessary but does not establish that the process group spans an MNNVL domain; the caller performs that group-level topology check before this local capability probe. The CPU all-reduce keeps every rank on the same control-flow path for heterogeneous or partially configured groups.

_has_local_multicast_support(device)

Return whether this CUDA device can allocate multicast memory.