[HMA] [KVEvent] Enable GPU-side KV events for HMA (#37688)

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
Co-authored-by: Or Ozeri <or@ozery.com>
This commit is contained in:
Martin Hickey
2026-04-12 10:01:02 +03:00
committed by GitHub
co-authored by Or Ozeri
parent 17e787a779
commit cc07dad789
8 changed files with 300 additions and 28 deletions
+11 -1
View File
@@ -67,6 +67,8 @@ class BlockStored(KVCacheEvent):
KV cache consumers to reconstruct block hashes.
"""
group_idx: int | None = None
def __hash__(self) -> int:
return hash(
(
@@ -77,6 +79,7 @@ class BlockStored(KVCacheEvent):
self.lora_id,
self.medium,
tuple(self.extra_keys) if self.extra_keys else None,
self.group_idx,
)
)
@@ -84,9 +87,16 @@ class BlockStored(KVCacheEvent):
class BlockRemoved(KVCacheEvent):
block_hashes: list[ExternalBlockHash]
medium: str | None
group_idx: int | None = None
def __hash__(self) -> int:
return hash((tuple(self.block_hashes), self.medium))
return hash(
(
tuple(self.block_hashes),
self.medium,
self.group_idx,
)
)
class AllBlocksCleared(KVCacheEvent):