Skip to content

vllm.distributed.pp_transport

PP communication backends: the transport of a stage's intermediate tensors to the next stage (NCCL, or an alternative selected by VLLM_PP_TRANSPORT), and the last stage's per-step broadcasts to the earlier stages.

Modules:

  • copy_engine –

    PP transport on CUDA copy engines, synchronized on the GPU (one NVLink

  • rocm_sdma –

    The flag ops and peer copy of copy_engine.CopyEngineTransport on ROCm

Classes:

  • NcclBroadcast –

    PPBroadcast over a device process group.

  • PPBroadcast –

    The last PP rank's per-step broadcast to the other ranks of its PP chain.

  • PPTransport –

    One rank's side of its PP stage boundaries.

Functions:

NcclBroadcast

Bases: PPBroadcast

PPBroadcast over a device process group.

PPBroadcast

Bases: ABC

The last PP rank's per-step broadcast to the other ranks of its PP chain. All ranks call it on the same steps with the same keys, in the same order; the work is queued on the current stream.

Methods:

  • recv –

    Other ranks: receive this step's tensors into new ones of shapes.

  • send –

    Last rank: broadcast this step's tensors.

recv(shapes) abstractmethod

Other ranks: receive this step's tensors into new ones of shapes.

send(tensors) abstractmethod

Last rank: broadcast this step's tensors.

PPTransport

Bases: ABC

One rank's side of its PP stage boundaries.

Methods:

  • recv –

    Receive this step's inputs from the previous stage.

  • send –

    Send this step's outputs to the next stage. The caller may

recv(pp_group) abstractmethod

Receive this step's inputs from the previous stage.

send(tensors, pp_group) abstractmethod

Send this step's outputs to the next stage. The caller may overwrite tensors once this returns.

check_intermediate_tensors(tensors, expected)

Raise unless tensors match the receiving stage's persistent intermediate tensors in keys, dtypes and per-token shapes, which every PP transport requires. Otherwise the copy into them would silently drop, cast or broadcast values.

create_pp_transport(vllm_config, persistent, pp_handler=None)

Collective over the PP group. Returns None (send over NCCL) without PP, under "auto" on ROCm, or under "auto" when copy engines are not usable on some rank; every rank makes the same choice.

Parameters:

  • vllm_config

    (VllmConfig) –

    The engine config.

  • persistent

    (IntermediateTensors | None) –

    The model runner's persistent intermediate tensors (non-first ranks), which received tensors are copied into.

  • pp_handler

    (PPHandler | None, default: None ) –

    The model runner's PP handler, whose broadcasts are moved to the transport where it can carry them.