Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jan 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tests/v1/core/test_kv_cache_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ def test_generate_block_hash_extra_keys():

# Test with no extra keys
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

# Test with partial overlap
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

# Test with no overlap
Expand All @@ -162,7 +162,7 @@ def test_generate_block_hash_extra_keys():

# Test with multiple extra keys
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


Expand Down Expand Up @@ -216,11 +216,11 @@ def test_hash_request_tokens():

# Check the first block
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
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():
Expand Down
Loading