mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-04-01 10:47:03 +08:00
add lora name as non breaking change
Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
This commit is contained in:
parent
ec3b890c14
commit
a86ef76c15
@ -28,8 +28,9 @@ class BlockStored(KVCacheEvent):
|
||||
parent_block_hash: ExternalBlockHash | None
|
||||
token_ids: list[int]
|
||||
block_size: int
|
||||
lora_name: str | None
|
||||
lora_id: int | None
|
||||
medium: str | None
|
||||
lora_name: str | None
|
||||
|
||||
|
||||
class BlockRemoved(KVCacheEvent):
|
||||
|
||||
@ -635,6 +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,6 +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)
|
||||
|
||||
@ -51,8 +51,9 @@ class BlockStored(KVCacheEvent):
|
||||
parent_block_hash: ExternalBlockHash | None
|
||||
token_ids: list[int]
|
||||
block_size: int
|
||||
lora_name: str | None
|
||||
lora_id: int | None
|
||||
medium: str | None
|
||||
lora_name: str | None
|
||||
|
||||
def __hash__(self) -> int:
|
||||
return hash(
|
||||
|
||||
@ -402,9 +402,10 @@ class OffloadingConnectorScheduler:
|
||||
block_hashes=event.block_hashes,
|
||||
parent_block_hash=None,
|
||||
token_ids=[],
|
||||
lora_name=None,
|
||||
lora_id=None,
|
||||
block_size=event.block_size,
|
||||
medium=event.medium,
|
||||
lora_name=None,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@ -284,10 +284,13 @@ class BlockPool:
|
||||
num_cached_blocks * block_size : num_full_blocks * block_size
|
||||
],
|
||||
block_size=block_size,
|
||||
lora_name=request.lora_request.name
|
||||
lora_id=request.lora_request.adapter_id
|
||||
if request.lora_request
|
||||
else None,
|
||||
medium=MEDIUM_GPU,
|
||||
lora_name=request.lora_request.name
|
||||
if request.lora_request
|
||||
else None,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user