Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
bc0f6059
Unverified
Commit
bc0f6059
authored
Sep 15, 2025
by
Ning Xie
Committed by
GitHub
Sep 15, 2025
Browse files
[UT] enhance free kv cache block queue popleft_n (#24220)
Signed-off-by:
Andy Xie
<
andy.xning@gmail.com
>
parent
8de261b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
tests/v1/core/test_kv_cache_utils.py
tests/v1/core/test_kv_cache_utils.py
+4
-0
No files found.
tests/v1/core/test_kv_cache_utils.py
View file @
bc0f6059
...
...
@@ -280,9 +280,11 @@ def test_free_kv_cache_block_queue_popleft_n():
# Pop 0 block
# fake_head->b1->b3->b5->b4->b0->b2->fake_tail
assert
len
(
queue
.
popleft_n
(
0
))
==
0
assert
queue
.
num_free_blocks
==
6
# Pop 1 block
# fake_head->b3->b5->b4->b0->b2->fake_tail
result_blocks
=
queue
.
popleft_n
(
1
)
assert
queue
.
num_free_blocks
==
5
assert
len
(
result_blocks
)
==
1
assert
result_blocks
[
0
]
is
blocks
[
1
]
for
block
in
result_blocks
:
...
...
@@ -292,6 +294,7 @@ def test_free_kv_cache_block_queue_popleft_n():
# fake_head->b4->b0->b2->fake_tail
result_blocks
=
queue
.
popleft_n
(
2
)
assert
len
(
result_blocks
)
==
2
assert
queue
.
num_free_blocks
==
3
assert
result_blocks
[
0
]
is
blocks
[
3
]
assert
result_blocks
[
1
]
is
blocks
[
5
]
for
block
in
result_blocks
:
...
...
@@ -301,6 +304,7 @@ def test_free_kv_cache_block_queue_popleft_n():
# fake_head->fake_tail
result_blocks
=
queue
.
popleft_n
(
3
)
assert
len
(
result_blocks
)
==
3
assert
queue
.
num_free_blocks
==
0
assert
result_blocks
[
0
]
is
blocks
[
4
]
assert
result_blocks
[
1
]
is
blocks
[
0
]
assert
result_blocks
[
2
]
is
blocks
[
2
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment