Skip to content

Commit 47de882

Browse files
authored
[Misc]add some explanations for BlockHashType (#11847)
1 parent 5984499 commit 47de882

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

vllm/v1/core/kv_cache_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111

1212
class BlockHashType(NamedTuple):
1313
"""Hash value of a block (int), the token IDs in the block, and extra keys.
14-
The reason we keep a tuple of token IDs and extra keys is to make sure
15-
no hash collision happens when the hash value is the same.
14+
We keep a tuple of token IDs and extra keys to reduce the likelihood of
15+
hash collisions when the hash value is the same. But please note that
16+
hash collisions can still theoretically occur, albeit with an extremely
17+
low probability.
1618
"""
1719
# Hash value of the block in an integer.
1820
hash_value: int

0 commit comments

Comments
 (0)