vllm.distributed.kv_transfer.kv_connector.v1.nixl.metadata
¶
Metadata dataclasses and helpers for the NIXL connector.
Classes:
-
HeartbeatInfo–Heartbeat data for a single remote engine, sent from D worker to P.
-
NixlHandshakePayload–Wrapper for NIXL handshake sent over the wire.
Functions:
-
compute_nixl_compatibility_hash–Compute compatibility hash for NIXL KV transfer.
HeartbeatInfo
dataclass
¶
Heartbeat data for a single remote engine, sent from D worker to P.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/nixl/metadata.py
NixlHandshakePayload
dataclass
¶
Bases: KVConnectorHandshakeMetadata
Wrapper for NIXL handshake sent over the wire.
Enables two-phase decoding for graceful compatibility checking: 1. Decode NixlHandshakePayload to get compatibility_hash 2. Compute local hash and compare 3. Only if hashes match, decode agent_metadata_bytes
This prevents decoder errors when NixlAgentMetadata schema is incompatible, allowing graceful failure with clear error message.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/nixl/metadata.py
_get_speculative_compatibility_factors(vllm_config)
¶
Return NIXL compatibility factors for hidden-state-based speculators.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/nixl/metadata.py
compute_nixl_compatibility_hash(vllm_config, attn_backend_name, transfer_mode='pull')
¶
Compute compatibility hash for NIXL KV transfer.
Hash only the factors that affect whether two NIXL instances can successfully transfer KV cache data.
Factors included:
- vLLM version and NIXL connector version
- Model architecture (name, dtype, KV heads, layers)
- KV cache format (dtype, sliding window)
- Attention backend
- EAGLE/MTP configuration that affects transferred state
- Transfer mode (push vs pull)
- The KV identity, with enforce_kv_identity in the connector's extra
config
The transfer mode is included because the push (WRITE) and pull (READ) connectors use incompatible transfer protocols; a push connector and a pull connector must never complete a handshake with each other.
Note: Factors like tensor_parallel_size, block_size, and kv_cache_layout are validated at runtime in _validate_remote_agent_handshake and are not included in this hash to support heterogeneous deployments.
Note - the set of factors are likely to evolve significantly over time to be more or less permissive.
Returns:
-
str–SHA-256 hex digest
Source code in vllm/distributed/kv_transfer/kv_connector/v1/nixl/metadata.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | |