[Prefix Cache] Include lora_name in BlockStored event for deterministic KV-cache reconstruction (#27577)
Signed-off-by: Sage Ahrac <sagiahrak@gmail.com> Co-authored-by: Sage <80211083+sagiahrac@users.noreply.github.com>
This commit is contained in:
@@ -51,8 +51,14 @@ class BlockStored(KVCacheEvent):
|
||||
parent_block_hash: ExternalBlockHash | None
|
||||
token_ids: list[int]
|
||||
block_size: int
|
||||
|
||||
lora_id: int | None
|
||||
"""Deprecated: use `lora_name` for KV block key hash.
|
||||
Retained for backward compatibility.
|
||||
"""
|
||||
|
||||
medium: str | None
|
||||
lora_name: str | None
|
||||
|
||||
def __hash__(self) -> int:
|
||||
return hash(
|
||||
|
||||
@@ -234,6 +234,7 @@ class LMCacheConnectorV1(KVConnectorBase_V1):
|
||||
lora_id=e.lora_id,
|
||||
block_size=e.block_size,
|
||||
medium=e.medium,
|
||||
lora_name=e.lora_name,
|
||||
)
|
||||
for e in events
|
||||
]
|
||||
|
||||
@@ -406,6 +406,7 @@ class OffloadingConnectorScheduler:
|
||||
lora_id=None,
|
||||
block_size=event.block_size,
|
||||
medium=event.medium,
|
||||
lora_name=None,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user