Repository navigation
[doc] Style pass on Ray Data operation guides - #66420
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors and improves the Ray Data documentation across several guides, focusing on clarity, formatting, and updated cross-references. The reviewer provided valuable feedback to address technical inaccuracies and inconsistencies, such as updating deprecated examples for push-based shuffle, removing deprecated parameters from tuning recommendations, resolving contradictions regarding batch composition and shuffle performance ordering, correcting node terminology for to_pandas(), and clarifying conditions for aggregator allocation and shuffle terminology.
|
|
||
| :::{note} | ||
| `DataContext.use_push_based_shuffle` and the `RAY_DATA_PUSH_BASED_SHUFFLE` environment variable are deprecated. Configure the shuffle strategy through `DataContext.shuffle_strategy` (for example, `ShuffleStrategy.SORT_SHUFFLE_PUSH_BASED`) instead. | ||
| `DataContext.use_push_based_shuffle` and the `RAY_DATA_PUSH_BASED_SHUFFLE` environment variable are deprecated. Instead, set `DataContext.shuffle_strategy` to a strategy such as `ShuffleStrategy.SORT_SHUFFLE_PUSH_BASED`. |
There was a problem hiding this comment.
The note states that DataContext.use_push_based_shuffle and RAY_DATA_PUSH_BASED_SHUFFLE are deprecated, but the subsequent examples in this section still instruct the user to set RAY_DATA_PUSH_BASED_SHUFFLE=1 and use DataContext.use_push_based_shuffle. To avoid confusing users, the examples and instructions below should be updated to use the recommended DataContext.shuffle_strategy configuration instead of the deprecated options.
There was a problem hiding this comment.
Kept as written in this PR, which is a prose style pass that preserves each claim. I've listed this under "Questions for reviewers" in the PR description for a Ray Data maintainer to decide.
| Joins are generally memory-intensive and require accurate memory accounting and projection, so they're sensitive to skew and imbalance in the dataset. | ||
|
|
||
| Internally, joins use a hash-shuffle backend, and each hash partition is joined with Polars. Joins use {ref}`shuffle v2 <shuffle-v2>` (`ShuffleStrategy.SHUFFLE_V2`) by default. See {ref}`Tuning shuffle v2 <tuning-shuffle-v2>` for the memory-related settings. To fall back to the previous {ref}`hash-shuffle implementation <hash-shuffle>`, set the shuffle strategy before creating a `Dataset`: `ray.data.DataContext.get_current().shuffle_strategy = ShuffleStrategy.HASH_SHUFFLE`. | ||
| Tune join performance for your workload with the following two parameters: |
There was a problem hiding this comment.
The text states 'Tune join performance for your workload with the following two parameters:', but partition_size_hint is deprecated and ignored by Ray Data. It is misleading to present it as a parameter for tuning performance. Consider rephrasing this to focus on num_partitions as the primary parameter for tuning join performance.
| Tune join performance for your workload with the following two parameters: | |
| Tune join performance for your workload with the `num_partitions` parameter: |
There was a problem hiding this comment.
Kept as written in this PR, which is a prose style pass that preserves each claim. I've listed this under "Questions for reviewers" in the PR description for a Ray Data maintainer to decide.
| ### Add a shuffle for random mixing | ||
|
|
||
| The per-batch ratio quality of per-block mixing depends on two things: the sizes of the input blocks (covered in the preceding section) and the number of training workers contributing to each global batch. A global batch aggregates `num_workers * grad_accum_steps` local batches, each drawn from a single dataset, so the more local batches you have per global batch, the closer the ratio holds to the target. | ||
| Two factors determine how closely each batch matches the target ratio under per-block mixing. The first is the size of the input blocks, which the preceding section covers. The second is the number of training workers that contribute to each global batch. A global batch aggregates `num_workers * grad_accum_steps` local batches, each drawn from a single dataset. The more local batches each global batch contains, the closer its ratio stays to the target. |
There was a problem hiding this comment.
There is a contradiction between this statement ('each drawn from a single dataset') and the note on line 66 ('each local batch might contain data from one or more of the input datasets, depending on how block sizes compare to batch sizes'). Consider clarifying this sentence to align with the fact that a local batch can span multiple blocks and thus contain data from multiple datasets.
| Two factors determine how closely each batch matches the target ratio under per-block mixing. The first is the size of the input blocks, which the preceding section covers. The second is the number of training workers that contribute to each global batch. A global batch aggregates `num_workers * grad_accum_steps` local batches, each drawn from a single dataset. The more local batches each global batch contains, the closer its ratio stays to the target. | |
| Two factors determine how closely each batch matches the target ratio under per-block mixing. The first is the size of the input blocks, which the preceding section covers. The second is the number of training workers that contribute to each global batch. A global batch aggregates `num_workers * grad_accum_steps` local batches. The more local batches each global batch contains, the closer its ratio stays to the target. |
There was a problem hiding this comment.
Kept as written in this PR, which is a prose style pass that preserves each claim. I've listed this under "Questions for reviewers" in the PR description for a Ray Data maintainer to decide.
|
|
||
| 1. Setting `DataContext.max_hash_shuffle_aggregators` caps the number of aggregators. | ||
| 2. Setting it to `max_hash_shuffle_aggregators >= num_partitions` allocates one partition per aggregator. | ||
| To cap the number of aggregators, set `DataContext.max_hash_shuffle_aggregators`. Setting `max_hash_shuffle_aggregators >= num_partitions` allocates one partition per aggregator. |
There was a problem hiding this comment.
The statement 'Setting max_hash_shuffle_aggregators >= num_partitions allocates one partition per aggregator' is incomplete. Since the number of aggregators is the minimum of num_partitions, the cluster CPU count, and max_hash_shuffle_aggregators, one partition per aggregator is only allocated if the cluster also has at least num_partitions CPUs. Consider clarifying this condition.
| To cap the number of aggregators, set `DataContext.max_hash_shuffle_aggregators`. Setting `max_hash_shuffle_aggregators >= num_partitions` allocates one partition per aggregator. | |
| To cap the number of aggregators, set `DataContext.max_hash_shuffle_aggregators`. Setting `max_hash_shuffle_aggregators >= num_partitions` allocates one partition per aggregator, provided the cluster has at least `num_partitions` CPUs. |
There was a problem hiding this comment.
Kept as written in this PR, which is a prose style pass that preserves each claim. I've listed this under "Questions for reviewers" in the PR description for a Ray Data maintainer to decide.
|
|
||
| ### Convert datasets to pandas | ||
|
|
||
| To convert a {class}`~ray.data.dataset.Dataset` to a pandas DataFrame, call {meth}`Dataset.to_pandas() <ray.data.Dataset.to_pandas>`. Your data must fit in memory on the head node. |
There was a problem hiding this comment.
The text states 'Your data must fit in memory on the head node.' However, to_pandas() collects the dataset to the driver process, which may run on a client machine or a worker node rather than the head node. Consider changing 'head node' to 'driver node' or 'the node running the driver process' for technical accuracy.
| To convert a {class}`~ray.data.dataset.Dataset` to a pandas DataFrame, call {meth}`Dataset.to_pandas() <ray.data.Dataset.to_pandas>`. Your data must fit in memory on the head node. | |
| To convert a {class}`~ray.data.dataset.Dataset` to a pandas DataFrame, call {meth}`Dataset.to_pandas() <ray.data.Dataset.to_pandas>`. Your data must fit in memory on the driver node. |
There was a problem hiding this comment.
Kept as written in this PR, which is a prose style pass that preserves each claim. I've listed this under "Questions for reviewers" in the PR description for a Ray Data maintainer to decide.
| Ray Data provides several different options for shuffling data, trading off the granularity of shuffle control with memory consumption and runtime. The list below presents options in increasing order of resource consumption and runtime. Choose the most appropriate method for your use case. | ||
| ## Choose a shuffling method | ||
|
|
||
| Ray Data provides several options for shuffling data. Each option trades off the granularity of shuffle control against memory consumption and runtime. The following sections present the options in increasing order of resource consumption and runtime. Choose the method that fits your use case. |
There was a problem hiding this comment.
The text states that the options are presented 'in increasing order of resource consumption and runtime'. However, the benchmark in the 'How does local buffer shuffle compare to map_batches shuffle?' section shows that map_batches shuffle (presented third) has significantly higher throughput (95%) and thus lower runtime than local buffer shuffle (presented second, with 40% throughput). Consider rephrasing or reordering the sections to resolve this discrepancy.
| Ray Data provides several options for shuffling data. Each option trades off the granularity of shuffle control against memory consumption and runtime. The following sections present the options in increasing order of resource consumption and runtime. Choose the method that fits your use case. | |
| Ray Data provides several options for shuffling data. Each option trades off the granularity of shuffle control against memory consumption and runtime. The following sections present these options. Choose the method that fits your use case. |
There was a problem hiding this comment.
Kept as written in this PR, which is a prose style pass that preserves each claim. I've listed this under "Questions for reviewers" in the PR description for a Ray Data maintainer to decide.
| 1. *Random shuffling*: invoking {meth}`~ray.data.Dataset.random_shuffle` essentially permutes and shuffles individual rows from existing blocks into the new ones using an optionally provided seed. | ||
| 2. (**New in 2.46**) *Key-based repartitioning*: invoking {meth}`~ray.data.Dataset.repartition` with `keys` parameter triggers {ref}`hash-shuffle <hash-shuffle>` operation, shuffling the rows based on the hash of the values in the provided key columns, providing deterministic way of co-locating rows based on the hash of the column values. | ||
| - **Random shuffling**: Call {meth}`~ray.data.Dataset.random_shuffle` to shuffle individual rows from the existing blocks into new blocks. You can optionally provide a seed. | ||
| - **Key-based repartitioning**: Call {meth}`~ray.data.Dataset.repartition` with the `keys` parameter to trigger a {ref}`hash-shuffle <hash-shuffle>` operation. This operation shuffles the rows based on the hash of the values in the key columns you provide, which co-locates rows deterministically. Ray 2.46 introduced this option. |
There was a problem hiding this comment.
The term 'hash-shuffle' is used here to describe the general key-based repartitioning operation, but the tip below refers to 'hash-shuffle' as the previous/legacy implementation (as opposed to the default 'shuffle v2'). To avoid confusion, consider using a more general term like 'hash-partitioning' or 'key-based shuffle' when describing the general operation, reserving 'hash-shuffle' (or HASH_SHUFFLE) for the legacy implementation.
| - **Key-based repartitioning**: Call {meth}`~ray.data.Dataset.repartition` with the `keys` parameter to trigger a {ref}`hash-shuffle <hash-shuffle>` operation. This operation shuffles the rows based on the hash of the values in the key columns you provide, which co-locates rows deterministically. Ray 2.46 introduced this option. | |
| - **Key-based repartitioning**: Call {meth}`~ray.data.Dataset.repartition` with the `keys` parameter to trigger a key-based partitioning operation. This operation shuffles the rows based on the hash of the values in the key columns you provide, which co-locates rows deterministically. Ray 2.46 introduced this option. |
There was a problem hiding this comment.
Kept as written in this PR, which is a prose style pass that preserves each claim. I've listed this under "Questions for reviewers" in the PR description for a Ray Data maintainer to decide.
dstrodtman
left a comment
There was a problem hiding this comment.
Meaning-diff review of this style pass: a check of whether any edit changed what the text asserts, not just how it reads.
- 22 of 171 changed blocks are cosmetic, such as casing, punctuation, list markers, old-slug labels, and "such as" for "like". A deliberately conservative filter kept every rewording for review.
- 146 of the remaining 149 kept their meaning. Reviewers checked each against the pre-edit text and, where a claim touched behavior, the Ray source. They confirmed the new actors ("Ray Data persists...", "Ray Data creates..."), the 2.46 version for key-based repartitioning, and the stopping-condition default.
- 2 drifted and are fixed in 127cda2. The mixing page's skewed-weights limitation had lost its signal that the limitation is temporary. The joins page had lost "previous" for the hash-shuffle implementation.
- 1 changed a claim on purpose. The Mars tab now says "to" a Mars DataFrame, which matches
Dataset.to_mars(). There's an inline comment on it.
The other two inline comments are questions about claims that predate this PR. The source doesn't back them as written.
This review was made with AI assistance (Claude Code).
| :::{tab-item} Mars | ||
|
|
||
| To convert a {class}`~ray.data.dataset.Dataset` from a Mars DataFrame, call {meth}`Dataset.to_mars() <ray.data.Dataset.to_mars>`. | ||
| To convert a {class}`~ray.data.dataset.Dataset` to a Mars DataFrame, call {meth}`Dataset.to_mars() <ray.data.Dataset.to_mars>`. |
There was a problem hiding this comment.
Factual correction, not just style. Please confirm. The old text said "convert a Dataset from a Mars DataFrame" for Dataset.to_mars(). The to_mars docstring in python/ray/data/dataset.py reads "Convert this Dataset into a Mars DataFrame", and the sibling Daft, Dask, Spark, and Modin tabs all say "to".
| During execution, Ray Data calculates statistics for each operator, such as wall-clock time and memory usage. | ||
|
|
||
| To view stats about your {class}`Datasets <ray.data.Dataset>`, call {meth}`Dataset.stats() <ray.data.Dataset.stats>` on an executed dataset. The stats are also persisted under `/tmp/ray/session_*/logs/ray-data/ray-data.log`. For more on how to read this output, see {ref}`Monitoring Your Workload with the Ray Data Dashboard <monitoring-your-workload>`. | ||
| To view the statistics for a {class}`Dataset <ray.data.Dataset>`, call {meth}`Dataset.stats() <ray.data.Dataset.stats>` on an executed dataset. Ray Data also persists the statistics to `/tmp/ray/session_*/logs/ray-data/ray-data.log`. To learn how to read this output, see {ref}`Monitoring your workload with the Ray Data dashboard <monitoring-your-workload>`. |
There was a problem hiding this comment.
Question (predates this PR): this says Ray Data persists the statistics to ray-data.log with no condition. In streaming_executor.py, the stats summary goes through logger.info only when self._data_context.enable_auto_log_stats is true, and DEFAULT_AUTO_LOG_STATS = False in context.py. Unless another path writes them, the file doesn't get them by default. Should this sentence name the enable_auto_log_stats condition?
| ## Create custom aggregations | ||
|
|
||
| You can create custom aggregations by implementing the {class}`~ray.data.aggregate.AggregateFnV2` interface. The AggregateFnV2 interface has three key methods to implement: | ||
| To create a custom aggregation, implement the {class}`~ray.data.aggregate.AggregateFnV2` interface. The interface has three key methods that you implement: |
There was a problem hiding this comment.
Question (predates this PR): this says AggregateFnV2 has three key methods that you implement, and step 4 below describes finalize. In python/ray/data/aggregate.py, only combine and aggregate_block are @abc.abstractmethod. finalize has a default implementation, and the class docstring says "The finalize method can also be overridden" and calls finalization "Optionally". Should this say two required methods plus an optional finalize?
127cda2 to
ad9445b
Compare
ad9445b to
0d52b18
Compare
0d52b18 to
2129a8b
Compare
2129a8b to
545a45a
Compare
545a45a to
d04c7cf
Compare
d04c7cf to
3faf828
Compare
… for Ray Data docs (#66412) ## Why This PR collects the Vale configuration changes for the Ray Data docs into one review: - It prepares the Ray Data docs for a style and grammar pass. Vale can then flag real problems, such as future tense, without noise from valid terms it doesn't know. - It adds Vale rules to the shared `Ray` style for patterns that the Ray Data style pass fixed by hand, over and over, across the style-pass PRs stacked above this one. The rules were written after the style pass, so they sit lower in the stack than the work that motivated them. They touch the same Vale configuration for the same reason, so they're reviewed and landed together here. The rule changes were previously in #66424, now closed. Stacked on #66381, which is stacked on #66375 and #66352. Review and merge those first. This branch targets `doc-1524-data-prose-softwrap`. ## What ### Vocabulary and suppressions - Removes the two `<!-- vale off -->` / `<!-- vale on -->` blocks from `custom-datasource-example.md`. This was the only Ray Data page that disabled Vale. Both blocks suppressed the future-tense check, and the style pass should fix that prose rather than hide it. - Updates `.vale/styles/config/vocabularies/Data/accept.txt`: - Adds `BentoML`, `CIFAR`, `[Dd]ownscal(e|es|ed|ing)`, `JPEG`, `Kinetica`, `NVTabular`, `Petastorm`, `Psycopg`, `PyArrow`, `Tekken`, `torchtext`, and `torchvision`. - Changes `Datasinks?` to `[Dd]atasinks?` so lowercase "datasink" is accepted, matching `[Dd]atasource(s)?`. - Removes entries that duplicate other vocabularies: `docstrings`, `NLP`, `PIL`, and `TPU(s)?` are in General, and `XGBoost` is in Train. - Removes entries that don't appear in the prose of any `.md` or `.rst` page under `doc/source/`: `assess_quality`, `process_file`, `[Mm]ultiget(s)?`, `PDFs`, `Predibase('s)?`, `[Rr]eformat(s)?`, and `[Pp]ostprocessor(s)?`. - Renames the `ABS` tab to `Azure Blob Storage` in `loading-data.md` and `saving-data.md`, because the acronym isn't widely known. The remaining spelling and terms alerts are intentional. They point at text the style pass fixes: `Bento ML`, `Sagemaker`, `Numpy`, `pyarrow`, `underly`, `undersaturated`, and the unformatted `map_batches` and `smart_resize` identifiers. ### New rules These are rule files only. The `Ray` style is still registered for RLlib pages only, in `.vale.ini`, and nothing changes what Vale runs in CI. Vale on the Ray Data docs is disabled on purpose for now. | Rule | Type | Catches | Why this type | |---|---|---|---| | `Ray.SuchAs` | existence, warning | "like" after a plural noun that introduces examples, such as "formats like", "methods like", and "APIs like" | "like" is also a comparison ("works like a queue") and a verb ("if you'd like"), so a substitution would corrupt that prose. The rule only flags, and only after these nouns. | | `Ray.Brands` | substitution, case-sensitive | `HuggingFace` becomes `Hugging Face` | The literal has no other sense. The match is case-sensitive so lowercase identifiers such as `huggingface_hub` never match, and inline code is skipped anyway. | | `Ray.Capitalization` | existence, case-sensitive | `Ray Tasks`, `Ray Actors`, `Ray Objects`, `Ray Workers`, `Ray Nodes`, `Ray Placement Groups` | The style guide lowercases generic nouns that name a Ray concept. Flag only, because link text that quotes a page title can keep the title's capitals. | | `Ray.LeadIns` | existence, warning | `For example:`, `For instance:`, and `Here's an example` fragments used as lead-ins | The guide wants complete-sentence lead-ins. The right rewrite depends on the example, so the rule only flags. | | `Ray.Filler` additions | existence | "under the hood", "seamlessly" | Both came up repeatedly in the pass. | Each rule links to the matching section of `writing-style.md`. Left out on purpose: - **Slashes between words:** `I/O`, `TCP/IP`, and `and/or` are legitimate, and a pattern can't tell them apart. - **Gerund task headings:** some gerund H1s, such as "Loading data", are kept on purpose to match the nav titles. - **"Ray Cluster" in `Ray.Capitalization`:** it appears mostly in page and section titles ("Ray Clusters Overview") and in the "Ray Cluster Launcher" component name. - **"Pandas" to "pandas":** a case-sensitive swap misfires at the start of a sentence. ## Verification Vocabulary: `vale doc/source/data` with Vale 3.12: `Vale.Spelling` drops from 26 to 10 alerts, `Google.Acronyms` from 4 to 0, and the remaining `Vale.Spelling` and `Vale.Terms` alerts are all in the list above. `custom-datasource-example.md` now reports its three `Google.Will` alerts. Rules: - A test file with positive and negative cases, run with the real vocabularies loaded, so accept-list shadowing would show up. That check caught the `APIs` accept-list entry shadowing `Ray.SuchAs`, so the rule sets `vocab: false`. Every positive case fires. None of these fire: - "works like a queue" and "if you'd like" - `huggingface_hub` in inline code - "Ray Tasks" as `{ref}` link text - lowercase "Ray tasks" - The full `Ray` style, run by hand against all 25 top-level `doc/source/data/*.md` pages at the head of the style-pass stack, reports five warnings and none from the new rules: - "For now" in `mixing-data.md` and "Currently" in `performance-tips.md` are temporary-limitation signals that the stack keeps on purpose. - "seamlessly" in `comparisons.md` and "very" twice in `shuffling-data.md` were filler that the pass missed. They're now fixed in #66413 and #66420, the style PRs for those pages. - That run was at the head of the style-pass stack, not at this branch. Running the `Ray` style by hand against the Data pages here might report matches that the stack above fixes. That doesn't affect CI, since the `Ray` style isn't registered for Data pages. The Vale pre-commit hook is still commented out, so this doesn't change CI. ## AI assistance I made these changes with AI assistance (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
3faf828 to
77ed29c
Compare
487623d to
354c5b8
Compare
354c5b8 to
041826a
Compare
…ervability pages to MyST (#66461) ## Why are these changes needed? Converts the last non-API-reference RST pages under `ray-core/`, `data/`, and `rllib/` to MyST Markdown, plus the `train/` and `ray-observability/` pages that `doc/BUILD.bazel` names by path. The API reference trees (`*/api/`, `rllib/package_ref/`, and `ray-core/compiled-graph/compiled-graph-api`) stay RST for now. Each page gets its own commit, so you can review one file at a time. Every commit renames the page's literal `.rst` paths in `doc/BUILD.bazel` to `.md`. These paths are in `exclude` lists and in the explicit `files` lists of `doctest[data-gpu]` and `doctest[train-gpu]`, and they don't glob. Without the edit, an excluded page would silently join its target once it's `.md`, and an included page would silently drop out of it. Conversions are format-only: labels, headings, and prose are unchanged. A final whitespace-only commit soft-wraps the prose. `ray-soft-wrap`'s `verify.py` confirms non-whitespace bytes, rendered HTML, and idempotence for all 11 files. ### `rllib/getting-started`: doctest target removed The first commit deletes `doctest[rllib2]`, the only target over `rllib/getting-started.rst`, before the page converts. The target is tagged `manual` with a hang TODO, so no premerge or postmerge step has run it, and nothing else references it (`git grep rllib2` is empty). Its 15 `testcode` blocks had no `testoutput`, so they asserted nothing. The 12 visible blocks become display-only `python` code blocks. The three `:hide:` blocks held `.stop()` cleanups that never rendered, so they're deleted. `doctest[rllib]` still excludes the page. If these examples should be validated later, a `doc_code/` script is the better route than reviving the hanging target. cc @elliot-barn, who owns the TODO. This commit isn't buildable on its own. It turns a `.. testcode::` that had no blank line before its body into a `.. code-block:: python`, still with no blank line, and docutils reads the body as extra arguments to the directive. The later conversion commit fixes it in the `.md`, and a squash merge never puts the intermediate commit on master. ### Doctest coverage Docs-only PRs don't run doctests premerge. This PR edits `doc/BUILD.bazel`, so every library's docs example step runs, but premerge can't show the conversion kept the same blocks. For that, I parsed each `.md` and the `.rst` it replaced with Ray's `pytest-sphinx` fork, the same parser the doctest macro runs, and asserted identical sections (directive, body, `:options:`, `:skipif:`) and examples. | Page | BUILD role | Examples before → after | | --- | --- | --- | | `ray-core/handling-dependencies` | `doctest[core]` exclude | 17 → 17 | | `ray-core/tasks/nested-tasks` | `doctest[core]` exclude | 0 → 0 (`literalinclude` of a tested `doc_code/` file) | | `data/batch-inference` | `doctest_each` exclude, `doctest[data-gpu]` files | 7 → 7 | | `data/transforming-data` | `doctest_each` exclude, `doctest[data-gpu]` files | 24 → 24 | | `data/contributing/contributing` | `doctest_each` glob | 0 → 0 (toctree only) | | `rllib/getting-started` | `doctest[rllib]` exclude, `doctest[rllib2]` removed | 15 → 0, by the removal commit | | `ray-observability/user-guides/cli-sdk` | top-level exclude | 16 → 16 | | `ray-observability/user-guides/ray-tracing` | top-level exclude | 3 → 3 | | `train/horovod` | `doctest[train]` exclude | 2 → 2 | | `train/user-guides/data-loading-preprocessing` | `doctest[train]` exclude, `doctest[train-gpu]` files | 6 → 6 | | `train/user-guides/using-accelerators` | `doctest[train]` exclude, `doctest[train-gpu]` files | 10 → 10 | To show the check would catch a broken conversion, I mutated each page with examples three ways: dropping a `testcode` block, altering a line in one, and turning one into a four-backtick fence. The last renders fine but is never collected. The check failed on all 24 mutations. ### Rendering changes I ran `render_diff.py` on all 11 pages against `/en/master`. Six render identically: `nested-tasks`, `data/contributing/contributing`, `cli-sdk`, `ray-tracing`, `horovod`, and `using-accelerators`. Every difference on the other five is listed here. - `rllib/getting-started`: on master, one `.. testcode::` line had no blank line after it. docutils read the block's first six lines, the `best_result = results.get_best_result(...)` call, as the directive's argument and dropped them. So master shows code that uses `best_result` without showing where it comes from. The converted page renders all six lines. This is the one place the conversion deliberately doesn't reproduce master. - `rllib/getting-started`: the "Farama gymnasium" link now has `https://`. On master it's a relative link to `gymnasium.farama.org` that 404s. - `ray-core/handling-dependencies`: MyST drops the apostrophe when it slugifies the "can't import the packages" heading, so the section id changes. That heading had no label, so the page adds a target carrying the old docutils slug, and existing `#...-can-t-import-...` links still resolve. An auto-numbered span id, which nothing links to, also changes from `id4` to `id2`. - `data/batch-inference` and `train/user-guides/data-loading-preprocessing`: each renders an RST comment as an HTML comment, which readers never see. - `data/transforming-data`: the "When using" definition list's `<dl>` gains the unstyled `myst` class. The first preview diff also caught three regressions that the green build didn't. MyST's `replacements` extension turned two `(c)` list markers into `©` and an `etc..` into `etc…`. The anchor above had changed too. A follow-up commit fixes all three. A sweep of the 11 pages found no other text that extension rewrites. ### Dead `doc/BUILD.bazel` excludes A final commit drops four `exclude` entries that name files that have moved: two in `doctest[serve]` and two in the serve `doc_code` test. A glob exclude naming a missing file excludes nothing, so these had silently stopped applying. This doesn't change what any target runs. #66462 carries the same commit, along with a lint check that fails on this class of stale path, so the two PRs merge cleanly in either order. ### Open PRs that edit these files Each of these open PRs edits one of the converted `.rst` files, so each will need to move its change to the `.md`: #66279, #66191, #65956, #65933, and #65830 (`handling-dependencies`), #65693 (`cli-sdk`), and #66419, #66420, #66422, and #66423 (`data/batch-inference`, `train/user-guides/data-loading-preprocessing`). #66096, #64053, and #63881 also edit `doc/BUILD.bazel`, and only #66096 edits nearby lines. ## Related issue number None. No open PR converts these pages. I checked `gh pr list` for open PRs touching each file. ## Checks - [x] I've signed off every commit (`git commit -s`). - [x] Pre-commit hooks passed on every commit. - Doctest parity: `python3 doctest_parity.py <the 11 .md files>` with `pytest==7.4.4` and `pytest-sphinx @ git+https://github.com/ray-project/pytest-sphinx`. All OK, run again after the soft-wrap commit. - Static checks on every `.md`: fences balance, no leftover RST roles or directives, every label from the `.rst` is present, and directive counts match. - Read the Docs preview builds green under `fail_on_warning`, and the render diff against `/en/master` is in Rendering changes. The first build hit the known autosummary-import segfault and passed on rebuild. - Local doctest run: not done. The GPU targets need hardware, and the CPU targets run in this PR's premerge because of the `BUILD.bazel` change. AI assistance (Claude Code) was used for the conversion and the verification scripts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
041826a to
80d381f
Compare
Apply Ray's writing-style guide to the Ray Data saving, inspecting,
iterating, aggregating, joining, mixing, and shuffling pages: use
imperative task headings and question headings for concepts, with a label
for each old heading slug so existing URL fragments keep resolving; use
second person, active voice, and "such as"; remove dashes, parentheticals,
and filler; fix list structure and punctuation; and choose admonition
levels by the guide.
Fix four method references that lacked a {meth} role and rendered their
angle brackets literally, a "read function function" typo, and a Mars tab
that said "from" where it meant "to". Update link text on other pages and
in dataset.py docstrings that quotes the old headings.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Put back the signal that the skewed-weights mixing limitation is temporary, which the time-relative cleanup removed, and restore "previous" for the hash-shuffle join implementation, which is the only place the joins page says hash-shuffle predates shuffle v2. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
Drop "very" twice from the shuffling page, and import os in the partitioned-write example on the saving page so the block runs on its own. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
The docstring link-text updates need Ray Data code-owner review. They move to their own PR at the top of this stack so the docs-only pages can land on docs review alone. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
80d381f to
e1af872
Compare
## Description Style and grammar pass on six Ray Data modality guides against Ray's [writing-style guide](https://docs.ray.io/en/master/ray-contribute/writing-style.html): `working-with-images.md`, `working-with-text.md`, `working-with-tensors.md`, `working-with-pytorch.md`, `working-with-llms.md`, and `scaling-collation-functions.md`. Prose only, apart from one code fix: the PyTorch migration example now imports `transforms`, which it uses. No other code, testcode, literalinclude blocks, code comments, or URLs changed. Stacked on #66420. Review and merge that stack first. This branch targets `doc-1524-data-style-ops`. It's the fourth of five PRs that apply the same pass to the top-level Ray Data pages. ### All six pages - Rewords task headings as imperatives, such as "Read images" and "Scale to multiple GPUs", and conceptual headings as questions, such as "How does the processor pipeline work?". Each reworded heading keeps its old URL fragment through an explicit label named after the old slug. Headings that already had a matching label need no new one. One old fragment can't be kept: `working-with-llms#cross-node-parallelism`, because `serve/llm/user-guides/cross-node-parallelism.md` already defines that label name. Nothing in the repo links to it. Three more old fragments are dropped on purpose because their names are single words: `#embeddings`, `#classification`, and `#multimodality`. Sphinx labels are global, so a label with a generic name would claim it for the whole site and break the build of any later page that defines it. Those headings keep their existing specific labels, such as `embedding_models`. - Uses second person, active voice, present tense, and "such as" for examples. Recasts "lets", "allows", and "enables". - Removes em dashes, parentheticals, first-person plural, "will", and filler. - Fixes list lead-ins and punctuation, and uses `1.` for ordered lists. Opening lists of section links stay, because they're the pages' only links to their sections. - Keeps `{ref}` link text that quotes another page's title in that title's words, such as "Saving Data API". ### Page-specific changes - `working-with-llms.md`: Spells "Hugging Face" consistently in prose, defines "VLM" once, and turns five bold paragraph labels into lead-in sentences. Gives the real default for `max_tasks_in_flight_per_actor`: it resolves to `DataContext.max_tasks_in_flight_per_actor` or `2 * max_concurrent_batches`, which #63214 introduced in place of the fixed 16. Scopes the vLLM table's lead-in to recent releases, since the table doesn't cover every one. The "Known issue" admonition keeps its title and gains the `warning` class, because the issue raises an `ImportError`. It also moves a bold "Usage data collection" label into a `note`. - `working-with-pytorch.md`: Replaces the legacy "Ray Datasets" product name, recasts the migration section into imperatives, says `pin_memory` applies only when the collate function returns tensors, as its docstring does, and puts the `map` and `map_batches` tab titles in inline code. - `scaling-collation-functions.md`: Fixes the "improving better" typo, and turns the two bold table captions into `list-table` titles. Every number and instance type is unchanged. - `working-with-images.md` and `working-with-text.md`: Put the default column names `image` and `text` in inline code. - `working-with-tensors.md`: Changes the H1 from "Working with Tensors / NumPy" to "Working with tensors and NumPy". ### Other files - Updates link text in `train/user-guides/data-loading-preprocessing.rst` that quotes the old headings, and fixes its "Pytorch" casing. ## Questions for reviewers Apart from the `max_tasks_in_flight_per_actor` default, this pass kept the scope of every claim. These points need a Ray Data maintainer. Each one predates this PR. - **Example variable (`scaling-collation-functions.md`):** the "after" example reassigns `dataset` but passes `train_dataset` to the trainer. - **`torchaudio` (`working-with-pytorch.md`):** the transforms section names `torchaudio`, but it has no `torchaudio` example. - **Custom tokenizers (`working-with-llms.md`):** are `mistral`, `deepseek_v32`, and `grok2` `tokenizer_mode` values? If so, the sentence can name them that way instead of in parentheses. The page says "DeepSeek-V3", but the example file's docstring says "DeepSeek-V3.2". - **`batch_size="auto"` (`working-with-tensors.md`):** the page recommends `batch_size="auto"` but doesn't say that `map_batches` requires an explicit integer `batch_size` when `num_gpus` is set (`dataset.py`). - **Note placement (`working-with-llms.md`):** the usage-data note sits under the NIXL troubleshooting heading. ## Verification - A follow-up commit applies source-verified fixes from automated review. It scopes the collate batch-alignment note to output blocks, because the example repartitions only after `map_batches`. It mentions the alpha `pin_memory` argument of `iter_torch_batches`, imports `transforms` in the PyTorch migration example, and describes what the tensors page covers instead of limitations it doesn't list. It also refers to the value of `max_concurrent_batches` rather than a batch size. - A meaning-diff review compared every before-and-after pair. A conservative filter cleared 37 blocks as cosmetic, and reviewers checked the remaining blocks against the pre-edit text and the Ray source. Two drifted and are fixed in a follow-up commit: a new lead-in implied that Ray Data LLM handles row, actor, and pipeline failures automatically, and the Office Hours item had lost "new". The reviewers confirmed the TP*PP gloss against `placement.py` and `vllm_engine_stage.py`, and that the Hugging Face processor, not Ray, resizes image inputs. - `vale` with Vale 3.12, run from the repo root: no warning- or error-level alerts on the six pages. - `codespell`: no hits. - The pre-commit hooks passed. - A structural check against each pre-edit file confirmed the code-fence count, role targets, and URLs are unchanged. The only anchor changes are the added old-slug labels. None were removed. - Before adding each label, I grepped `doc/source` for the label name in hyphen and underscore forms. The only collision is the `cross-node-parallelism` case above. ## AI assistance I made these edits with AI assistance (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
) ## Why are these changes needed? The Ray Data style pass (#66413, #66418, #66419, #66420, #66422, #66423) kept the scope of every technical claim. That round flagged statements that disagree with the current source, or with other statements on the same page. This PR fixes the ones the source settles. Each edit below names the source it follows and, where one exists, the PR that caused the drift. Ray Data reviewers: please confirm each item. LLM owners: please check the `working-with-llms.md` edits. ### Performance, monitoring, and configuration - `performance-tips.md`: The default object store limit is 0.5, not 1/4. `ResourceManager.DEFAULT_OBJECT_STORE_MEMORY_LIMIT_FRACTION` is 0.5 when the resource allocator is on, and `op_resource_reservation_enabled` defaults to `True`. Docs lag since #43171 (2.10). - `performance-tips.md`: `select_columns` after `read_parquet` prunes at read time. `ProjectionPushdown` is in `_LOGICAL_RULESET`, and `ParquetDatasource.supports_projection_pushdown` returns true. Docs lag since #56500 (2.50). The page now recommends the pattern its own example uses. - `performance-tips.md`: The "following procedure" lead-in introduced bullets that don't describe a procedure. It now introduces them as rules. - `monitoring-your-workload.md`: Dropped `RAY_DATA_TRACE_SCHEDULING`, which nothing under `python/` references anymore. It was removed in #44399 (2.11). - `monitoring-your-workload.md`: Dropped the `ray.data._internal.progress_bar.ProgressBar.MAX_NAME_LENGTH` knob. The module moved to `_internal/progress/progress_bar.py`, and the tqdm, logging, and rich progress implementations read a separate copy in `base_progress.py` (#59629, 2.54). The documented public setting, `enable_progress_bar_name_truncation`, stays. - `monitoring-your-workload.md`: The lead-in no longer says all three settings reduce output. `use_ray_tqdm = False` changes the implementation, not the amount of output. - `execution-configurations.md`: Documents `retried_io_errors` in place of `write_file_retry_on_errors`. `DataContext.__setattr__` warns that the old option is deprecated. It was deprecated in #46685 (2.33). The substring-then-regex matching comes from the `retried_io_errors` docstring. - `execution-configurations.md`: The example set `verbose_progress = True`, which is already the default (#43360). It now sets `preserve_order = True`. - `how-to-avoid-ooms.md`: "Eliminates kernel OOMs" contradicted the page's own later statement that kernel OOMs can still happen with isolation enabled. It now uses the conditional wording of the page's summary. For "older versions", the object store proportion warning was removed in #62387, first released in 2.56. The node-death line no longer cites a version. ### Shuffle, aggregation, joins, and mixing - `internals.md`: The range-partitioning sampler takes `num_reducers * 10 / len(blocks)` samples per block (`SortTaskSpec.sample_boundaries`), not 10. The docs were wrong from the start, #52987. - `internals.md`: `random_shuffle` builds on `ShuffleTaskSpec`, with the push-based scheduler under `SORT_SHUFFLE_PUSH_BASED` and the pull-based scheduler otherwise (`planner/random_shuffle.py`). It doesn't use the range-partitioning shuffle. The docs were wrong from the start, #65372. - **Note:** #64875 now plans `sort()` on shuffle v2 by default. This PR removes the stale "shuffle v2 doesn't support sort" claim from the sentence it edits. It leaves documenting sort on shuffle v2, including the "doesn't yet replace the range-partitioning shuffle" sentence, to the Ray Data docs update for that change. - `shuffling-data.md`: The push-based shuffle section now uses `DataContext.shuffle_strategy` and `RAY_DATA_DEFAULT_SHUFFLE_STRATEGY` instead of the deprecated `use_push_based_shuffle` and `RAY_DATA_PUSH_BASED_SHUFFLE` (#50215, 2.43). The section also drops the 2022 log output: the "Using experimental push-based shuffle" line now logs at debug level. - `shuffling-data.md` and `joining-data.md`: Key-based repartitioning and joins no longer link "hash-shuffle" to the legacy `HASH_SHUFFLE` section. Shuffle v2 is the default for both. - `shuffling-data.md`: Dropped "in increasing order of resource consumption and runtime". The page's own benchmark shows `map_batches` shuffle keeping more throughput than local buffer shuffle. - `aggregating-data.md`: `AggregateFnV2` has two abstract methods, `aggregate_block` and `combine`. `finalize` is optional and defaults to returning the accumulator. The docs were wrong from the start, reworded in #59311. - `joining-data.md`: `_derive_max_shuffle_aggregators` caps the aggregator count at the CPU count. One partition per aggregator also needs at least `num_partitions` CPUs. - `joining-data.md`: The lead-in offered `partition_size_hint` as a tuning parameter, but the page says Ray Data ignores it. - `mixing-data.md`: `MixOperator` interleaves whole blocks, but batches can span blocks, as the page's note says. "Each local batch drawn from a single dataset" now holds only when block sizes match the batch size. - `saving-data.md`: `to_pandas()` builds the DataFrame in the calling process by iterating batches. It doesn't build it on the head node. ### Overview, loading, and modality pages - `key-concepts.md`: `get_execution_plan` runs the logical optimizer, then the planner, then the physical optimizer. `FuseOperators` is a physical rule. The paragraph no longer puts both passes "during this translation". - `key-concepts.md`: `Read` plans to `InputDataBuffer` plus a map operator (`plan_read_op.py`), matching line 74 and `internals.md`. The example also switches from `read_parquet` to `read_csv`, because `read_parquet` goes through `ListFiles` and `ReadFiles` when `use_datasource_v2` is on. That's the default since #64821 (2.57). - `custom-datasource-example.md`: "Unstable internal APIs" is now "developer APIs". `FileBasedDatasource` and `RowBasedFileDatasink` are `@DeveloperAPI`, and `Datasource` is `@PublicAPI`. - `loading-data.md`: `read_kafka` also accepts per-partition offsets. `"earliest"` is valid only as a start offset and `"latest"` only as an end offset (`kafka_datasource.py` raises otherwise). - `working-with-llms.md`: Hosted OpenAI-compatible endpoints use `HttpRequestProcessorConfig`, and `ServeDeploymentProcessorConfig` addresses Ray Serve deployments. The intro was wrong from the start, #59214. - `working-with-llms.md`: `size` is a whole-input budget. For video, Qwen3-VL's `smart_resize` compares `t * h * w` against it. The docs were wrong from the start, #63593. - `working-with-tensors.md`: `map_batches` raises `ValueError` for `batch_size="auto"` when `num_gpus` is set (#62648). ## Duplicate check This isn't duplicating an existing PR. I searched open `ray-project/ray` PRs for Ray Data docs and shuffle docs work, and none edits these statements. The one related open item is a planned Ray Data docs update for #64875. This PR deliberately leaves that change's sort-on-shuffle-v2 content alone. ## Testing - Ran the changed `testcode` snippets from `execution-configurations.md` and `shuffling-data.md` against a Ray nightly wheel. `random_shuffle` under `SORT_SHUFFLE_PUSH_BASED` returned all 1,000 rows, and `RAY_DATA_DEFAULT_SHUFFLE_STRATEGY=sort_shuffle_push_based` resolves to that strategy. - `vale` on the 15 changed files shows no new findings compared to `master`. - `pre-commit` hooks passed on commit. - I didn't run a local Sphinx build. The new cross-references target existing API entries, and the Read the Docs preview covers the build. ## AI assistance I used AI assistance (Claude Code) to trace each claim to the source and draft the edits. 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]>
#66615) ## Why are these changes needed? The Ray Data style-pass PRs (#66413, #66418, #66419, #66420, #66422, #66423) left a set of mechanical and structural items open. This PR clears them. None of the edits changes a technical claim, so it needs a style review rather than an SME review. **Markup and links** - `key-concepts.md`: tags the two logical-plan output blocks as `text`, and adds alt text to the three diagrams. - `index.md`, `shuffling-data.md`: removes `$` prompts from shell blocks. - `aggregating-data.md`, `iterating-over-data.md`: uses `{meth}` instead of `{class}` for `Dataset.max`, `min`, `sum`, and `random_shuffle`. - `aggregating-data.md`: drops the trailing slash from the blog link fragment `#performance-benchmarks/`. - `train/getting-started-lightgbm.rst`, `train/getting-started-xgboost.rst`, and two Lightning example notebooks: replaces the hard-coded "Ray Data Quickstart" link text with a bare reference, so the link renders the page title. - `loading-data.md`: moves the `(reading_kafka)=` label above the Kafka heading, stacked with `(reading-from-kafka)=`. **Structure and wording** - `quickstart.md`: replaces the opening bullet list, which restated the section headings, with one sentence that keeps the section links. - `custom-datasource-example.md`: renames the two "Implement the constructor" headings to "Implement the datasource constructor" and "Implement the datasink constructor". Nothing links to the old anchors. - `loading-data.md`: moves the Iceberg tab from the distributed DataFrame libraries tab set to the "Read files" tab set, since Iceberg is a data format rather than a DataFrame library. The tab content is unchanged. - `loading-data.md`: drops the unsourced "most popular PostgreSQL database connector" claim. - `loading-data.md`: the Hugging Face paragraph now leads with the token, which the example uses, and presents `HfFileSystem()` without a token as the fallback for public datasets. See the [#66419 review thread](#66419 (comment)). - `working-with-llms.md`: moves the usage-data note out from under the NIXL troubleshooting heading into its own closing section. - `working-with-pytorch.md`: drops the `torchaudio` mention, since the section has no `torchaudio` example. - `index.md`: "what Datasets are" becomes "what a `Dataset` is", matching the class that the linked key-concepts page defines. **For reviewers** - Please confirm the diagram alt text in `key-concepts.md`. I wrote it from what each diagram shows. - #66192 adds a REST-catalog example inside the Iceberg tab that this PR moves. Whichever PR merges second needs a small rebase: the added content moves with the tab, and its `:::` fences become `::::`. ## Related issue number None. This isn't a duplicate: the items come from reviewing the merged style-pass PRs above, and I searched open PRs touching `doc/source/data/` for overlap. The only overlap is #66192, noted above. ## Checks - [x] I've signed off every commit (DCO). - [x] `pre-commit run --files <changed files>` passes. No hook covers `doc/source` Markdown or notebooks, so every content hook skipped. - [x] Checked that both edited notebooks still parse as JSON. - [ ] Sphinx build: not run locally. Relying on the Read the Docs preview for directive nesting and cross-reference resolution. AI assistance (Claude Code) was used to make these edits. 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]>
…ptions (#66604) ## Why are these changes needed? This PR corrects Ray Data source text that disagrees with the renamed docs headings or with the code it describes. It touches comments and docstrings only. ### Link text that repeats renamed headings The Ray Data style-pass stack renamed several headings to sentence case and imperative form. Three docstrings in `python/ray/data/` carry explicit `:ref:` titles that repeat the old heading text. This PR updates them to match: - `read_api.py`, `read_sql`: "Reading from SQL Databases" → "Read SQL databases" - `read_api.py`, `from_huggingface`: "Loading Hugging Face datasets" → "Load Hugging Face datasets" - `dataset.py`, `repartition`: "Advanced: Performance Tips and Tuning" → "Advanced: Performance tips and tuning", and "Changing the number of output files" → "Change the number of output files" - `dataset.py`, `random_shuffle`: "Optimizing shuffles" → "Optimize shuffles", and lowercases the start of an inline link that sits mid-sentence The labels don't change, so every reference resolves before and after this PR. The only effect is that the rendered link text matches the target heading. ### Source text that contradicts the code - `context.py`, `max_hash_shuffle_aggregators`: the comment said the default is twice the cluster CPU count. The code in `hash_shuffle.py` uses `min(max(1, ceil(cluster CPUs)), max_hash_shuffle_aggregators or DEFAULT_MAX_HASH_SHUFFLE_AGGREGATORS)`, and has never doubled since #55510 added the comment and the code together. The comment now says the CPU count, at least 1. - `execution_options.py`, `ExecutionOptions.verbose_progress`: #43360 made the option on by default and added "On by default.", but left the older sentence that described the off state as the default. That sentence now describes the off state explicitly. This matches `RAY_DATA_VERBOSE_PROGRESS` defaulting to `"1"`. After this change the API reference agrees with the `execution-configurations.md` and `joining-data.md` pages. The link-text edits used to sit in #66419, #66420, and #66423. They moved here so the docs-only PRs in the stack need only docs review. ## Related issue number None. Follow-up to the stack starting at #66418. ## Checks - Not a duplicate. No other open PR touches these docstrings or comments. - `pre-commit` passed on all four files, including ruff, black, pydoclint, and the Ray docstyle check. - The diff changes comment and docstring text only. No code, defaults, or labels change. - AI assistance (Claude Code) was used to prepare this PR. 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 (1M context) <[email protected]>
## Why are these changes needed? A style pass over the Ray Data guides ([#66418](#66418), [#66419](#66419), [#66420](#66420), [#66422](#66422), [#66461](#66461)) turned up code examples that are broken as written. They raise if you copy them, or they don't match what the surrounding text says. This PR fixes only those examples. It doesn't convert untested blocks to tests. | Page | Problem | Fix | |---|---|---| | `loading-data.md` | GCS example uses `gcsfs` without importing it. | Import it. | | `loading-data.md` | Azure example passes `filesystem` positionally, but it's keyword-only in `read_parquet` (`TypeError`). | Pass it by keyword. | | `loading-data.md` | BigQuery `dataset="bigquery-public-data.ml_datasets.iris"`. `BigQueryDatasource` reads `dataset` as `dataset_id.table_id` under `project_id`, so this resolves to dataset `bigquery-public-data`, table `ml_datasets`. | Use a `my_dataset.my_table` placeholder, and say the format in the comment. | | `loading-data.md` | `write_mongo` example passes an undefined `MongoDatasource()`, and `write_mongo` has no such parameter. | Remove it. | | `saving-data.md` | GCS and Azure examples use `gcsfs` and `adlfs` without importing them. | Import them. | | `inspecting-data.md` | Output shows `Image shape:`, but the print has no colon. | Add the colon to the print. | | `shuffling-data.md` | Key-based repartition on `id`, but `ds` is a `read_images` dataset with only `image`. It passed only because nothing consumed the dataset. Consumed, it raises `KeyError: Field "id" does not exist`. | Use `ray.data.range(1000)` and materialize. | | `key-concepts.md` | Streaming example uses undefined UDF names and `read_parquet(...)`, under a "1K rows" comment. | Define placeholder UDFs and use `ray.data.range(1000)`. | | `scaling-collation-functions.md` | Example reassigns `dataset` but passes `train_dataset` to the trainer. | Use `train_dataset` throughout. | | `transforming-data.md` | Polars example: imports `pl` but calls `polars.` (`NameError`). `from_pyarrow` and `DataFrame.summary` don't exist in Polars. The block never consumed `ds`, so the UDF never ran. | `pl.from_arrow`, `describe()`, and materialize. | | `transforming-data.md` | pandas `map_groups` example calls `group.drop("target")`, which drops rows by label and raises `KeyError`. | `group.pop("target")`, which sets the column aside as the code intends. Materialize. | ## Duplicate check Searched open PRs for each affected API and page (`polars from_pyarrow`, `map_groups`, `gcsfs`, `read_bigquery`, `write_mongo`, `repartition`, collation). Nothing open addresses these examples. [#66614](#66614) and [#66615](#66615) edited some of the same pages, but not these examples. Both have merged, and this branch is rebased on them. ## Testing Ran against the Ray nightly wheel (`3.0.0.dev0`, `674900c91fa`) on macOS arm64, using the same pytest arguments and Data doctest plugin as the `doctest_each` targets in `doc/BUILD.bazel`, with `pytest==7.4.4` and Ray's `pytest-sphinx` fork: ```bash python -m pytest --doctest-modules --doctest-glob='*.md' --disable-warnings -c NO_PYTEST_CONFIG \ -p doctest_pytest_plugin doc/source/data/<page>.md ``` - `loading-data.md`, `saving-data.md`, `inspecting-data.md`, `shuffling-data.md`, and `key-concepts.md` pass, before and after the change. - `transforming-data.md` is in `doctest[data-gpu]` and stops at a CUDA block on a host without a GPU, before and after. So I ran its Iris setup block and the two changed blocks as a standalone doctest file, and it passes. Before the fix, those blocks raise `NameError` and `KeyError` once the dataset is consumed. - `key-concepts.md` streaming and `scaling-collation-functions.md` are untested `python` blocks. I ran the streaming block with `num_gpus=1` removed, and it runs. The collation change is a rename, checked by reading. - The `:skipif: True` GCS, Azure, BigQuery, and MongoDB blocks need credentials, so I checked them against the current signatures in `read_api.py` and `dataset.py` and `bigquery_datasource.py`. - `pre-commit run` passes on the changed files. This change touches only `.md` files, so premerge doesn't run the Data doc example tests. ## AI assistance Claude Code helped find the source for each fix, apply the edits, and run the tests. 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]>
… for Ray Data docs (ray-project#66412) ## Why This PR collects the Vale configuration changes for the Ray Data docs into one review: - It prepares the Ray Data docs for a style and grammar pass. Vale can then flag real problems, such as future tense, without noise from valid terms it doesn't know. - It adds Vale rules to the shared `Ray` style for patterns that the Ray Data style pass fixed by hand, over and over, across the style-pass PRs stacked above this one. The rules were written after the style pass, so they sit lower in the stack than the work that motivated them. They touch the same Vale configuration for the same reason, so they're reviewed and landed together here. The rule changes were previously in ray-project#66424, now closed. Stacked on ray-project#66381, which is stacked on ray-project#66375 and ray-project#66352. Review and merge those first. This branch targets `doc-1524-data-prose-softwrap`. ## What ### Vocabulary and suppressions - Removes the two `<!-- vale off -->` / `<!-- vale on -->` blocks from `custom-datasource-example.md`. This was the only Ray Data page that disabled Vale. Both blocks suppressed the future-tense check, and the style pass should fix that prose rather than hide it. - Updates `.vale/styles/config/vocabularies/Data/accept.txt`: - Adds `BentoML`, `CIFAR`, `[Dd]ownscal(e|es|ed|ing)`, `JPEG`, `Kinetica`, `NVTabular`, `Petastorm`, `Psycopg`, `PyArrow`, `Tekken`, `torchtext`, and `torchvision`. - Changes `Datasinks?` to `[Dd]atasinks?` so lowercase "datasink" is accepted, matching `[Dd]atasource(s)?`. - Removes entries that duplicate other vocabularies: `docstrings`, `NLP`, `PIL`, and `TPU(s)?` are in General, and `XGBoost` is in Train. - Removes entries that don't appear in the prose of any `.md` or `.rst` page under `doc/source/`: `assess_quality`, `process_file`, `[Mm]ultiget(s)?`, `PDFs`, `Predibase('s)?`, `[Rr]eformat(s)?`, and `[Pp]ostprocessor(s)?`. - Renames the `ABS` tab to `Azure Blob Storage` in `loading-data.md` and `saving-data.md`, because the acronym isn't widely known. The remaining spelling and terms alerts are intentional. They point at text the style pass fixes: `Bento ML`, `Sagemaker`, `Numpy`, `pyarrow`, `underly`, `undersaturated`, and the unformatted `map_batches` and `smart_resize` identifiers. ### New rules These are rule files only. The `Ray` style is still registered for RLlib pages only, in `.vale.ini`, and nothing changes what Vale runs in CI. Vale on the Ray Data docs is disabled on purpose for now. | Rule | Type | Catches | Why this type | |---|---|---|---| | `Ray.SuchAs` | existence, warning | "like" after a plural noun that introduces examples, such as "formats like", "methods like", and "APIs like" | "like" is also a comparison ("works like a queue") and a verb ("if you'd like"), so a substitution would corrupt that prose. The rule only flags, and only after these nouns. | | `Ray.Brands` | substitution, case-sensitive | `HuggingFace` becomes `Hugging Face` | The literal has no other sense. The match is case-sensitive so lowercase identifiers such as `huggingface_hub` never match, and inline code is skipped anyway. | | `Ray.Capitalization` | existence, case-sensitive | `Ray Tasks`, `Ray Actors`, `Ray Objects`, `Ray Workers`, `Ray Nodes`, `Ray Placement Groups` | The style guide lowercases generic nouns that name a Ray concept. Flag only, because link text that quotes a page title can keep the title's capitals. | | `Ray.LeadIns` | existence, warning | `For example:`, `For instance:`, and `Here's an example` fragments used as lead-ins | The guide wants complete-sentence lead-ins. The right rewrite depends on the example, so the rule only flags. | | `Ray.Filler` additions | existence | "under the hood", "seamlessly" | Both came up repeatedly in the pass. | Each rule links to the matching section of `writing-style.md`. Left out on purpose: - **Slashes between words:** `I/O`, `TCP/IP`, and `and/or` are legitimate, and a pattern can't tell them apart. - **Gerund task headings:** some gerund H1s, such as "Loading data", are kept on purpose to match the nav titles. - **"Ray Cluster" in `Ray.Capitalization`:** it appears mostly in page and section titles ("Ray Clusters Overview") and in the "Ray Cluster Launcher" component name. - **"Pandas" to "pandas":** a case-sensitive swap misfires at the start of a sentence. ## Verification Vocabulary: `vale doc/source/data` with Vale 3.12: `Vale.Spelling` drops from 26 to 10 alerts, `Google.Acronyms` from 4 to 0, and the remaining `Vale.Spelling` and `Vale.Terms` alerts are all in the list above. `custom-datasource-example.md` now reports its three `Google.Will` alerts. Rules: - A test file with positive and negative cases, run with the real vocabularies loaded, so accept-list shadowing would show up. That check caught the `APIs` accept-list entry shadowing `Ray.SuchAs`, so the rule sets `vocab: false`. Every positive case fires. None of these fire: - "works like a queue" and "if you'd like" - `huggingface_hub` in inline code - "Ray Tasks" as `{ref}` link text - lowercase "Ray tasks" - The full `Ray` style, run by hand against all 25 top-level `doc/source/data/*.md` pages at the head of the style-pass stack, reports five warnings and none from the new rules: - "For now" in `mixing-data.md` and "Currently" in `performance-tips.md` are temporary-limitation signals that the stack keeps on purpose. - "seamlessly" in `comparisons.md` and "very" twice in `shuffling-data.md` were filler that the pass missed. They're now fixed in ray-project#66413 and ray-project#66420, the style PRs for those pages. - That run was at the head of the style-pass stack, not at this branch. Running the `Ray` style by hand against the Data pages here might report matches that the stack above fixes. That doesn't affect CI, since the `Ray` style isn't registered for Data pages. The Vale pre-commit hook is still commented out, so this doesn't change CI. ## AI assistance I made these changes with AI assistance (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
…ervability pages to MyST (ray-project#66461) ## Why are these changes needed? Converts the last non-API-reference RST pages under `ray-core/`, `data/`, and `rllib/` to MyST Markdown, plus the `train/` and `ray-observability/` pages that `doc/BUILD.bazel` names by path. The API reference trees (`*/api/`, `rllib/package_ref/`, and `ray-core/compiled-graph/compiled-graph-api`) stay RST for now. Each page gets its own commit, so you can review one file at a time. Every commit renames the page's literal `.rst` paths in `doc/BUILD.bazel` to `.md`. These paths are in `exclude` lists and in the explicit `files` lists of `doctest[data-gpu]` and `doctest[train-gpu]`, and they don't glob. Without the edit, an excluded page would silently join its target once it's `.md`, and an included page would silently drop out of it. Conversions are format-only: labels, headings, and prose are unchanged. A final whitespace-only commit soft-wraps the prose. `ray-soft-wrap`'s `verify.py` confirms non-whitespace bytes, rendered HTML, and idempotence for all 11 files. ### `rllib/getting-started`: doctest target removed The first commit deletes `doctest[rllib2]`, the only target over `rllib/getting-started.rst`, before the page converts. The target is tagged `manual` with a hang TODO, so no premerge or postmerge step has run it, and nothing else references it (`git grep rllib2` is empty). Its 15 `testcode` blocks had no `testoutput`, so they asserted nothing. The 12 visible blocks become display-only `python` code blocks. The three `:hide:` blocks held `.stop()` cleanups that never rendered, so they're deleted. `doctest[rllib]` still excludes the page. If these examples should be validated later, a `doc_code/` script is the better route than reviving the hanging target. cc @elliot-barn, who owns the TODO. This commit isn't buildable on its own. It turns a `.. testcode::` that had no blank line before its body into a `.. code-block:: python`, still with no blank line, and docutils reads the body as extra arguments to the directive. The later conversion commit fixes it in the `.md`, and a squash merge never puts the intermediate commit on master. ### Doctest coverage Docs-only PRs don't run doctests premerge. This PR edits `doc/BUILD.bazel`, so every library's docs example step runs, but premerge can't show the conversion kept the same blocks. For that, I parsed each `.md` and the `.rst` it replaced with Ray's `pytest-sphinx` fork, the same parser the doctest macro runs, and asserted identical sections (directive, body, `:options:`, `:skipif:`) and examples. | Page | BUILD role | Examples before → after | | --- | --- | --- | | `ray-core/handling-dependencies` | `doctest[core]` exclude | 17 → 17 | | `ray-core/tasks/nested-tasks` | `doctest[core]` exclude | 0 → 0 (`literalinclude` of a tested `doc_code/` file) | | `data/batch-inference` | `doctest_each` exclude, `doctest[data-gpu]` files | 7 → 7 | | `data/transforming-data` | `doctest_each` exclude, `doctest[data-gpu]` files | 24 → 24 | | `data/contributing/contributing` | `doctest_each` glob | 0 → 0 (toctree only) | | `rllib/getting-started` | `doctest[rllib]` exclude, `doctest[rllib2]` removed | 15 → 0, by the removal commit | | `ray-observability/user-guides/cli-sdk` | top-level exclude | 16 → 16 | | `ray-observability/user-guides/ray-tracing` | top-level exclude | 3 → 3 | | `train/horovod` | `doctest[train]` exclude | 2 → 2 | | `train/user-guides/data-loading-preprocessing` | `doctest[train]` exclude, `doctest[train-gpu]` files | 6 → 6 | | `train/user-guides/using-accelerators` | `doctest[train]` exclude, `doctest[train-gpu]` files | 10 → 10 | To show the check would catch a broken conversion, I mutated each page with examples three ways: dropping a `testcode` block, altering a line in one, and turning one into a four-backtick fence. The last renders fine but is never collected. The check failed on all 24 mutations. ### Rendering changes I ran `render_diff.py` on all 11 pages against `/en/master`. Six render identically: `nested-tasks`, `data/contributing/contributing`, `cli-sdk`, `ray-tracing`, `horovod`, and `using-accelerators`. Every difference on the other five is listed here. - `rllib/getting-started`: on master, one `.. testcode::` line had no blank line after it. docutils read the block's first six lines, the `best_result = results.get_best_result(...)` call, as the directive's argument and dropped them. So master shows code that uses `best_result` without showing where it comes from. The converted page renders all six lines. This is the one place the conversion deliberately doesn't reproduce master. - `rllib/getting-started`: the "Farama gymnasium" link now has `https://`. On master it's a relative link to `gymnasium.farama.org` that 404s. - `ray-core/handling-dependencies`: MyST drops the apostrophe when it slugifies the "can't import the packages" heading, so the section id changes. That heading had no label, so the page adds a target carrying the old docutils slug, and existing `#...-can-t-import-...` links still resolve. An auto-numbered span id, which nothing links to, also changes from `id4` to `id2`. - `data/batch-inference` and `train/user-guides/data-loading-preprocessing`: each renders an RST comment as an HTML comment, which readers never see. - `data/transforming-data`: the "When using" definition list's `<dl>` gains the unstyled `myst` class. The first preview diff also caught three regressions that the green build didn't. MyST's `replacements` extension turned two `(c)` list markers into `©` and an `etc..` into `etc…`. The anchor above had changed too. A follow-up commit fixes all three. A sweep of the 11 pages found no other text that extension rewrites. ### Dead `doc/BUILD.bazel` excludes A final commit drops four `exclude` entries that name files that have moved: two in `doctest[serve]` and two in the serve `doc_code` test. A glob exclude naming a missing file excludes nothing, so these had silently stopped applying. This doesn't change what any target runs. ray-project#66462 carries the same commit, along with a lint check that fails on this class of stale path, so the two PRs merge cleanly in either order. ### Open PRs that edit these files Each of these open PRs edits one of the converted `.rst` files, so each will need to move its change to the `.md`: ray-project#66279, ray-project#66191, ray-project#65956, ray-project#65933, and ray-project#65830 (`handling-dependencies`), ray-project#65693 (`cli-sdk`), and ray-project#66419, ray-project#66420, ray-project#66422, and ray-project#66423 (`data/batch-inference`, `train/user-guides/data-loading-preprocessing`). ray-project#66096, ray-project#64053, and ray-project#63881 also edit `doc/BUILD.bazel`, and only ray-project#66096 edits nearby lines. ## Related issue number None. No open PR converts these pages. I checked `gh pr list` for open PRs touching each file. ## Checks - [x] I've signed off every commit (`git commit -s`). - [x] Pre-commit hooks passed on every commit. - Doctest parity: `python3 doctest_parity.py <the 11 .md files>` with `pytest==7.4.4` and `pytest-sphinx @ git+https://github.com/ray-project/pytest-sphinx`. All OK, run again after the soft-wrap commit. - Static checks on every `.md`: fences balance, no leftover RST roles or directives, every label from the `.rst` is present, and directive counts match. - Read the Docs preview builds green under `fail_on_warning`, and the render diff against `/en/master` is in Rendering changes. The first build hit the known autosummary-import segfault and passed on rebuild. - Local doctest run: not done. The GPU targets need hardware, and the CPU targets run in this PR's premerge because of the `BUILD.bazel` change. AI assistance (Claude Code) was used for the conversion and the verification scripts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
## Description Style and grammar pass on seven Ray Data operation guides against Ray's [writing-style guide](https://docs.ray.io/en/master/ray-contribute/writing-style.html): `saving-data.md`, `inspecting-data.md`, `iterating-over-data.md`, `aggregating-data.md`, `joining-data.md`, `mixing-data.md`, and `shuffling-data.md`. Prose only, apart from one code fix: `import os` in the partitioned-write example, which used `os` without importing it. No other code, testcode, code comments, or URLs changed. Stacked on ray-project#66419. Review and merge that stack first. This branch targets `doc-1524-data-style-loading`. It's the third of several PRs that apply the same pass to the top-level Ray Data pages. ### All seven pages - Rewords task headings as imperatives, such as "Write data to files" and "Configure joins", and conceptual headings as questions, such as "How does per-block mixing work?". The gerund H1s stay, sentence-cased, to match the nav titles and the loading page. Each reworded heading gets an explicit label named after its old slug, such as `(writing-data-to-files)=`, so existing URL fragments keep resolving. Headings that already had a label keep it, with the new label stacked beneath. None of the new labels collide with existing ones. - Uses second person, active voice, present tense, and "such as" for examples. Recasts "lets", "allows", and "enables". - Removes dashes, parentheticals, semicolons, and filler such as "essentially", "actually", and "note that". - Fixes list structure and punctuation. Non-sequential numbered lists become bullets or prose, and ordered lists use `1.`. - Keeps contractions in warnings, because Vale's `Google.Contractions` rule errors on the expanded forms. ### Page-specific changes - `saving-data.md`: Folds the opening heading preview into prose and adds a lead-in under the stacked H2. Fixes a Mars tab that said "convert a Dataset from a Mars DataFrame" for `Dataset.to_mars()`. - `inspecting-data.md`: Adds the missing `{meth}` role on `Dataset.take_batch()`, which rendered its angle brackets literally. Sentence-cases the `PyArrow` tab title. - `iterating-over-data.md`: Adds the missing `{meth}` role on three method list items (`iter_batches`, `iter_torch_batches`, and `to_tf`) that had the same problem. - `aggregating-data.md`: Replaces the marketing-style opening with a statement of what the page covers. - `joining-data.md`: Replaces three bold pseudo-headings over one-item lists with one join-types list. - `mixing-data.md`: Changes the optional repartitioning advice from a `note` to a `tip`, and makes the Limitations labels parallel. - `shuffling-data.md`: Fixes the "read function function" typo, adds alt text to the push-based shuffle chart from the sentence that introduces it, and changes "(New in 2.46)" into a sentence. ### Other files - Updates link text that quotes the old headings in `inspecting-data.md`, `iterating-over-data.md`, `shuffling-data.md`, and `train/user-guides/data-loading-preprocessing.rst`. The matching `dataset.py` docstring edits are in ray-project#66604. ## Questions for reviewers These points need a Ray Data maintainer. Each one predates this PR unless noted. - **Push-based shuffle (`shuffling-data.md`):** the note says `DataContext.use_push_based_shuffle` and `RAY_DATA_PUSH_BASED_SHUFFLE` are deprecated in favor of `DataContext.shuffle_strategy`, but the same section still tells you to set both, and its examples use them. Should the section move to `ShuffleStrategy`? - **Shuffle order (`shuffling-data.md`):** the intro says the methods appear "in increasing order of resource consumption and runtime", but the page's own benchmark shows `map_batches` shuffle, which comes second, keeping more throughput than local buffer shuffle. - **Hash shuffle naming (`shuffling-data.md`):** the key-based repartitioning item says it triggers a "hash-shuffle" operation, while the tip says it uses shuffle v2 by default and calls hash-shuffle the previous implementation. - **Aggregator count (`joining-data.md`):** "Setting `max_hash_shuffle_aggregators >= num_partitions` allocates one partition per aggregator." The page also says the count defaults to the smallest of `num_partitions`, the CPU count, and the cap, so on a cluster with fewer CPUs than partitions, raising the cap alone might not be enough. - **Deprecated parameter (`joining-data.md`):** the lead-in "Tune join performance ... with the following two parameters" includes `partition_size_hint`, which the page says Ray Data ignores. - **Random mixing (`mixing-data.md`):** the random-mixing section says local batches are "each drawn from a single dataset", but an earlier note says a local batch might contain data from more than one input dataset. - **Stats log (`inspecting-data.md`):** the page says Ray Data persists execution statistics to `ray-data.log`. The streaming executor logs the stats summary only when `DataContext.enable_auto_log_stats` is set, and `DEFAULT_AUTO_LOG_STATS` is `False` in `context.py`. Should the sentence name that condition? - **Custom aggregators (`aggregating-data.md`):** the page says `AggregateFnV2` has "three key methods that you implement", including `finalize`. In `aggregate.py`, only `combine` and `aggregate_block` are abstract. `finalize` has a default, and the class docstring calls finalization optional. - **Head node (`saving-data.md`):** "Your data must fit in memory on the head node" for `to_pandas()` might mean the driver's node. - **Removal date (`saving-data.md`):** "Support for this combination ends after February 2027." Please confirm the date. - **Code the pass didn't touch:** - The GCS and Azure examples in `saving-data.md` call `gcsfs` and `adlfs` without importing them. - The NumPy example in `inspecting-data.md` prints `"Image shape"` without the colon its output shows. - `shuffling-data.md` has a `bash` block with `$` prompts and a plain `python` block in the fallback tip. - `aggregating-data.md` and `iterating-over-data.md` use `{class}` on methods (`max`, `min`, `sum`, and `random_shuffle`). - The benchmark link in the `aggregating-data.md` note ends its fragment with a slash, `#performance-benchmarks/`. ## Verification - A meaning-diff review compared every before-and-after pair. A conservative filter cleared 22 blocks as cosmetic, and reviewers found that 146 of the remaining 149 kept their meaning. The Mars tab change is the intended correction noted above. Two drifts are fixed in a follow-up commit: the mixing page's skewed-weights limitation had lost its signal that the limitation is temporary, and the joins page had lost "previous" for the hash-shuffle implementation. - `vale` with Vale 3.12, run from the repo root: no warning- or error-level alerts on the seven pages. - `codespell`: no hits. - The pre-commit hooks passed. - A structural check against each pre-edit file confirmed the code-fence count and URLs are unchanged. The only role-target changes are the four added `{meth}` roles, and every target exists on `ray.data.Dataset`. The only anchor changes are the added old-slug labels. None were removed. - Before adding each label, I grepped `doc/source` for the label name in hyphen and underscore forms. None collide. ## AI assistance I made these edits with AI assistance (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
## Description Style and grammar pass on six Ray Data modality guides against Ray's [writing-style guide](https://docs.ray.io/en/master/ray-contribute/writing-style.html): `working-with-images.md`, `working-with-text.md`, `working-with-tensors.md`, `working-with-pytorch.md`, `working-with-llms.md`, and `scaling-collation-functions.md`. Prose only, apart from one code fix: the PyTorch migration example now imports `transforms`, which it uses. No other code, testcode, literalinclude blocks, code comments, or URLs changed. Stacked on ray-project#66420. Review and merge that stack first. This branch targets `doc-1524-data-style-ops`. It's the fourth of five PRs that apply the same pass to the top-level Ray Data pages. ### All six pages - Rewords task headings as imperatives, such as "Read images" and "Scale to multiple GPUs", and conceptual headings as questions, such as "How does the processor pipeline work?". Each reworded heading keeps its old URL fragment through an explicit label named after the old slug. Headings that already had a matching label need no new one. One old fragment can't be kept: `working-with-llms#cross-node-parallelism`, because `serve/llm/user-guides/cross-node-parallelism.md` already defines that label name. Nothing in the repo links to it. Three more old fragments are dropped on purpose because their names are single words: `#embeddings`, `#classification`, and `#multimodality`. Sphinx labels are global, so a label with a generic name would claim it for the whole site and break the build of any later page that defines it. Those headings keep their existing specific labels, such as `embedding_models`. - Uses second person, active voice, present tense, and "such as" for examples. Recasts "lets", "allows", and "enables". - Removes em dashes, parentheticals, first-person plural, "will", and filler. - Fixes list lead-ins and punctuation, and uses `1.` for ordered lists. Opening lists of section links stay, because they're the pages' only links to their sections. - Keeps `{ref}` link text that quotes another page's title in that title's words, such as "Saving Data API". ### Page-specific changes - `working-with-llms.md`: Spells "Hugging Face" consistently in prose, defines "VLM" once, and turns five bold paragraph labels into lead-in sentences. Gives the real default for `max_tasks_in_flight_per_actor`: it resolves to `DataContext.max_tasks_in_flight_per_actor` or `2 * max_concurrent_batches`, which ray-project#63214 introduced in place of the fixed 16. Scopes the vLLM table's lead-in to recent releases, since the table doesn't cover every one. The "Known issue" admonition keeps its title and gains the `warning` class, because the issue raises an `ImportError`. It also moves a bold "Usage data collection" label into a `note`. - `working-with-pytorch.md`: Replaces the legacy "Ray Datasets" product name, recasts the migration section into imperatives, says `pin_memory` applies only when the collate function returns tensors, as its docstring does, and puts the `map` and `map_batches` tab titles in inline code. - `scaling-collation-functions.md`: Fixes the "improving better" typo, and turns the two bold table captions into `list-table` titles. Every number and instance type is unchanged. - `working-with-images.md` and `working-with-text.md`: Put the default column names `image` and `text` in inline code. - `working-with-tensors.md`: Changes the H1 from "Working with Tensors / NumPy" to "Working with tensors and NumPy". ### Other files - Updates link text in `train/user-guides/data-loading-preprocessing.rst` that quotes the old headings, and fixes its "Pytorch" casing. ## Questions for reviewers Apart from the `max_tasks_in_flight_per_actor` default, this pass kept the scope of every claim. These points need a Ray Data maintainer. Each one predates this PR. - **Example variable (`scaling-collation-functions.md`):** the "after" example reassigns `dataset` but passes `train_dataset` to the trainer. - **`torchaudio` (`working-with-pytorch.md`):** the transforms section names `torchaudio`, but it has no `torchaudio` example. - **Custom tokenizers (`working-with-llms.md`):** are `mistral`, `deepseek_v32`, and `grok2` `tokenizer_mode` values? If so, the sentence can name them that way instead of in parentheses. The page says "DeepSeek-V3", but the example file's docstring says "DeepSeek-V3.2". - **`batch_size="auto"` (`working-with-tensors.md`):** the page recommends `batch_size="auto"` but doesn't say that `map_batches` requires an explicit integer `batch_size` when `num_gpus` is set (`dataset.py`). - **Note placement (`working-with-llms.md`):** the usage-data note sits under the NIXL troubleshooting heading. ## Verification - A follow-up commit applies source-verified fixes from automated review. It scopes the collate batch-alignment note to output blocks, because the example repartitions only after `map_batches`. It mentions the alpha `pin_memory` argument of `iter_torch_batches`, imports `transforms` in the PyTorch migration example, and describes what the tensors page covers instead of limitations it doesn't list. It also refers to the value of `max_concurrent_batches` rather than a batch size. - A meaning-diff review compared every before-and-after pair. A conservative filter cleared 37 blocks as cosmetic, and reviewers checked the remaining blocks against the pre-edit text and the Ray source. Two drifted and are fixed in a follow-up commit: a new lead-in implied that Ray Data LLM handles row, actor, and pipeline failures automatically, and the Office Hours item had lost "new". The reviewers confirmed the TP*PP gloss against `placement.py` and `vllm_engine_stage.py`, and that the Hugging Face processor, not Ray, resizes image inputs. - `vale` with Vale 3.12, run from the repo root: no warning- or error-level alerts on the six pages. - `codespell`: no hits. - The pre-commit hooks passed. - A structural check against each pre-edit file confirmed the code-fence count, role targets, and URLs are unchanged. The only anchor changes are the added old-slug labels. None were removed. - Before adding each label, I grepped `doc/source` for the label name in hyphen and underscore forms. The only collision is the `cross-node-parallelism` case above. ## AI assistance I made these edits with AI assistance (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
…-project#66614) ## Why are these changes needed? The Ray Data style pass (ray-project#66413, ray-project#66418, ray-project#66419, ray-project#66420, ray-project#66422, ray-project#66423) kept the scope of every technical claim. That round flagged statements that disagree with the current source, or with other statements on the same page. This PR fixes the ones the source settles. Each edit below names the source it follows and, where one exists, the PR that caused the drift. Ray Data reviewers: please confirm each item. LLM owners: please check the `working-with-llms.md` edits. ### Performance, monitoring, and configuration - `performance-tips.md`: The default object store limit is 0.5, not 1/4. `ResourceManager.DEFAULT_OBJECT_STORE_MEMORY_LIMIT_FRACTION` is 0.5 when the resource allocator is on, and `op_resource_reservation_enabled` defaults to `True`. Docs lag since ray-project#43171 (2.10). - `performance-tips.md`: `select_columns` after `read_parquet` prunes at read time. `ProjectionPushdown` is in `_LOGICAL_RULESET`, and `ParquetDatasource.supports_projection_pushdown` returns true. Docs lag since ray-project#56500 (2.50). The page now recommends the pattern its own example uses. - `performance-tips.md`: The "following procedure" lead-in introduced bullets that don't describe a procedure. It now introduces them as rules. - `monitoring-your-workload.md`: Dropped `RAY_DATA_TRACE_SCHEDULING`, which nothing under `python/` references anymore. It was removed in ray-project#44399 (2.11). - `monitoring-your-workload.md`: Dropped the `ray.data._internal.progress_bar.ProgressBar.MAX_NAME_LENGTH` knob. The module moved to `_internal/progress/progress_bar.py`, and the tqdm, logging, and rich progress implementations read a separate copy in `base_progress.py` (ray-project#59629, 2.54). The documented public setting, `enable_progress_bar_name_truncation`, stays. - `monitoring-your-workload.md`: The lead-in no longer says all three settings reduce output. `use_ray_tqdm = False` changes the implementation, not the amount of output. - `execution-configurations.md`: Documents `retried_io_errors` in place of `write_file_retry_on_errors`. `DataContext.__setattr__` warns that the old option is deprecated. It was deprecated in ray-project#46685 (2.33). The substring-then-regex matching comes from the `retried_io_errors` docstring. - `execution-configurations.md`: The example set `verbose_progress = True`, which is already the default (ray-project#43360). It now sets `preserve_order = True`. - `how-to-avoid-ooms.md`: "Eliminates kernel OOMs" contradicted the page's own later statement that kernel OOMs can still happen with isolation enabled. It now uses the conditional wording of the page's summary. For "older versions", the object store proportion warning was removed in ray-project#62387, first released in 2.56. The node-death line no longer cites a version. ### Shuffle, aggregation, joins, and mixing - `internals.md`: The range-partitioning sampler takes `num_reducers * 10 / len(blocks)` samples per block (`SortTaskSpec.sample_boundaries`), not 10. The docs were wrong from the start, ray-project#52987. - `internals.md`: `random_shuffle` builds on `ShuffleTaskSpec`, with the push-based scheduler under `SORT_SHUFFLE_PUSH_BASED` and the pull-based scheduler otherwise (`planner/random_shuffle.py`). It doesn't use the range-partitioning shuffle. The docs were wrong from the start, ray-project#65372. - **Note:** ray-project#64875 now plans `sort()` on shuffle v2 by default. This PR removes the stale "shuffle v2 doesn't support sort" claim from the sentence it edits. It leaves documenting sort on shuffle v2, including the "doesn't yet replace the range-partitioning shuffle" sentence, to the Ray Data docs update for that change. - `shuffling-data.md`: The push-based shuffle section now uses `DataContext.shuffle_strategy` and `RAY_DATA_DEFAULT_SHUFFLE_STRATEGY` instead of the deprecated `use_push_based_shuffle` and `RAY_DATA_PUSH_BASED_SHUFFLE` (ray-project#50215, 2.43). The section also drops the 2022 log output: the "Using experimental push-based shuffle" line now logs at debug level. - `shuffling-data.md` and `joining-data.md`: Key-based repartitioning and joins no longer link "hash-shuffle" to the legacy `HASH_SHUFFLE` section. Shuffle v2 is the default for both. - `shuffling-data.md`: Dropped "in increasing order of resource consumption and runtime". The page's own benchmark shows `map_batches` shuffle keeping more throughput than local buffer shuffle. - `aggregating-data.md`: `AggregateFnV2` has two abstract methods, `aggregate_block` and `combine`. `finalize` is optional and defaults to returning the accumulator. The docs were wrong from the start, reworded in ray-project#59311. - `joining-data.md`: `_derive_max_shuffle_aggregators` caps the aggregator count at the CPU count. One partition per aggregator also needs at least `num_partitions` CPUs. - `joining-data.md`: The lead-in offered `partition_size_hint` as a tuning parameter, but the page says Ray Data ignores it. - `mixing-data.md`: `MixOperator` interleaves whole blocks, but batches can span blocks, as the page's note says. "Each local batch drawn from a single dataset" now holds only when block sizes match the batch size. - `saving-data.md`: `to_pandas()` builds the DataFrame in the calling process by iterating batches. It doesn't build it on the head node. ### Overview, loading, and modality pages - `key-concepts.md`: `get_execution_plan` runs the logical optimizer, then the planner, then the physical optimizer. `FuseOperators` is a physical rule. The paragraph no longer puts both passes "during this translation". - `key-concepts.md`: `Read` plans to `InputDataBuffer` plus a map operator (`plan_read_op.py`), matching line 74 and `internals.md`. The example also switches from `read_parquet` to `read_csv`, because `read_parquet` goes through `ListFiles` and `ReadFiles` when `use_datasource_v2` is on. That's the default since ray-project#64821 (2.57). - `custom-datasource-example.md`: "Unstable internal APIs" is now "developer APIs". `FileBasedDatasource` and `RowBasedFileDatasink` are `@DeveloperAPI`, and `Datasource` is `@PublicAPI`. - `loading-data.md`: `read_kafka` also accepts per-partition offsets. `"earliest"` is valid only as a start offset and `"latest"` only as an end offset (`kafka_datasource.py` raises otherwise). - `working-with-llms.md`: Hosted OpenAI-compatible endpoints use `HttpRequestProcessorConfig`, and `ServeDeploymentProcessorConfig` addresses Ray Serve deployments. The intro was wrong from the start, ray-project#59214. - `working-with-llms.md`: `size` is a whole-input budget. For video, Qwen3-VL's `smart_resize` compares `t * h * w` against it. The docs were wrong from the start, ray-project#63593. - `working-with-tensors.md`: `map_batches` raises `ValueError` for `batch_size="auto"` when `num_gpus` is set (ray-project#62648). ## Duplicate check This isn't duplicating an existing PR. I searched open `ray-project/ray` PRs for Ray Data docs and shuffle docs work, and none edits these statements. The one related open item is a planned Ray Data docs update for ray-project#64875. This PR deliberately leaves that change's sort-on-shuffle-v2 content alone. ## Testing - Ran the changed `testcode` snippets from `execution-configurations.md` and `shuffling-data.md` against a Ray nightly wheel. `random_shuffle` under `SORT_SHUFFLE_PUSH_BASED` returned all 1,000 rows, and `RAY_DATA_DEFAULT_SHUFFLE_STRATEGY=sort_shuffle_push_based` resolves to that strategy. - `vale` on the 15 changed files shows no new findings compared to `master`. - `pre-commit` hooks passed on commit. - I didn't run a local Sphinx build. The new cross-references target existing API entries, and the Read the Docs preview covers the build. ## AI assistance I used AI assistance (Claude Code) to trace each claim to the source and draft the edits. 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]>
ray-project#66615) ## Why are these changes needed? The Ray Data style-pass PRs (ray-project#66413, ray-project#66418, ray-project#66419, ray-project#66420, ray-project#66422, ray-project#66423) left a set of mechanical and structural items open. This PR clears them. None of the edits changes a technical claim, so it needs a style review rather than an SME review. **Markup and links** - `key-concepts.md`: tags the two logical-plan output blocks as `text`, and adds alt text to the three diagrams. - `index.md`, `shuffling-data.md`: removes `$` prompts from shell blocks. - `aggregating-data.md`, `iterating-over-data.md`: uses `{meth}` instead of `{class}` for `Dataset.max`, `min`, `sum`, and `random_shuffle`. - `aggregating-data.md`: drops the trailing slash from the blog link fragment `#performance-benchmarks/`. - `train/getting-started-lightgbm.rst`, `train/getting-started-xgboost.rst`, and two Lightning example notebooks: replaces the hard-coded "Ray Data Quickstart" link text with a bare reference, so the link renders the page title. - `loading-data.md`: moves the `(reading_kafka)=` label above the Kafka heading, stacked with `(reading-from-kafka)=`. **Structure and wording** - `quickstart.md`: replaces the opening bullet list, which restated the section headings, with one sentence that keeps the section links. - `custom-datasource-example.md`: renames the two "Implement the constructor" headings to "Implement the datasource constructor" and "Implement the datasink constructor". Nothing links to the old anchors. - `loading-data.md`: moves the Iceberg tab from the distributed DataFrame libraries tab set to the "Read files" tab set, since Iceberg is a data format rather than a DataFrame library. The tab content is unchanged. - `loading-data.md`: drops the unsourced "most popular PostgreSQL database connector" claim. - `loading-data.md`: the Hugging Face paragraph now leads with the token, which the example uses, and presents `HfFileSystem()` without a token as the fallback for public datasets. See the [ray-project#66419 review thread](ray-project#66419 (comment)). - `working-with-llms.md`: moves the usage-data note out from under the NIXL troubleshooting heading into its own closing section. - `working-with-pytorch.md`: drops the `torchaudio` mention, since the section has no `torchaudio` example. - `index.md`: "what Datasets are" becomes "what a `Dataset` is", matching the class that the linked key-concepts page defines. **For reviewers** - Please confirm the diagram alt text in `key-concepts.md`. I wrote it from what each diagram shows. - ray-project#66192 adds a REST-catalog example inside the Iceberg tab that this PR moves. Whichever PR merges second needs a small rebase: the added content moves with the tab, and its `:::` fences become `::::`. ## Related issue number None. This isn't a duplicate: the items come from reviewing the merged style-pass PRs above, and I searched open PRs touching `doc/source/data/` for overlap. The only overlap is ray-project#66192, noted above. ## Checks - [x] I've signed off every commit (DCO). - [x] `pre-commit run --files <changed files>` passes. No hook covers `doc/source` Markdown or notebooks, so every content hook skipped. - [x] Checked that both edited notebooks still parse as JSON. - [ ] Sphinx build: not run locally. Relying on the Read the Docs preview for directive nesting and cross-reference resolution. AI assistance (Claude Code) was used to make these edits. 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]>
…ptions (ray-project#66604) ## Why are these changes needed? This PR corrects Ray Data source text that disagrees with the renamed docs headings or with the code it describes. It touches comments and docstrings only. ### Link text that repeats renamed headings The Ray Data style-pass stack renamed several headings to sentence case and imperative form. Three docstrings in `python/ray/data/` carry explicit `:ref:` titles that repeat the old heading text. This PR updates them to match: - `read_api.py`, `read_sql`: "Reading from SQL Databases" → "Read SQL databases" - `read_api.py`, `from_huggingface`: "Loading Hugging Face datasets" → "Load Hugging Face datasets" - `dataset.py`, `repartition`: "Advanced: Performance Tips and Tuning" → "Advanced: Performance tips and tuning", and "Changing the number of output files" → "Change the number of output files" - `dataset.py`, `random_shuffle`: "Optimizing shuffles" → "Optimize shuffles", and lowercases the start of an inline link that sits mid-sentence The labels don't change, so every reference resolves before and after this PR. The only effect is that the rendered link text matches the target heading. ### Source text that contradicts the code - `context.py`, `max_hash_shuffle_aggregators`: the comment said the default is twice the cluster CPU count. The code in `hash_shuffle.py` uses `min(max(1, ceil(cluster CPUs)), max_hash_shuffle_aggregators or DEFAULT_MAX_HASH_SHUFFLE_AGGREGATORS)`, and has never doubled since ray-project#55510 added the comment and the code together. The comment now says the CPU count, at least 1. - `execution_options.py`, `ExecutionOptions.verbose_progress`: ray-project#43360 made the option on by default and added "On by default.", but left the older sentence that described the off state as the default. That sentence now describes the off state explicitly. This matches `RAY_DATA_VERBOSE_PROGRESS` defaulting to `"1"`. After this change the API reference agrees with the `execution-configurations.md` and `joining-data.md` pages. The link-text edits used to sit in ray-project#66419, ray-project#66420, and ray-project#66423. They moved here so the docs-only PRs in the stack need only docs review. ## Related issue number None. Follow-up to the stack starting at ray-project#66418. ## Checks - Not a duplicate. No other open PR touches these docstrings or comments. - `pre-commit` passed on all four files, including ruff, black, pydoclint, and the Ray docstyle check. - The diff changes comment and docstring text only. No code, defaults, or labels change. - AI assistance (Claude Code) was used to prepare this PR. 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 (1M context) <[email protected]>
…ect#66636) ## Why are these changes needed? A style pass over the Ray Data guides ([ray-project#66418](ray-project#66418), [ray-project#66419](ray-project#66419), [ray-project#66420](ray-project#66420), [ray-project#66422](ray-project#66422), [ray-project#66461](ray-project#66461)) turned up code examples that are broken as written. They raise if you copy them, or they don't match what the surrounding text says. This PR fixes only those examples. It doesn't convert untested blocks to tests. | Page | Problem | Fix | |---|---|---| | `loading-data.md` | GCS example uses `gcsfs` without importing it. | Import it. | | `loading-data.md` | Azure example passes `filesystem` positionally, but it's keyword-only in `read_parquet` (`TypeError`). | Pass it by keyword. | | `loading-data.md` | BigQuery `dataset="bigquery-public-data.ml_datasets.iris"`. `BigQueryDatasource` reads `dataset` as `dataset_id.table_id` under `project_id`, so this resolves to dataset `bigquery-public-data`, table `ml_datasets`. | Use a `my_dataset.my_table` placeholder, and say the format in the comment. | | `loading-data.md` | `write_mongo` example passes an undefined `MongoDatasource()`, and `write_mongo` has no such parameter. | Remove it. | | `saving-data.md` | GCS and Azure examples use `gcsfs` and `adlfs` without importing them. | Import them. | | `inspecting-data.md` | Output shows `Image shape:`, but the print has no colon. | Add the colon to the print. | | `shuffling-data.md` | Key-based repartition on `id`, but `ds` is a `read_images` dataset with only `image`. It passed only because nothing consumed the dataset. Consumed, it raises `KeyError: Field "id" does not exist`. | Use `ray.data.range(1000)` and materialize. | | `key-concepts.md` | Streaming example uses undefined UDF names and `read_parquet(...)`, under a "1K rows" comment. | Define placeholder UDFs and use `ray.data.range(1000)`. | | `scaling-collation-functions.md` | Example reassigns `dataset` but passes `train_dataset` to the trainer. | Use `train_dataset` throughout. | | `transforming-data.md` | Polars example: imports `pl` but calls `polars.` (`NameError`). `from_pyarrow` and `DataFrame.summary` don't exist in Polars. The block never consumed `ds`, so the UDF never ran. | `pl.from_arrow`, `describe()`, and materialize. | | `transforming-data.md` | pandas `map_groups` example calls `group.drop("target")`, which drops rows by label and raises `KeyError`. | `group.pop("target")`, which sets the column aside as the code intends. Materialize. | ## Duplicate check Searched open PRs for each affected API and page (`polars from_pyarrow`, `map_groups`, `gcsfs`, `read_bigquery`, `write_mongo`, `repartition`, collation). Nothing open addresses these examples. [ray-project#66614](ray-project#66614) and [ray-project#66615](ray-project#66615) edited some of the same pages, but not these examples. Both have merged, and this branch is rebased on them. ## Testing Ran against the Ray nightly wheel (`3.0.0.dev0`, `674900c91fa`) on macOS arm64, using the same pytest arguments and Data doctest plugin as the `doctest_each` targets in `doc/BUILD.bazel`, with `pytest==7.4.4` and Ray's `pytest-sphinx` fork: ```bash python -m pytest --doctest-modules --doctest-glob='*.md' --disable-warnings -c NO_PYTEST_CONFIG \ -p doctest_pytest_plugin doc/source/data/<page>.md ``` - `loading-data.md`, `saving-data.md`, `inspecting-data.md`, `shuffling-data.md`, and `key-concepts.md` pass, before and after the change. - `transforming-data.md` is in `doctest[data-gpu]` and stops at a CUDA block on a host without a GPU, before and after. So I ran its Iris setup block and the two changed blocks as a standalone doctest file, and it passes. Before the fix, those blocks raise `NameError` and `KeyError` once the dataset is consumed. - `key-concepts.md` streaming and `scaling-collation-functions.md` are untested `python` blocks. I ran the streaming block with `num_gpus=1` removed, and it runs. The collation change is a rename, checked by reading. - The `:skipif: True` GCS, Azure, BigQuery, and MongoDB blocks need credentials, so I checked them against the current signatures in `read_api.py` and `dataset.py` and `bigquery_datasource.py`. - `pre-commit run` passes on the changed files. This change touches only `.md` files, so premerge doesn't run the Data doc example tests. ## AI assistance Claude Code helped find the source for each fix, apply the edits, and run the tests. 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]>
Description
Style and grammar pass on seven Ray Data operation guides against Ray's writing-style guide:
saving-data.md,inspecting-data.md,iterating-over-data.md,aggregating-data.md,joining-data.md,mixing-data.md, andshuffling-data.md. Prose only, apart from one code fix:import osin the partitioned-write example, which usedoswithout importing it. No other code, testcode, code comments, or URLs changed.Stacked on #66419. Review and merge that stack first. This branch targets
doc-1524-data-style-loading. It's the third of several PRs that apply the same pass to the top-level Ray Data pages.All seven pages
(writing-data-to-files)=, so existing URL fragments keep resolving. Headings that already had a label keep it, with the new label stacked beneath. None of the new labels collide with existing ones.1..Google.Contractionsrule errors on the expanded forms.Page-specific changes
saving-data.md: Folds the opening heading preview into prose and adds a lead-in under the stacked H2. Fixes a Mars tab that said "convert a Dataset from a Mars DataFrame" forDataset.to_mars().inspecting-data.md: Adds the missing{meth}role onDataset.take_batch(), which rendered its angle brackets literally. Sentence-cases thePyArrowtab title.iterating-over-data.md: Adds the missing{meth}role on three method list items (iter_batches,iter_torch_batches, andto_tf) that had the same problem.aggregating-data.md: Replaces the marketing-style opening with a statement of what the page covers.joining-data.md: Replaces three bold pseudo-headings over one-item lists with one join-types list.mixing-data.md: Changes the optional repartitioning advice from anoteto atip, and makes the Limitations labels parallel.shuffling-data.md: Fixes the "read function function" typo, adds alt text to the push-based shuffle chart from the sentence that introduces it, and changes "(New in 2.46)" into a sentence.Other files
inspecting-data.md,iterating-over-data.md,shuffling-data.md, andtrain/user-guides/data-loading-preprocessing.rst. The matchingdataset.pydocstring edits are in [doc][data] Fix Ray Data docstring link text and stale default descriptions #66604.Questions for reviewers
These points need a Ray Data maintainer. Each one predates this PR unless noted.
shuffling-data.md): the note saysDataContext.use_push_based_shuffleandRAY_DATA_PUSH_BASED_SHUFFLEare deprecated in favor ofDataContext.shuffle_strategy, but the same section still tells you to set both, and its examples use them. Should the section move toShuffleStrategy?shuffling-data.md): the intro says the methods appear "in increasing order of resource consumption and runtime", but the page's own benchmark showsmap_batchesshuffle, which comes second, keeping more throughput than local buffer shuffle.shuffling-data.md): the key-based repartitioning item says it triggers a "hash-shuffle" operation, while the tip says it uses shuffle v2 by default and calls hash-shuffle the previous implementation.joining-data.md): "Settingmax_hash_shuffle_aggregators >= num_partitionsallocates one partition per aggregator." The page also says the count defaults to the smallest ofnum_partitions, the CPU count, and the cap, so on a cluster with fewer CPUs than partitions, raising the cap alone might not be enough.joining-data.md): the lead-in "Tune join performance ... with the following two parameters" includespartition_size_hint, which the page says Ray Data ignores.mixing-data.md): the random-mixing section says local batches are "each drawn from a single dataset", but an earlier note says a local batch might contain data from more than one input dataset.inspecting-data.md): the page says Ray Data persists execution statistics toray-data.log. The streaming executor logs the stats summary only whenDataContext.enable_auto_log_statsis set, andDEFAULT_AUTO_LOG_STATSisFalseincontext.py. Should the sentence name that condition?aggregating-data.md): the page saysAggregateFnV2has "three key methods that you implement", includingfinalize. Inaggregate.py, onlycombineandaggregate_blockare abstract.finalizehas a default, and the class docstring calls finalization optional.saving-data.md): "Your data must fit in memory on the head node" forto_pandas()might mean the driver's node.saving-data.md): "Support for this combination ends after February 2027." Please confirm the date.saving-data.mdcallgcsfsandadlfswithout importing them.inspecting-data.mdprints"Image shape"without the colon its output shows.shuffling-data.mdhas abashblock with$prompts and a plainpythonblock in the fallback tip.aggregating-data.mdanditerating-over-data.mduse{class}on methods (max,min,sum, andrandom_shuffle).aggregating-data.mdnote ends its fragment with a slash,#performance-benchmarks/.Verification
valewith Vale 3.12, run from the repo root: no warning- or error-level alerts on the seven pages.codespell: no hits.{meth}roles, and every target exists onray.data.Dataset. The only anchor changes are the added old-slug labels. None were removed.doc/sourcefor the label name in hyphen and underscore forms. None collide.AI assistance
I made these edits with AI assistance (Claude Code).
🤖 Generated with Claude Code