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
47831430
Unverified
Commit
47831430
authored
Jan 05, 2025
by
Jee Jee Li
Committed by
GitHub
Jan 04, 2025
Browse files
[Bugfix][V1] Fix test_kv_cache_utils.py (#11738)
Signed-off-by:
Jee Jee Li
<
pandaleefree@gmail.com
>
parent
65c08928
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
tests/v1/core/test_kv_cache_utils.py
tests/v1/core/test_kv_cache_utils.py
+5
-5
No files found.
tests/v1/core/test_kv_cache_utils.py
View file @
47831430
...
@@ -147,12 +147,12 @@ def test_generate_block_hash_extra_keys():
...
@@ -147,12 +147,12 @@ def test_generate_block_hash_extra_keys():
# Test with no extra keys
# Test with no extra keys
extra_keys
,
next_mm_idx
=
generate_block_hash_extra_keys
(
request
,
0
,
5
,
0
)
extra_keys
,
next_mm_idx
=
generate_block_hash_extra_keys
(
request
,
0
,
5
,
0
)
assert
extra_keys
==
(
(
"hash1"
,
0
),
)
assert
extra_keys
==
(
"hash1"
,
)
assert
next_mm_idx
==
1
assert
next_mm_idx
==
1
# Test with partial overlap
# Test with partial overlap
extra_keys
,
next_mm_idx
=
generate_block_hash_extra_keys
(
request
,
3
,
8
,
0
)
extra_keys
,
next_mm_idx
=
generate_block_hash_extra_keys
(
request
,
3
,
8
,
0
)
assert
extra_keys
==
(
(
"hash1"
,
3
),
)
assert
extra_keys
==
(
"hash1"
,
)
assert
next_mm_idx
==
1
assert
next_mm_idx
==
1
# Test with no overlap
# Test with no overlap
...
@@ -162,7 +162,7 @@ def test_generate_block_hash_extra_keys():
...
@@ -162,7 +162,7 @@ def test_generate_block_hash_extra_keys():
# Test with multiple extra keys
# Test with multiple extra keys
extra_keys
,
next_mm_idx
=
generate_block_hash_extra_keys
(
request
,
0
,
15
,
0
)
extra_keys
,
next_mm_idx
=
generate_block_hash_extra_keys
(
request
,
0
,
15
,
0
)
assert
extra_keys
==
(
(
"
hash1
"
,
0
),
(
"hash2"
,
0
)
)
assert
extra_keys
==
(
'
hash1
'
,
'hash2'
)
assert
next_mm_idx
==
2
assert
next_mm_idx
==
2
...
@@ -216,11 +216,11 @@ def test_hash_request_tokens():
...
@@ -216,11 +216,11 @@ def test_hash_request_tokens():
# Check the first block
# Check the first block
assert
block_hashes
[
0
].
token_ids
==
(
0
,
1
,
2
)
assert
block_hashes
[
0
].
token_ids
==
(
0
,
1
,
2
)
assert
block_hashes
[
0
].
extra_keys
==
(
(
"hash1"
,
0
),
)
assert
block_hashes
[
0
].
extra_keys
==
(
"hash1"
,
)
# Check the second block
# Check the second block
assert
block_hashes
[
1
].
token_ids
==
(
3
,
4
,
5
)
assert
block_hashes
[
1
].
token_ids
==
(
3
,
4
,
5
)
assert
block_hashes
[
1
].
extra_keys
==
(
(
"hash2"
,
0
),
)
assert
block_hashes
[
1
].
extra_keys
==
(
"hash2"
,
)
def
test_hash_request_tokens_no_mm_inputs
():
def
test_hash_request_tokens_no_mm_inputs
():
...
...
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