Skip to content

vllm.distributed.aux_output_connector.worker

Worker-side auxiliary-output data plane.

Classes:

Functions:

AuxOutputWorkerConnector

Bases: ABC

Own capture and backend resources on the output worker. An instance delivers every request's rows one way, chosen at construction by get_aux_output_connector.

Methods:

  • begin_step –

    Apply one scheduler step's request and block-hash updates.

  • initialize_output_storage –

    Create the output data plane once the KV cache layout is resolved.

  • prepare_output –

    Snapshot one step's R3 tensor for asynchronous CPU transfer.

  • process_output –

    Commit one consumed R3 snapshot and build request outputs.

  • take_dropped_objects –

    Keys of the objects the writer dropped since the last call.

_apply_metadata(metadata) abstractmethod

Apply one scheduler step's metadata, under _lock.

_owns_output() abstractmethod

Whether this rank owns the output data plane.

_track_output(pending) abstractmethod

Record a new step output of the requests it covers.

begin_step(metadata)

Apply one scheduler step's request and block-hash updates.

While an unconsumed step covers a finished request, its teardown is deferred to that step's process_output.

initialize_output_storage(kv_cache_config) abstractmethod

Create the output data plane once the KV cache layout is resolved.

prepare_output(input_batch)

Snapshot one step's R3 tensor for asynchronous CPU transfer.

process_output(pending) abstractmethod

Commit one consumed R3 snapshot and build request outputs.

take_dropped_objects()

Keys of the objects the writer dropped since the last call.

InlineAuxOutputWorkerConnector

Bases: AuxOutputWorkerConnector

Return rows inline: keep them per KV block and hand each request's accepted rows to the scheduler.

Methods:

_teardown(request_ids)

Drop finished requests' temporary state after publishing key releases.

initialize_output_storage(kv_cache_config)

Create the output data plane once the KV cache layout is resolved.

process_output(pending)

Commit one consumed R3 snapshot and build request outputs.

Request teardown deferred by begin_step is completed here once no in-flight step covers the request.

ObjectAuxOutputWorkerConnector

Bases: AuxOutputWorkerConnector

Deliver rows as objects: keep each request's rows in its run and hand the objects the scheduler names to the writer.

Methods:

_put_objects(objects)

One put per step, so a step waits for the writer at most once.

initialize_output_storage(kv_cache_config)

Connect the object store once the KV cache layout is resolved.

process_output(pending)

Add one consumed R3 snapshot to the runs it covers and write the objects whose rows are all there. Returns no rows.

take_dropped_objects()

Keys of the objects the writer dropped since the last call.

PendingAuxOutput dataclass

Own one step's R3 snapshot until its asynchronous copy is consumed.

Methods:

  • enqueue_cpu_copy –

    Enqueue asynchronous D2H copies; call on the output copy stream.

  • kept_rows –

    Each request's first position and numbers of scheduled and sampled

enqueue_cpu_copy(num_sampled, num_rejected)

Enqueue asynchronous D2H copies; call on the output copy stream.

kept_rows()

Each request's first position and numbers of scheduled and sampled tokens, and the rows of the tokens it kept.

_ObjectRun dataclass

Rows a request computed since it was last scheduled, by KV block, and the objects still to write from them. A block a step computes whole is a view of that step's rows; a block computed over several steps is filled in place in its own buffer. Positions computed again, after a failed KV load, go to copies of their blocks: the writer may still read objects taken from them. Runs start on a block boundary and every object starts at one; a tail object may span blocks.

Methods:

  • take_ready –

    Objects whose rows are all here. Later writes start at or after

take_ready()

Objects whose rows are all here. Later writes start at or after the start of the last one, so earlier blocks are dropped.

get_aux_output_connector(model, vllm_config)

The worker connector of the instance's delivery: objects when AuxOutputConfig.object_key_prefix is set, else inline rows.