Skip to content

vllm.v1.engine.coordinator

Classes:

DPCoordinator

Coordinator process used for data-parallel deployments (DP>1).

Intermediates between multiple DP engine rank processes and one or more front-end API server processes.

  • Collects stats from each DP engine (currently just waiting and running queue lengths), and publishes these to all front-ends for use in load-balancing decisions.

  • Keeps track of the current DP "request wave" number and running state of the engines. This is received from the DP rank 0 engine and published to the front-end processes along with the current load stats.

The engines alternate between a global running/paused state. The global "request wave" number is a count of the number of times that the workers collectively move from a running state to a paused state. This transition is synchronized via the all-reduce operation performed in the DPEngineCoreProc._has_global_unfinished_reqs method.

  • Broadcasts the START_DP_WAVE message to engines to move them from paused to running state when an idle engine receives a new request and notifies the coordinator. Only the engines start waves: a front-end's view of the running state can be stale, and a paused engine discards START_DP_WAVE.

Engines will move into running state when receiving a new request or START_DP_WAVE message.

Note that when deployed in External LB mode, no stats will be published by the engines and thus updates will only be sent to front-ends when the request wave / running state changes.

Methods:

get_engine_socket_addresses()

Returns tuple of ZMQ input address, output address.

shutdown(timeout=None)

Shutdown coordinator process with configurable timeout.

DPCoordinatorProc

_get_engine_counts(do_copy=False)

Return list of [waiting, running] count lists for each engine.

_send_start_wave(socket, wave, exclude_engine_index) staticmethod

Broadcast the START_DP_WAVE message to all the engines. It includes the current wave number and index of engine which has already received a request with this wave number and so doesn't require additional notification.