fix BlockStored kvevent with lora name instead of id

Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
This commit is contained in:
Sage Ahrac 2025-10-27 14:55:46 +02:00
parent 86e178f7c4
commit 6bb544be6d
No known key found for this signature in database
6 changed files with 6 additions and 6 deletions

View File

@ -28,7 +28,7 @@ class BlockStored(KVCacheEvent):
parent_block_hash: ExternalBlockHash | None parent_block_hash: ExternalBlockHash | None
token_ids: list[int] token_ids: list[int]
block_size: int block_size: int
lora_id: int | None lora_name: str | None
medium: str | None medium: str | None

View File

@ -635,7 +635,7 @@ def test_kv_cache_events(
"Block size should be the same as the block size" "Block size should be the same as the block size"
) )
assert event.parent_block_hash is None, "Parent block hash should be None" assert event.parent_block_hash is None, "Parent block hash should be None"
assert event.lora_id is None, "Lora id should be None" assert event.lora_name is None, "Lora name should be None"
assert len(event.token_ids) == num_blocks * block_size, ( assert len(event.token_ids) == num_blocks * block_size, (
"Token ids should be the same as the custom tokens" "Token ids should be the same as the custom tokens"
) )

View File

@ -527,7 +527,7 @@ def test_offloading_connector(request_runner):
assert event.medium == "A" assert event.medium == "A"
assert event.token_ids == [] assert event.token_ids == []
assert event.parent_block_hash is None assert event.parent_block_hash is None
assert event.lora_id is None assert event.lora_name is None
event = events[1] event = events[1]
assert isinstance(event, BlockRemoved) assert isinstance(event, BlockRemoved)
assert event.block_hashes == to_hashes([4, 5, 6]) assert event.block_hashes == to_hashes([4, 5, 6])

View File

@ -51,7 +51,7 @@ class BlockStored(KVCacheEvent):
parent_block_hash: ExternalBlockHash | None parent_block_hash: ExternalBlockHash | None
token_ids: list[int] token_ids: list[int]
block_size: int block_size: int
lora_id: int | None lora_name: str | None
medium: str | None medium: str | None

View File

@ -402,7 +402,7 @@ class OffloadingConnectorScheduler:
block_hashes=event.block_hashes, block_hashes=event.block_hashes,
parent_block_hash=None, parent_block_hash=None,
token_ids=[], token_ids=[],
lora_id=None, lora_name=None,
block_size=event.block_size, block_size=event.block_size,
medium=event.medium, medium=event.medium,
) )

View File

@ -279,7 +279,7 @@ class BlockPool:
num_cached_blocks * block_size : num_full_blocks * block_size num_cached_blocks * block_size : num_full_blocks * block_size
], ],
block_size=block_size, block_size=block_size,
lora_id=request.lora_request.adapter_id lora_name=request.lora_request.name
if request.lora_request if request.lora_request
else None, else None,
medium=MEDIUM_GPU, medium=MEDIUM_GPU,