Skip to content

Commit a1071a6

Browse files
heheda12345Mu Huai
authored and
Mu Huai
committed
[v1] Introduce KVCacheBlocks as interface between Scheduler and KVCacheManager (vllm-project#17479)
Signed-off-by: Chen Zhang <[email protected]> Signed-off-by: Mu Huai <[email protected]>
1 parent 98c9312 commit a1071a6

File tree

4 files changed

+121
-99
lines changed

4 files changed

+121
-99
lines changed

tests/v1/core/test_kv_cache_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ def test_allocate_with_lookahead():
542542
num_tokens=3,
543543
num_lookahead_tokens=2, # Total required: 3+2=5 tokens
544544
)
545-
assert len(blocks) == 2 # ceil(5/4)=2 blocks
545+
assert len(blocks.blocks) == 2 # ceil(5/4)=2 blocks
546546

547547
# Test case 2: With precomputed blocks
548548
kv_cache_manager = KVCacheManager(kv_cache_config=config,
@@ -553,7 +553,7 @@ def test_allocate_with_lookahead():
553553
num_tokens=3,
554554
num_lookahead_tokens=2,
555555
)
556-
assert len(blocks) == 2
556+
assert len(blocks.blocks) == 2
557557

558558
# Test case 3: With precomputed blocks
559559
# required_blocks = ceil((3 + 4) / 4) = 2
@@ -564,4 +564,4 @@ def test_allocate_with_lookahead():
564564
num_tokens=3,
565565
num_lookahead_tokens=4,
566566
)
567-
assert len(blocks) == 2
567+
assert len(blocks.blocks) == 2

0 commit comments

Comments
 (0)