[Ray][Core] Fix RAY_EXPERIMENTAL_NOSET_* environment variable parsing in accelerator managers#60577
Merged
[Ray][Core] Fix RAY_EXPERIMENTAL_NOSET_* environment variable parsing in accelerator managers#60577
RAY_EXPERIMENTAL_NOSET_* environment variable parsing in accelerator managers#60577Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request correctly fixes a bug in parsing boolean environment variables across all accelerator managers. The previous use of os.environ.get() or os.getenv() incorrectly treated the string "0" as a truthy value. By switching to env_bool(), the logic now correctly interprets only "1" or "true" as True, aligning with the intended behavior. The fix is applied consistently and correctly across all relevant files for NVIDIA, AMD, Intel, HPU, NPU, Neuron, TPU, and RBLN accelerators. The changes are clean and effectively resolve the issue.
edoakes
approved these changes
Jan 29, 2026
limarkdcunha
pushed a commit
to limarkdcunha/ray
that referenced
this pull request
Jan 29, 2026
…ng in accelerator managers (ray-project#60577) The `RAY_EXPERIMENTAL_NOSET_*_VISIBLE_DEVICES` environment variables were incorrectly parsed using `os.environ.get()`, which treats the string `"0"` as true and skips setting visible device IDs even when the user intends `"0"` to mean "do set them". This PR fixes all accelerator managers (NVIDIA, AMD, Intel, HPU, NPU, Neuron, TPU, RBLN) to use env_bool() for proper boolean parsing, so only "1" or "true" will skip setting the device visibility environment variables. Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
liulehui
pushed a commit
to liulehui/ray
that referenced
this pull request
Jan 31, 2026
…ng in accelerator managers (ray-project#60577) The `RAY_EXPERIMENTAL_NOSET_*_VISIBLE_DEVICES` environment variables were incorrectly parsed using `os.environ.get()`, which treats the string `"0"` as true and skips setting visible device IDs even when the user intends `"0"` to mean "do set them". This PR fixes all accelerator managers (NVIDIA, AMD, Intel, HPU, NPU, Neuron, TPU, RBLN) to use env_bool() for proper boolean parsing, so only "1" or "true" will skip setting the device visibility environment variables. Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
400Ping
pushed a commit
to 400Ping/ray
that referenced
this pull request
Feb 1, 2026
…ng in accelerator managers (ray-project#60577) The `RAY_EXPERIMENTAL_NOSET_*_VISIBLE_DEVICES` environment variables were incorrectly parsed using `os.environ.get()`, which treats the string `"0"` as true and skips setting visible device IDs even when the user intends `"0"` to mean "do set them". This PR fixes all accelerator managers (NVIDIA, AMD, Intel, HPU, NPU, Neuron, TPU, RBLN) to use env_bool() for proper boolean parsing, so only "1" or "true" will skip setting the device visibility environment variables. Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com> Signed-off-by: 400Ping <jiekaichang@apache.org>
rayhhome
pushed a commit
to rayhhome/ray
that referenced
this pull request
Feb 4, 2026
…ng in accelerator managers (ray-project#60577) The `RAY_EXPERIMENTAL_NOSET_*_VISIBLE_DEVICES` environment variables were incorrectly parsed using `os.environ.get()`, which treats the string `"0"` as true and skips setting visible device IDs even when the user intends `"0"` to mean "do set them". This PR fixes all accelerator managers (NVIDIA, AMD, Intel, HPU, NPU, Neuron, TPU, RBLN) to use env_bool() for proper boolean parsing, so only "1" or "true" will skip setting the device visibility environment variables. Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com> Signed-off-by: Sirui Huang <ray.huang@anyscale.com>
elliot-barn
pushed a commit
that referenced
this pull request
Feb 9, 2026
…ng in accelerator managers (#60577) The `RAY_EXPERIMENTAL_NOSET_*_VISIBLE_DEVICES` environment variables were incorrectly parsed using `os.environ.get()`, which treats the string `"0"` as true and skips setting visible device IDs even when the user intends `"0"` to mean "do set them". This PR fixes all accelerator managers (NVIDIA, AMD, Intel, HPU, NPU, Neuron, TPU, RBLN) to use env_bool() for proper boolean parsing, so only "1" or "true" will skip setting the device visibility environment variables. Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
ans9868
pushed a commit
to ans9868/ray
that referenced
this pull request
Feb 18, 2026
…ng in accelerator managers (ray-project#60577) The `RAY_EXPERIMENTAL_NOSET_*_VISIBLE_DEVICES` environment variables were incorrectly parsed using `os.environ.get()`, which treats the string `"0"` as true and skips setting visible device IDs even when the user intends `"0"` to mean "do set them". This PR fixes all accelerator managers (NVIDIA, AMD, Intel, HPU, NPU, Neuron, TPU, RBLN) to use env_bool() for proper boolean parsing, so only "1" or "true" will skip setting the device visibility environment variables. Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com> Signed-off-by: Adel Nour <ans9868@nyu.edu>
peterxcli
pushed a commit
to peterxcli/ray
that referenced
this pull request
Feb 25, 2026
…ng in accelerator managers (ray-project#60577) The `RAY_EXPERIMENTAL_NOSET_*_VISIBLE_DEVICES` environment variables were incorrectly parsed using `os.environ.get()`, which treats the string `"0"` as true and skips setting visible device IDs even when the user intends `"0"` to mean "do set them". This PR fixes all accelerator managers (NVIDIA, AMD, Intel, HPU, NPU, Neuron, TPU, RBLN) to use env_bool() for proper boolean parsing, so only "1" or "true" will skip setting the device visibility environment variables. Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com> Signed-off-by: peterxcli <peterxcli@gmail.com>
peterxcli
pushed a commit
to peterxcli/ray
that referenced
this pull request
Feb 25, 2026
…ng in accelerator managers (ray-project#60577) The `RAY_EXPERIMENTAL_NOSET_*_VISIBLE_DEVICES` environment variables were incorrectly parsed using `os.environ.get()`, which treats the string `"0"` as true and skips setting visible device IDs even when the user intends `"0"` to mean "do set them". This PR fixes all accelerator managers (NVIDIA, AMD, Intel, HPU, NPU, Neuron, TPU, RBLN) to use env_bool() for proper boolean parsing, so only "1" or "true" will skip setting the device visibility environment variables. Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com> Signed-off-by: peterxcli <peterxcli@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
RAY_EXPERIMENTAL_NOSET_*_VISIBLE_DEVICESenvironment variables were incorrectly parsed usingos.environ.get(), which treats the string"0"as true and skips setting visible device IDs even when the user intends"0"to mean "do set them". This PR fixes all accelerator managers (NVIDIA, AMD, Intel, HPU, NPU, Neuron, TPU, RBLN) to use env_bool() for proper boolean parsing, so only "1" or "true" will skip setting the device visibility environment variables.