From 47de8821d3cdd32fce7df6312318223aee591fd2 Mon Sep 17 00:00:00 2001 From: WangErXiao <863579016@qq.com> Date: Thu, 9 Jan 2025 02:21:30 +0800 Subject: [PATCH] [Misc]add some explanations for BlockHashType (#11847) --- vllm/v1/core/kv_cache_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vllm/v1/core/kv_cache_utils.py b/vllm/v1/core/kv_cache_utils.py index 84ff48bf428a0..22a5d2fb08a48 100644 --- a/vllm/v1/core/kv_cache_utils.py +++ b/vllm/v1/core/kv_cache_utils.py @@ -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