Skip to content

[Ray][Core] Fix RAY_EXPERIMENTAL_NOSET_* environment variable parsing in accelerator managers#60577

Merged
edoakes merged 1 commit intomasterfrom
kh/nonset-envvars
Jan 29, 2026
Merged

[Ray][Core] Fix RAY_EXPERIMENTAL_NOSET_* environment variable parsing in accelerator managers#60577
edoakes merged 1 commit intomasterfrom
kh/nonset-envvars

Conversation

@kouroshHakha
Copy link
Contributor

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>
@kouroshHakha kouroshHakha added the go add ONLY when ready to merge, run all tests label Jan 29, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kouroshHakha kouroshHakha marked this pull request as ready for review January 29, 2026 05:35
@kouroshHakha kouroshHakha requested a review from a team as a code owner January 29, 2026 05:35
@ray-gardener ray-gardener bot added the core Issues that should be addressed in Ray Core label Jan 29, 2026
@edoakes edoakes merged commit ee7ed6e into master Jan 29, 2026
6 checks passed
@edoakes edoakes deleted the kh/nonset-envvars branch January 29, 2026 23:17
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issues that should be addressed in Ray Core go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants