[feature][kv_offload] Self-describing KV events for OffloadingConnector (#43468)

Signed-off-by: Change72 <changg@nvidia.com>
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Change72
2026-06-22 07:27:46 +00:00
committed by GitHub
co-authored by Claude
parent d14e551a53
commit a9f7b2d41c
9 changed files with 720 additions and 62 deletions
+19
View File
@@ -147,6 +147,16 @@ class OffloadingHistogramMetadata(OffloadingMetricMetadata):
buckets: tuple[float, ...] | None = None
@dataclass(frozen=True)
class OffloadingKVEventsConfig:
# Global vLLM KV event publishing flag. When false, connector-specific
# event capture must stay inert because take_events() is not drained.
enable_kv_cache_events: bool
# OffloadingConnector opt-in for self-describing BlockStored payloads.
# Effective only when enable_kv_cache_events is true.
self_describing_kv_events: bool
class OffloadingManager(ABC):
@abstractmethod
def lookup(self, key: OffloadKey, req_context: ReqContext) -> bool | None:
@@ -443,6 +453,15 @@ class OffloadingSpec(ABC):
kv_transfer_config = vllm_config.kv_transfer_config
assert kv_transfer_config is not None
self.extra_config = kv_transfer_config.kv_connector_extra_config
kv_events_config = vllm_config.kv_events_config
self.kv_events_config = OffloadingKVEventsConfig(
enable_kv_cache_events=(
kv_events_config is not None and kv_events_config.enable_kv_cache_events
),
self_describing_kv_events=bool(
self.extra_config.get("self_describing_kv_events", False)
),
)
# When True, only prompt (prefill) blocks are offloaded; decode-phase
# blocks (KV generated after the prompt) are skipped. Useful when prior