Skip to content

Change the ray_accel_env_var_override_on_zero warning to future_warning - #55791

Merged
edoakes merged 1 commit into
ray-project:masterfrom
Qiaolin-Yu:warning
Aug 20, 2025
Merged

edoakes merged 1 commit into
ray-project:masterfrom
Qiaolin-Yu:warning

Conversation

@Qiaolin-Yu

Copy link
Copy Markdown
Member

Why are these changes needed?

Before this pr:

python /ray-workspace/temp.py
2025-08-18 18:26:21,621 INFO worker.py:1943 -- Started a local Ray instance. View the dashboard at http://127.0.0.1:8265 
2025-08-18 18:26:53,873 WARNING worker.py:1991 -- Tip: In future versions of Ray, Ray will no longer override accelerator visible devices env var if num_gpus=0 or num_gpus=None (default). To enable this behavior and turn off this error message, set RAY_ACCEL_ENV_VAR_OVERRIDE_ON_ZERO=0

After this pr:

2025-08-20 19:08:41,923 INFO worker.py:1939 -- Started a local Ray instance. View the dashboard at http://127.0.0.1:8265 
/sgl-workspace/ray/python/ray/_private/worker.py:1987: FutureWarning: Tip: In future versions of Ray, Ray will no longer override accelerator visible devices env var if num_gpus=0 or num_gpus=None (default). To enable this behavior and turn off this error message, set RAY_ACCEL_ENV_VAR_OVERRIDE_ON_ZERO=0
  warnings.warn(

Related issue number

This is to refine #54928

Checks

@Qiaolin-Yu
Qiaolin-Yu requested a review from a team as a code owner August 20, 2025 19:13

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

Copy link
Copy Markdown
Contributor

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 changes a logger.warning to a warnings.warn with FutureWarning. My feedback focuses on improving the warning by adjusting the stacklevel to point to the user's code and refining the warning message for better clarity and formality. This will make the warning more actionable for Ray users.

Comment thread python/ray/_private/worker.py Resolved
@Qiaolin-Yu Qiaolin-Yu added the go add ONLY when ready to merge, run all tests label Aug 20, 2025
@edoakes
edoakes enabled auto-merge (squash) August 20, 2025 20:35
@edoakes
edoakes merged commit 25d7644 into ray-project:master Aug 20, 2025
jugalshah291 pushed a commit to jugalshah291/ray_fork that referenced this pull request Sep 11, 2025
…ng (ray-project#55791)

Before this pr:
```
python /ray-workspace/temp.py
2025-08-18 18:26:21,621 INFO worker.py:1943 -- Started a local Ray instance. View the dashboard at http://127.0.0.1:8265
2025-08-18 18:26:53,873 WARNING worker.py:1991 -- Tip: In future versions of Ray, Ray will no longer override accelerator visible devices env var if num_gpus=0 or num_gpus=None (default). To enable this behavior and turn off this error message, set RAY_ACCEL_ENV_VAR_OVERRIDE_ON_ZERO=0
```

After this pr:
```
2025-08-20 19:08:41,923 INFO worker.py:1939 -- Started a local Ray instance. View the dashboard at http://127.0.0.1:8265
/sgl-workspace/ray/python/ray/_private/worker.py:1987: FutureWarning: Tip: In future versions of Ray, Ray will no longer override accelerator visible devices env var if num_gpus=0 or num_gpus=None (default). To enable this behavior and turn off this error message, set RAY_ACCEL_ENV_VAR_OVERRIDE_ON_ZERO=0
  warnings.warn(
```

ray-project#54928

Signed-off-by: jugalshah291 <[email protected]>
dstrodtman pushed a commit that referenced this pull request Oct 6, 2025
…ng (#55791)

Before this pr:
```
python /ray-workspace/temp.py
2025-08-18 18:26:21,621 INFO worker.py:1943 -- Started a local Ray instance. View the dashboard at http://127.0.0.1:8265
2025-08-18 18:26:53,873 WARNING worker.py:1991 -- Tip: In future versions of Ray, Ray will no longer override accelerator visible devices env var if num_gpus=0 or num_gpus=None (default). To enable this behavior and turn off this error message, set RAY_ACCEL_ENV_VAR_OVERRIDE_ON_ZERO=0
```

After this pr:
```
2025-08-20 19:08:41,923 INFO worker.py:1939 -- Started a local Ray instance. View the dashboard at http://127.0.0.1:8265
/sgl-workspace/ray/python/ray/_private/worker.py:1987: FutureWarning: Tip: In future versions of Ray, Ray will no longer override accelerator visible devices env var if num_gpus=0 or num_gpus=None (default). To enable this behavior and turn off this error message, set RAY_ACCEL_ENV_VAR_OVERRIDE_ON_ZERO=0
  warnings.warn(
```

#54928

Signed-off-by: Douglas Strodtman <[email protected]>
landscapepainter pushed a commit to landscapepainter/ray that referenced this pull request Nov 17, 2025
…ng (ray-project#55791)

Before this pr:
```
python /ray-workspace/temp.py
2025-08-18 18:26:21,621 INFO worker.py:1943 -- Started a local Ray instance. View the dashboard at http://127.0.0.1:8265 
2025-08-18 18:26:53,873 WARNING worker.py:1991 -- Tip: In future versions of Ray, Ray will no longer override accelerator visible devices env var if num_gpus=0 or num_gpus=None (default). To enable this behavior and turn off this error message, set RAY_ACCEL_ENV_VAR_OVERRIDE_ON_ZERO=0
```

After this pr:
```
2025-08-20 19:08:41,923 INFO worker.py:1939 -- Started a local Ray instance. View the dashboard at http://127.0.0.1:8265 
/sgl-workspace/ray/python/ray/_private/worker.py:1987: FutureWarning: Tip: In future versions of Ray, Ray will no longer override accelerator visible devices env var if num_gpus=0 or num_gpus=None (default). To enable this behavior and turn off this error message, set RAY_ACCEL_ENV_VAR_OVERRIDE_ON_ZERO=0
  warnings.warn(
```

ray-project#54928
elliot-barn pushed a commit that referenced this pull request Oct 13, 2026
…n that runs only the changed files' tests (#66806)

## Description

Doc-side edits no longer start a library's docs example tests. A new
`docs-example-test` label opts a PR back in, and it runs **only the
tests that name a changed doc file directly**. It never falls back to a
library's whole docs example suite and never runs GPU tests. This
replaces the `docs-go` label, which skipped the same steps by request
and needed a scope guard to stay safe.

### What changes by default

Doc assets under `doc/source/` (`.py`, `.ipynb`, `.yaml`) and
`doc/external/` stop emitting `<lib>_doc`. They now emit a new
`doc_example` tag, and only the label-gated opt-in step listens for it.
Coverage for everything else is unchanged:

| Change | Before | After, no label |
| --- | --- | --- |
| Library code, such as `python/ray/data/` | The library's suites,
including its docs example steps | Unchanged |
| `doc/BUILD.bazel`, example `BUILD.bazel` files | The owning library's
docs example steps | Unchanged, because they define test targets |
| `doc/test_myst_doc.py` (shared notebook runner) | `core: docs example
tests` | Unchanged |
| Data `doc_code/*.py` | All three Data docs example steps, including
GPU | No tests |
| LLM notebook under `doc/source/llm/` | Four llm suites, `llm:
wheel-aarch64 tests`, both API checks | No tests |
| Prose and images | No tests | No tests |

Postmerge still runs every docs example suite in each library's own
image.

`doc/source/llm/` and `doc/source/data/doc_code/working-with-llms/` move
off the raw `llm` tag. Every LLM doc example test is tagged `gpu`, so
these paths route to nothing rather than starting the llm library
suites.

### The opt-in

With the `docs-example-test` label, the new `doc: docs example tests
(opt-in)` step in `others.rayci.yml` does the following:

1. Runs `//ci/ray_ci/doc:cmd_doc_example_targets`, which diffs the PR
against its base branch and maps each changed file under `doc/source/`
or `doc/external/` to the Bazel test targets that reference it directly.
A target matches when it names the file in `srcs` or `data`, or, for a
notebook test, as the file in its `--path` argument. A file that a test
reaches only through a filegroup doesn't count.
1. Reports in the step log, instead of running, any GPU target and any
library-wide `doctest()` target that takes every prose file of a
library. Only Ray Data has per-file prose targets today
(`doctest_each`), so Data prose is the only prose the opt-in can test
file by file. Data `.md` and `.rst` therefore route to `doc_example`
too.
1. Runs the selected targets once per team, all in the existing
`doctestbuild` image. That's a single Python 3.10 environment whose
dependency set covers core, data, train, tune, rllib, and Serve. It
doesn't use each library's own per-version images.

**The opt-in runs on premerge only, by design.** Apply both
`docs-example-test` and `go`. Microcheck selects steps from an
allow-list of step IDs: the steps where its high-impact and changed
tests last ran, according to the test database. The pipeline settings
set that list through `RAYCI_SELECT`, and a new step with no test
history never appears on it. A smoke test confirmed this in microcheck
build
[#55791](https://buildkite.com/ray-project/microcheck/builds/55791).
With the label on and five doc files changed, rayci selected
`doc_example`, but microcheck ran lint only. That's the intended
outcome: microcheck on a docs PR stays light, and the focused tests run
when the PR goes to premerge.

`tester.py` gains `--exact-targets`, which stops microcheck-style
narrowing of an explicit target list to high-impact and srcs-changed
tests. Premerge doesn't narrow, so the flag matters only if microcheck
ever runs this step. Without it, microcheck would silently drop notebook
and prose targets, because they aren't `srcs`.

To preview what the label would run:

```bash
bazel run //ci/ray_ci/doc:cmd_doc_example_targets -- doc/source/data/doc_code/key_concepts.py
```

### Retiring `docs-go`

This PR removes the label's `if:` guards from 12 steps, the `lint:
validate docs-go scope` step, and `ci/lint/validate_docs_go_scope.sh`.
Open PRs that carry the label keep working, since skipping is now the
default. The contributor docs (`ci.md`, `writing-code-snippets.md`,
`doc/AGENTS.md`) are updated in this PR. That includes correcting the
`ci.md` claim that prose can't change tested code. Prose can carry
doctests.

### Known cost

rayci evaluates tags, not labels. A gated step that tags select still
pulls its `depends_on` image builds into the build, even when Buildkite
then drops the step. So an unlabeled PR that edits a doc asset or Data
prose emits five cached Python 3.10 image jobs (`oss-ci-base_test`,
`oss-ci-base_build`, `doctestbuild`, `ray-core-build`,
`ray-dashboard-build`) and runs no tests. For a Data `doc_code` edit
that's 10 jobs in total, down from 24. A follow-up rayci change, which
drops label-gated steps before dependency marking, would make the
unlabeled cost zero.

## Related issues

Related to #64553, which introduced `docs-go`.

## Additional information

**Not a duplicate.** I searched open PRs for `docs-go`,
`docs-example-test`, and doc example test routing, and found none that
change this behavior.

**Tests run, all passing:**

- `bazel test //ci/ray_ci/doc:test_doc_example_targets
//ci/ray_ci:test_tester //ci/pipeline/...`
- `rayci test-rules`, built from rayci v0.48.0, the version
`.rayciversion` pins. It covers all 182 expectations in
`.buildkite/test.rules.test.txt`, which this PR updates. I confirmed it
fails on a planted wrong expectation.
- The selector against the real `bazel query 'tests(//doc/...)'` output
(281 targets), one file per kind:
- A Data `doc_code` file and `data/working-with-tensors.md` each map to
their own target.
  - A notebook maps by `--path`.
  - A Serve page reports its library-wide `doctest[serve]` target.
  - An LLM notebook reports as GPU-only.
  - The shared notebook runner is ignored.
- `ci/ray_ci/doc/run_doc_example_tests.sh` with a stubbed `bazel`, to
check the per-team grouping and that a failure exit code propagates.
Also run with no changed files, to check it exits 0 without starting a
container.
- `rayci` pipeline generation for simulated PR builds, old base against
this branch, for the cases in the table above.

Not yet run: the opt-in step itself on Buildkite. Whether every
library's selected doc tests pass in `doctestbuild` gets proven on the
first labeled PR.

**AI assistance:** I wrote this PR with Claude Code (Claude Opus 5.5)
and reviewed the changes myself.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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