mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-04-01 10:27:02 +08:00
fix BlockStored kvevent with lora name instead of id
Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
This commit is contained in:
parent
86e178f7c4
commit
6bb544be6d
@ -28,7 +28,7 @@ class BlockStored(KVCacheEvent):
|
||||
parent_block_hash: ExternalBlockHash | None
|
||||
token_ids: list[int]
|
||||
block_size: int
|
||||
lora_id: int | None
|
||||
lora_name: str | None
|
||||
medium: str | None
|
||||
|
||||
|
||||
|
||||
@ -635,7 +635,7 @@ def test_kv_cache_events(
|
||||
"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.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, (
|
||||
"Token ids should be the same as the custom tokens"
|
||||
)
|
||||
|
||||
@ -527,7 +527,7 @@ def test_offloading_connector(request_runner):
|
||||
assert event.medium == "A"
|
||||
assert event.token_ids == []
|
||||
assert event.parent_block_hash is None
|
||||
assert event.lora_id is None
|
||||
assert event.lora_name is None
|
||||
event = events[1]
|
||||
assert isinstance(event, BlockRemoved)
|
||||
assert event.block_hashes == to_hashes([4, 5, 6])
|
||||
|
||||
@ -51,7 +51,7 @@ class BlockStored(KVCacheEvent):
|
||||
parent_block_hash: ExternalBlockHash | None
|
||||
token_ids: list[int]
|
||||
block_size: int
|
||||
lora_id: int | None
|
||||
lora_name: str | None
|
||||
medium: str | None
|
||||
|
||||
|
||||
|
||||
@ -402,7 +402,7 @@ class OffloadingConnectorScheduler:
|
||||
block_hashes=event.block_hashes,
|
||||
parent_block_hash=None,
|
||||
token_ids=[],
|
||||
lora_id=None,
|
||||
lora_name=None,
|
||||
block_size=event.block_size,
|
||||
medium=event.medium,
|
||||
)
|
||||
|
||||
@ -279,7 +279,7 @@ class BlockPool:
|
||||
num_cached_blocks * block_size : num_full_blocks * block_size
|
||||
],
|
||||
block_size=block_size,
|
||||
lora_id=request.lora_request.adapter_id
|
||||
lora_name=request.lora_request.name
|
||||
if request.lora_request
|
||||
else None,
|
||||
medium=MEDIUM_GPU,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user