Skip to content

[doc][core] Remove Ray Core doc scripts no page shows - #66966

Merged
dstrodtman merged 1 commit into
masterfrom
doc-1816-core-orphan-doc-code
Oct 13, 2026
Merged

dstrodtman merged 1 commit into
masterfrom
doc-1816-core-orphan-doc-code

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

Why are these changes needed?

Some files under doc/source/core/ aren't shown on any docs page, and nothing else in the repo references them. Docs example code should either appear on a page, be a test wrapper for content that does, or be deleted. This PR applies that rule to Ray Core:

File Status before Change
doc_code/original_resource_unavailable_example.py Run by the source/core/doc_code/*.py catch-all in doc/BUILD.bazel. #24544 added it as a literalinclude on the placement group page, and a later rewrite of that page dropped the include. It demonstrates scheduling a task into a placement group's reserved CPUs, not a regression check, so it isn't worth moving into python/ray/tests/. Deleted
examples/lm/ (ray_train.py, ray_train.sh, preprocess.sh, lm-cluster.yaml) Not tested. Referenced only by each other. Pins fairseq==0.8.0 and is what's left of a removed fairseq language-model example. Its only recent edits are repo-wide sweeps such as the IPv6 work in #55281, #56147, and #58304. Deleted
examples/rdt/grpo_contextual_bandits.py Not tested. No page includes it. #57961 added it as the companion script for the Ray Direct Transport blog post, which links to it by commit permalink (blob/c4f0c24.../doc/source/ray-core/examples/rdt/...), so the blog link keeps working after this deletion. Deleted

The catch-all's exclude list doesn't change. Deleting original_resource_unavailable_example.py only removes the one test target the glob generated for it.

Questions for Ray Core maintainers

Please confirm or push back per file:

  • original_resource_unavailable_example.py: if you'd rather keep this behavior under test, I can move it to python/ray/tests/ instead of deleting it.
  • examples/rdt/grpo_contextual_bandits.py: was a docs page planned for it? If so, I can keep the script and add a page with a literalinclude and a test instead. If the RDT team wants it kept as a standalone example, say where it should live.

Related issue number

None. I searched open PRs for each filename and found no overlap.

Checks

  • I've signed off every commit (DCO).
  • pre-commit run --files <changed files>: passed, including the master-link check.
  • git grep for examples/lm, examples/rdt, original_resource_unavailable, and grpo_contextual: no remaining references.
  • I didn't run a local Sphinx build. No page referenced these files.

AI assistance (Claude Code) was used to prepare this PR. I reviewed every changed line.

🤖 Generated with Claude Code

Delete three groups of files under doc/source/core/ that no docs page
includes and nothing else references:

- doc_code/original_resource_unavailable_example.py
- examples/lm/ (fairseq language-model example scripts)
- examples/rdt/grpo_contextual_bandits.py

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman
dstrodtman requested review from a team as code owners October 13, 2026 18:26

@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 removes several files, including Ray cluster configurations, dataset preprocessing scripts, a fault-tolerant training script for fairseq, and a reinforcement learning example utilizing GPU-to-GPU Ray Direct Transport and the GRPO algorithm. As there are no review comments, no feedback is provided.

@dstrodtman dstrodtman added the go add ONLY when ready to merge, run all tests label Oct 13, 2026
@ray-gardener ray-gardener Bot added docs An issue or change related to documentation core Issues that should be addressed in Ray Core labels Oct 13, 2026
dstrodtman added a commit that referenced this pull request Oct 13, 2026
…ta-loading page's testcode (#66967)

## Why are these changes needed?

`doc/source/train/doc_code/data_ingest_torch_new.py` copies code that
`train/user-guides/data-loading-preprocessing.md` already shows inline
as `testcode`. No page `literalinclude`s the script, but the
`train/doc_code/*.py` glob in `doc/BUILD.bazel` still runs it. So the
same examples live in two places and get tested twice, and the two
copies have drifted. A fix to the page doesn't reach the script, and a
fix to the script doesn't reach the page.

This PR deletes the script. Before deleting it, I compared each of its
marked sections with the page:

- `__basic__`: The page's quickstart and the cache block cover reading
Iris, `normalize_length`, `map_batches`, and passing `datasets=` to
`TorchTrainer`. The script's other extras, a commented-out
`randomize_block_order` and `local_shuffle_buffer_size`, are covered by
the page's links to the Ray Data shuffling guide.
- `__custom_split__`: The page's "Split datasets" block is a superset.
It splits only `train` with `datasets_to_split` and calls `fit()`. The
script built the trainer but never ran it.
- `__materialized__`: The page's "Cache the preprocessed dataset" block
is a superset of this section.
- `__custom__`: Matches the page's "Advanced: Full customization" block
line for line, except that the page reads a different dataset.
- `__options__`: `DataConfig.default_ingest_options()` with an
`object_store_memory` override passed as `execution_options`. No page
shows this snippet. It only built a trainer and asserted nothing.
`DataConfig(execution_options=...)` is covered by the unit tests in
`python/ray/train/v2/tests/test_data_config.py`, and the Ray Data
performance tips page documents `resource_limits`. So I dropped it
rather than moving it onto the page.

The page needs no changes, and neither does `doc/BUILD.bazel`. The glob
picks the script up implicitly, so deleting the file removes its test
target. `git grep data_ingest_torch_new` returns nothing after this
change.

Reviewers: Is dropping the `__options__` snippet right, or should the
Train data-loading page document per-trainer ingest resource limits?

## Duplicate check

`gh pr list --state all --search data_ingest_torch_new` returns no PRs.
This is one in a series of PRs that remove doc code no page shows,
alongside #66966 (Core), #66965 (RLlib), and #66964 (Serve). None of
them touch Train.

## Testing

- `git grep data_ingest_torch_new` shows no remaining references in
`.buildkite`, BUILD files, CODEOWNERS, or docs.
- The pre-commit hooks pass on the commit.
- The page's own `doctest[train-gpu]` target still runs the blocks that
replace the script. This PR doesn't change them.

This PR was prepared with AI assistance (Claude Code). I reviewed every
changed line.

🤖 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]>
@dstrodtman
dstrodtman merged commit 6cf769c into master Oct 13, 2026
6 checks passed
@dstrodtman
dstrodtman deleted the doc-1816-core-orphan-doc-code branch October 13, 2026 19:45
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 docs An issue or change related to documentation 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