vllm.distributed.kv_transfer.kv_connector.v1.multi_connector
¶
Classes:
-
MultiConnector–A wrapper for using multiple KVConnectors at the same time.
-
MultiKVConnectorHandshakeMetadata–One worker's handshake metadata, an entry per sub-connector.
-
MultiKVConnectorStats–Maintain a dict of KVConnectorStats objects, one for each connector.
MultiConnector
¶
Bases: KVConnectorBase_V1, SupportsHMA
A wrapper for using multiple KVConnectors at the same time.
The current logic is: - Load KV from the first connector that advertises available tokens from get_num_new_matched_tokens(), based on the order in the config. - Save to all connectors.
Methods:
-
all_children_support_hma–Return True only if every configured child connector supports HMA.
-
get_handshake_metadata–Collect every sub-connector's handshake metadata, so that the
-
get_mem_pool_context–Forward a custom KV cache memory pool from a child connector.
-
get_required_kvcache_layout–Get the required KV cache layout for this connector.
-
handle_preemptions–Handle preempted requests for all sub-connectors.
-
requires_piecewise_for_cudagraph–MultiConnector requires PIECEWISE CUDA graph mode if any of its
-
set_host_xfer_buffer_ops–Set xPU-specific copy ops for all sub-connectors.
_sub_connector_handshake_metadata(metadata, index)
¶
Return the entries of metadata that sub-connector index reported.
If a subclass overrides get_handshake_metadata to report a single
sub-connector's metadata (e.g. Dynamo's PdConnector), every
sub-connector receives metadata unchanged.
all_children_support_hma(kv_transfer_config)
classmethod
¶
Return True only if every configured child connector supports HMA.
get_handshake_metadata()
¶
Collect every sub-connector's handshake metadata, so that the scheduler side can give each one only its own.
get_mem_pool_context()
¶
Forward a custom KV cache memory pool from a child connector.
KV cache is allocated once and can only live in one pool, so at most one child may provide a context.
get_required_kvcache_layout(vllm_config)
classmethod
¶
Get the required KV cache layout for this connector.
Parameters:
-
(vllm_config¶VllmConfig) –the vllm config.
Returns:
handle_preemptions(kv_connector_metadata)
¶
Handle preempted requests for all sub-connectors.
requires_piecewise_for_cudagraph(extra_config)
classmethod
¶
MultiConnector requires PIECEWISE CUDA graph mode if any of its child connectors require it.
set_host_xfer_buffer_ops(copy_operation)
¶
Set xPU-specific copy ops for all sub-connectors.
MultiKVConnectorHandshakeMetadata
dataclass
¶
MultiKVConnectorStats
dataclass
¶
Bases: KVConnectorStats
Maintain a dict of KVConnectorStats objects, one for each connector. This is used to aggregate the stats from all connectors separately.