[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:
@@ -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]:
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user