[rocm][ray] Fix: Unify Ray device visibility handling across CUDA and ROCm (#33308)

Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
This commit is contained in:
kourosh hakhamaneshi
2026-02-04 10:09:14 -08:00
committed by GitHub
parent 192ad4648b
commit 2f6d17cb2f
8 changed files with 43 additions and 8 deletions
+3
View File
@@ -102,6 +102,9 @@ class CudaPlatformBase(Platform):
ray_device_key: str = "GPU"
dist_backend: str = "nccl"
device_control_env_var: str = "CUDA_VISIBLE_DEVICES"
ray_noset_device_env_vars: list[str] = [
"RAY_EXPERIMENTAL_NOSET_CUDA_VISIBLE_DEVICES",
]
@property
def supported_dtypes(self) -> list[torch.dtype]:
+5
View File
@@ -116,6 +116,11 @@ class Platform:
# https://github.com/ray-project/ray/tree/master/python/ray/_private/accelerators # noqa
device_control_env_var: str = "VLLM_DEVICE_CONTROL_ENV_VAR_PLACEHOLDER"
# environment variables that need to be set to 1 to prevent ray from
# setting the visible devices e.g.
# RAY_EXPERIMENTAL_NOSET_CUDA_VISIBLE_DEVICES
ray_noset_device_env_vars: list[str] = []
# The torch.compile backend for compiling simple and
# standalone functions. The default value is "inductor" to keep
# the same behavior as PyTorch.
+5
View File
@@ -194,6 +194,11 @@ class RocmPlatform(Platform):
dist_backend: str = "nccl"
# rocm shares the same device control env var as CUDA
device_control_env_var: str = "CUDA_VISIBLE_DEVICES"
ray_noset_device_env_vars: list[str] = [
"RAY_EXPERIMENTAL_NOSET_HIP_VISIBLE_DEVICES",
"RAY_EXPERIMENTAL_NOSET_CUDA_VISIBLE_DEVICES",
"RAY_EXPERIMENTAL_NOSET_ROCR_VISIBLE_DEVICES",
]
supported_quantization: list[str] = [
"awq",