Skip to content

Commit 936643a

Browse files
authored
[BugFix] Also consider RAY_EXPERIMENTAL_NOSET_* when storing compilation cache (#27294)
Signed-off-by: Hollow Man <hollowman@opensuse.org>
1 parent b186149 commit 936643a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

vllm/envs.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,6 +1544,29 @@ def compute_hash() -> str:
15441544

15451545
factors = [environment_variables[key]() for key in environment_variables_to_hash]
15461546

1547+
ray_noset_env_vars = [
1548+
# Refer to
1549+
# https://github.com/ray-project/ray/blob/c584b1ea97b00793d1def71eaf81537d70efba42/python/ray/_private/accelerators/nvidia_gpu.py#L11
1550+
# https://github.com/ray-project/ray/blob/c584b1ea97b00793d1def71eaf81537d70efba42/python/ray/_private/accelerators/amd_gpu.py#L11
1551+
# https://github.com/ray-project/ray/blob/b97d21dab233c2bd8ed7db749a82a1e594222b5c/python/ray/_private/accelerators/amd_gpu.py#L10
1552+
# https://github.com/ray-project/ray/blob/c584b1ea97b00793d1def71eaf81537d70efba42/python/ray/_private/accelerators/npu.py#L12
1553+
# https://github.com/ray-project/ray/blob/c584b1ea97b00793d1def71eaf81537d70efba42/python/ray/_private/accelerators/hpu.py#L12
1554+
# https://github.com/ray-project/ray/blob/c584b1ea97b00793d1def71eaf81537d70efba42/python/ray/_private/accelerators/neuron.py#L14
1555+
# https://github.com/ray-project/ray/blob/c584b1ea97b00793d1def71eaf81537d70efba42/python/ray/_private/accelerators/tpu.py#L38
1556+
# https://github.com/ray-project/ray/blob/c584b1ea97b00793d1def71eaf81537d70efba42/python/ray/_private/accelerators/intel_gpu.py#L10
1557+
# https://github.com/ray-project/ray/blob/c584b1ea97b00793d1def71eaf81537d70efba42/python/ray/_private/accelerators/rbln.py#L10
1558+
"RAY_EXPERIMENTAL_NOSET_CUDA_VISIBLE_DEVICES",
1559+
"RAY_EXPERIMENTAL_NOSET_ROCR_VISIBLE_DEVICES",
1560+
"RAY_EXPERIMENTAL_NOSET_HIP_VISIBLE_DEVICES",
1561+
"RAY_EXPERIMENTAL_NOSET_ASCEND_RT_VISIBLE_DEVICES",
1562+
"RAY_EXPERIMENTAL_NOSET_HABANA_VISIBLE_MODULES",
1563+
"RAY_EXPERIMENTAL_NOSET_NEURON_RT_VISIBLE_CORES",
1564+
"RAY_EXPERIMENTAL_NOSET_TPU_VISIBLE_CHIPS",
1565+
"RAY_EXPERIMENTAL_NOSET_ONEAPI_DEVICE_SELECTOR",
1566+
"RAY_EXPERIMENTAL_NOSET_RBLN_RT_VISIBLE_DEVICES",
1567+
]
1568+
factors.extend([os.getenv(var) for var in ray_noset_env_vars])
1569+
15471570
hash_str = hashlib.md5(str(factors).encode(), usedforsecurity=False).hexdigest()
15481571

15491572
return hash_str

0 commit comments

Comments
 (0)