Skip to content

Commit

Permalink
[Misc]add some explanations for BlockHashType (vllm-project#11847)
Browse files Browse the repository at this point in the history
Signed-off-by: Bowen Wang <abmfy@icloud.com>
  • Loading branch information
WangErXiao authored and abmfy committed Jan 24, 2025
1 parent c24e090 commit e326d8e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vllm/v1/core/kv_cache_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

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

0 comments on commit e326d8e

Please sign in to comment.