Skip to content

[core] Deflake torch tensor transport test#62743

Merged
richardliaw merged 3 commits intoray-project:masterfrom
Sparks0219:joshlee/fix-pytorch-test
Apr 18, 2026
Merged

[core] Deflake torch tensor transport test#62743
richardliaw merged 3 commits intoray-project:masterfrom
Sparks0219:joshlee/fix-pytorch-test

Conversation

@Sparks0219
Copy link
Copy Markdown
Contributor

@Sparks0219 Sparks0219 commented Apr 17, 2026

After #62492 we no longer set CUDA_VISIBLE_DEVICES ="" when num_gpus=0 or not set. Torch if it detects that CUDA_VISIBLE_DEVICES ="" throws a runtime error, however now that CUDA_VISIBLE_DEVICES is not set at all it falls back to the nvidia driver to get the device ids. Following up on #62653 and instead checking for the default cuda:0 gpu id in these tests.

Signed-off-by: Joshua Lee <joshlee@anyscale.com>
Signed-off-by: Joshua Lee <joshlee@anyscale.com>
@Sparks0219 Sparks0219 requested a review from a team as a code owner April 17, 2026 23:42
Copy link
Copy Markdown
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 updates the test_torch_tensor_transport.py test suite to improve reliability by correctly asserting expected outcomes and handling GPU availability via torch.cuda.is_available(). Additionally, it removes a deprecation warning for the container field in runtime_env.py. Feedback was provided regarding the removal of this warning, as it seems unrelated to the test updates and should likely be restored to maintain user awareness of the deprecation.

Comment thread python/ray/runtime_env/runtime_env.py
@edoakes edoakes added the go add ONLY when ready to merge, run all tests label Apr 18, 2026
@ray-gardener ray-gardener Bot added the core Issues that should be addressed in Ray Core label Apr 18, 2026
@richardliaw richardliaw merged commit 64385a5 into ray-project:master Apr 18, 2026
6 checks passed
HLDKNotFound pushed a commit to chichic21039/ray that referenced this pull request Apr 22, 2026
After ray-project#62492 we no longer set CUDA_VISIBLE_DEVIES ="" when num_gpus=0 or
not set. Torch if it detects that CUDA_VISIBLE_DEVIES ="" throws a
runtime error, however now that CUDA_VISIBLE_DEVIES is not set at all it
falls back to the nvidia driver to get the device ids. Following up on
ray-project#62653 and instead checking for the default cuda:0 gpu id in these
tests.

---------

Signed-off-by: Joshua Lee <joshlee@anyscale.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.

3 participants