Skip to content

Commit 3d2244f

Browse files
andyxningYuqi Zhang
authored and
Yuqi Zhang
committed
[BUGFIX] use random for NONE_HASH only when PYTHONHASHSEED not set (vllm-project#17088)
Signed-off-by: Andy Xie <[email protected]> Signed-off-by: Yuqi Zhang <[email protected]>
1 parent ff20ecd commit 3d2244f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vllm/v1/core/kv_cache_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class BlockHashType(NamedTuple):
4343
# This aligns with the behavior of Python's hash() function, which also uses
4444
# a random seed if PYTHONHASHSEED is not set.
4545
NONE_HASH = int.from_bytes(os.urandom(32), byteorder="big") if os.getenv(
46-
'PYTHONHASHSEED') is not None else sha256(os.getenv('PYTHONHASHSEED'))
46+
'PYTHONHASHSEED') is None else sha256(os.getenv('PYTHONHASHSEED'))
4747

4848

4949
class PrefixCachingMetrics:

0 commit comments

Comments
 (0)