@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 47831430cc
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 16, 03:15 UTC

[Bugfix][V1] Fix test_kv_cache_utils.py (#11738)

Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>

Jee Jee Li committed Jan 5, 2025 at 00:07 UTC 47831430cc943cd470d38d27f8c69a5782795ec3
1 file changed +5 -5
tests/v1/core/test_kv_cache_utils.py
+5 -5
@@ -147,12 +147,12 @@ def test_generate_block_hash_extra_keys():
147
148 # Test with no extra keys
149 extra_keys, next_mm_idx = generate_block_hash_extra_keys(request, 0, 5, 0)
150 - assert extra_keys == (("hash1", 0), )
150 + assert extra_keys == ("hash1", )
151 assert next_mm_idx == 1
152
153 # Test with partial overlap
154 extra_keys, next_mm_idx = generate_block_hash_extra_keys(request, 3, 8, 0)
155 - assert extra_keys == (("hash1", 3), )
155 + assert extra_keys == ("hash1", )
156 assert next_mm_idx == 1
157
158 # Test with no overlap
@@ -162,7 +162,7 @@ def test_generate_block_hash_extra_keys():
162
163 # Test with multiple extra keys
164 extra_keys, next_mm_idx = generate_block_hash_extra_keys(request, 0, 15, 0)
165 - assert extra_keys == (("hash1", 0), ("hash2", 0))
165 + assert extra_keys == ('hash1', 'hash2')
166 assert next_mm_idx == 2
167
168
@@ -216,11 +216,11 @@ def test_hash_request_tokens():
216
217 # Check the first block
218 assert block_hashes[0].token_ids == (0, 1, 2)
219 - assert block_hashes[0].extra_keys == (("hash1", 0), )
219 + assert block_hashes[0].extra_keys == ("hash1", )
220
221 # Check the second block
222 assert block_hashes[1].token_ids == (3, 4, 5)
223 - assert block_hashes[1].extra_keys == (("hash2", 0), )
223 + assert block_hashes[1].extra_keys == ("hash2", )
224
225
226 def test_hash_request_tokens_no_mm_inputs():