Skip to content

[platform] fix: quiet CPU-only Ray worker warnings - #7132

Open
Wooonster wants to merge 1 commit into
verl-project:mainfrom
Wooonster:agent/suppress-cpu-only-ray-platform-warnings
Open

[platform] fix: quiet CPU-only Ray worker warnings#7132
Wooonster wants to merge 1 commit into
verl-project:mainfrom
Wooonster:agent/suppress-cpu-only-ray-platform-warnings

Conversation

@Wooonster

Copy link
Copy Markdown

What does this PR do?

Downgrade two platform auto-detection warnings to DEBUG only when verl can safely confirm that the current process is a Ray task or actor with no assigned GPU/NPU resources:

  • No supported accelerator detected ... Falling back to 'nvidia'.
  • Platform 'nvidia' (PlatformCUDA) is registered but not available ...

CPU-only actors such as AgentLoopWorker and RewardLoopWorker intentionally do not request accelerator resources, so these warnings are expected and make healthy distributed RL runs look broken.

The helper is fail-closed:

  • Ray remains an optional dependency.
  • A missing/uninitialized Ray installation, a driver process, or any runtime-context query failure preserves WARNING behavior.
  • Ray workers assigned GPU or NPU resources preserve WARNING behavior, so real accelerator visibility failures remain visible.
  • Platform detection, fallback selection, resource allocation, and visible-device environment variables are unchanged.

Root cause

The platform abstraction probes accelerator availability process-locally. Intentional CPU-only Ray actors see no CUDA/NPU device, so both the auto-detection fallback and unavailable-platform paths log at WARNING even though those actors never perform accelerator work.

Duplicate-work check

No open PR was found for issue #6741 or the exact warning text.

Test

The human submitter reviewed every changed line and personally ran:

.venv/bin/pytest -q tests/plugin/test_platform_abstraction.py
# 17 passed

.venv/bin/pre-commit run ruff --files \
  verl/plugin/platform/platform_manager.py \
  tests/plugin/test_platform_abstraction.py
# Passed

.venv/bin/pre-commit run ruff-format --files \
  verl/plugin/platform/platform_manager.py \
  tests/plugin/test_platform_abstraction.py
# Passed

Focused mocked-Ray coverage includes:

  1. CPU-only Ray worker: both messages are DEBUG and no WARNING is emitted.
  2. GPU-assigned Ray worker: both WARNING messages remain.
  3. Ray unavailable: existing WARNING behavior remains.
  4. Ray runtime-context failure: existing WARNING behavior remains.

AI assistance

OpenAI Codex assisted with repository exploration, implementation, tests, duplicate-work checks, and PR drafting. The human submitter reviewed every changed line, understands the logging-only behavior and fail-closed resource detection, and personally ran the test and formatting commands above.

Co-authored-by: OpenAI Codex <codex@openai.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@CLAassistant

CLAassistant commented Jul 23, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Wooonster
Wooonster marked this pull request as ready for review July 23, 2026 11:36
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@Wooonster
Wooonster marked this pull request as draft July 23, 2026 11:38
@Wooonster
Wooonster marked this pull request as ready for review July 23, 2026 11:40
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants