vllm.distributed.aux_output_connector.connector
¶
Scheduler-side control plane for execution auxiliary outputs.
Classes:
-
AuxOutputSchedulerConnector–Build worker metadata without owning auxiliary output payloads or stores.
-
InlineAuxOutputSchedulerConnector–Return rows inline, retained alongside the GPU prefix cache.
-
ObjectAuxOutputSchedulerConnector–Deliver every request's rows as shared objects, keyed
-
PackedBlockHashes–Contiguous, self-contained block hashes for scheduler-worker IPC.
Functions:
-
create_aux_output_scheduler_connector–The scheduler connector of the instance's delivery: objects when
-
object_put_timeout_s–Seconds an object write may take from being queued: 80% of the
-
retained_objects–Number of hash-block objects whose routed experts the scheduler retains
-
send_listed_abort_outputs–Send the final outputs of the aborted requests that have an object
Attributes:
-
AuxObject–(key, start, end): positions[start, end)are the firstend - start
AuxObject = tuple[str, int, int]
module-attribute
¶
(key, start, end): positions [start, end) are the first end - start
rows of the object key, whose first position is start.
AuxOutputSchedulerConnector
¶
Bases: ABC
Build worker metadata without owning auxiliary output payloads or stores.
An instance delivers every request's rows one way, chosen at construction
by create_aux_output_scheduler_connector.
Methods:
-
build_connector_meta–Build one step's incremental worker metadata.
-
flush_metadata–Metadata that hands the worker the writes due when the engine
-
loads_failed–Note the requests about to end with an error because KV they hold
-
objects_dropped–Note the objects the writer dropped.
-
request_finished–Queue a request's terminal event.
-
reset–Start a new auxiliary output namespace after a prefix-cache reset.
-
take_output–Return the accepted R3 rows for one scheduled request.
build_connector_meta(scheduler_output, requests)
abstractmethod
¶
Build one step's incremental worker metadata.
flush_metadata()
¶
Metadata that hands the worker the writes due when the engine
pauses, which no step would send before it resumes. Nothing waits
for them. None for inline rows.
loads_failed(request_ids)
abstractmethod
¶
Note the requests about to end with an error because KV they hold failed to load.
objects_dropped(keys)
abstractmethod
¶
Note the objects the writer dropped.
request_finished(request)
abstractmethod
¶
Queue a request's terminal event.
reset(*, clear_dropped=True)
¶
Start a new auxiliary output namespace after a prefix-cache reset.
take_output(request, output)
abstractmethod
¶
Return the accepted R3 rows for one scheduled request.
InlineAuxOutputSchedulerConnector
¶
Bases: AuxOutputSchedulerConnector
Return rows inline, retained alongside the GPU prefix cache.
Methods:
-
build_connector_meta–Build one step's incremental worker metadata.
-
loads_failed–Rows computed over KV that failed to load are not returned: the
-
objects_dropped–No objects are written.
-
request_finished–Queue a request's terminal event and final block hashes.
-
take_output–Return the accepted R3 rows for one scheduled request.
build_connector_meta(scheduler_output, requests)
¶
Build one step's incremental worker metadata.
loads_failed(request_ids)
¶
Rows computed over KV that failed to load are not returned: the requests end with an error.
objects_dropped(keys)
¶
No objects are written.
request_finished(request)
¶
Queue a request's terminal event and final block hashes.
take_output(request, output)
¶
Return the accepted R3 rows for one scheduled request.
ObjectAuxOutputSchedulerConnector
¶
Bases: AuxOutputSchedulerConnector
Deliver every request's rows as shared objects, keyed
<key_prefix>/<salt dir>/<block hash> with the key directory of its client
cache salt (aux_salt_dir), and list them in its final output.
Methods:
-
build_connector_meta–Build one step's incremental worker metadata.
-
loads_failed–Requests about to end with an error because KV they hold failed to
-
objects_dropped–Stop hits on the spans whose objects the writer dropped, until a
-
request_finished–Write the full blocks a preempted request computed, which the
-
request_loading–Hits are capped by
cap_external_hitalone. -
reset–After a prefix-cache reset the worker drops its runs: a preempted
-
take_output–Rows are not returned inline.
_before_dropped(request)
¶
Start of the first object of request that was dropped.
_end_run(state, end, limit, tail=True)
¶
End the run of a finished request: write its blocks up to limit,
and list its positions from the block holding its prompt start up to
end. A listing names only objects that are written: the blocks the
run wrote, one object per span, and one tail object, written from the
run's rows, for the positions after them. A run that holds no rows,
or none before end, lists its written blocks up to end and no
tail.
_settled(request)
staticmethod
¶
Positions the current run computed whose step outputs were processed. Stale output still in flight belongs to the run a preemption ended, not to this one.
_start_run(request)
¶
Start a run of a scheduled request, in which the worker keeps the rows it computes. A preempted request runs again from its prefix-cache hit, a span boundary: the positions after it are computed again, and their rows replace the earlier ones, as for inline rows. The blocks before it were written at the preemption. A hit of the whole prompt computes its last position again; the run starts at the end of the hit, so that row is neither written nor listed.
_write_blocks(state, limit)
¶
Write the full spans of the current run that end at limit or
before and are hashed, whatever any KV cache group keeps: every span
another request can hit was computed by a run that writes it.
build_connector_meta(scheduler_output, requests)
¶
Build one step's incremental worker metadata.
loads_failed(request_ids)
¶
Requests about to end with an error because KV they hold failed to load: what their steps in flight compute is not written.
objects_dropped(keys)
¶
Stop hits on the spans whose objects the writer dropped, until a request computes and writes them again.
request_finished(request)
¶
Write the full blocks a preempted request computed, which the
prefix cache keeps; it runs again from its prefix-cache hit.
End the run of a finished one and keep its listing for its final
output: the positions whose tokens it returned. One that ended with an
error lists nothing and writes what it computed, which other requests
may hit, unless KV it held failed to load (loads_failed).
request_loading(request, num_tokens)
¶
Hits are capped by cap_external_hit alone.
reset(*, clear_dropped=True)
¶
After a prefix-cache reset the worker drops its runs: a preempted request starts a new one when it runs again.
take_output(request, output)
¶
Rows are not returned inline.
PackedBlockHashes
dataclass
¶
Contiguous, self-contained block hashes for scheduler-worker IPC.
create_aux_output_scheduler_connector(vllm_config, kv_cache_manager)
¶
The scheduler connector of the instance's delivery: objects when
AuxOutputConfig.object_key_prefix is set, else inline rows.
object_put_timeout_s()
¶
Seconds an object write may take from being queued: 80% of the execute-model timeout, so that a step waiting on a full queue returns in time.
retained_objects(vllm_config, kv_cache_config)
¶
Number of hash-block objects whose routed experts the scheduler retains and the worker stores, and the tokens per object.
send_listed_abort_outputs(requests, output_queue)
¶
Send the final outputs of the aborted requests that have an object listing, with it, and return the other requests.