Skip to content

[Data] Add batch_size = 'auto' to the map_batches API, to determine batch row count from target row batch size - #62648

Merged
bveeramani merged 26 commits into
ray-project:masterfrom
ayushk7102:auto_batch_size
Apr 20, 2026
Merged

bveeramani merged 26 commits into
ray-project:masterfrom
ayushk7102:auto_batch_size

Conversation

@ayushk7102

Copy link
Copy Markdown
Contributor

Description

Passing large batches to UDFs can increase the memory pressure on workers and increase the risk of OOMs. Currently, the default batch size is None, which passes entire 128 MiB blocks to the UDFs as batches. This PR proposes an 'auto' parameter to automatically resolve the number of rows in batch at runtime, to maintain default_batch_size_bytes in a batch, which is configured to 16 MiB for now. We choose 16 MiB because of throughput/memory tradeoffs seen in experimental benchmarks, which we are working on expanding.

Implementation Details

File Change
context.py Added default_batch_size_bytes field (default 16 MiB) to DataContext
map_transformer.py Added _compute_auto_batch_size and updated _pre_process in BatchMapTransformFn
map_operator.py Extended MapBatches.batch_size type to accept "auto"
dataset.py Exposed "auto" in map_batches signature; min_rows_per_bundled_input=None for auto

At a high level, the 'auto' keyword functions by resolving the batch size of the map batches operator at execution time, rather than planning time, based on the estimated workload size (by consuming the first block in the dataset).

Concerns

  • We need to maintain the current default of batch_size=None consuming entire blocks as batches
  • Variability in the distribution of data size, especially due to variable length types, can throw off our estimate of the right row count
  • Optimal batch size is workload dependent and we still need to profile to see if this 16MiB batch size provides reasonable performance tradeoffs for all workloads

@ayushk7102
ayushk7102 requested a review from a team as a code owner April 16, 2026 00:11
@ayushk7102 ayushk7102 added the go add ONLY when ready to merge, run all tests label Apr 16, 2026

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces an 'auto' batch size option for map_batches and other batch-based operators in Ray Data. This feature dynamically calculates an appropriate batch size by peeking at the first block of data and comparing its memory footprint to a new configurable default (DEFAULT_BATCH_SIZE_BYTES, set to 16 MiB). The changes span the DataContext, logical operators, and the execution layer's MapTransformer. One critical piece of feedback identifies a potential ZeroDivisionError in the batch size calculation logic if a block contains rows but reports a size of zero bytes.

@ayushk7102
ayushk7102 marked this pull request as draft April 16, 2026 00:15
@ayushk7102
ayushk7102 marked this pull request as ready for review April 16, 2026 17:56
@ray-gardener ray-gardener Bot added the data Ray Data-related issues label Apr 16, 2026
# to call `map_groups` with GPUs, we need a separate method that doesn't
# perform batch size validation.

if batch_size == "default":

@rayhhome rayhhome Apr 16, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep this if statement just to make sure users still using "default" still get a fallback? The new code would have min_rows_per_bundled_input be "default" after the if-else block. (Same for the other places where the "default" checks are removed)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will defer to the others on this -- we deprecated "default" in September 2025. @bveeramani good to keep it still?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should nuke "default". Responsible thing would be in a separate PR to keep the scope of this PR small an keep the git blame clean

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will keep this in mind!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deprecating default will be a follow up PR

Comment thread python/ray/data/dataset.py Resolved

@rayhhome rayhhome left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments!

Comment thread python/ray/data/dataset.py Resolved

@bveeramani bveeramani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation LGTM.

Main comments are around readability of tests, splitting out default batch size removal, and updating the existing release tests rather than adding new ones

Comment thread release/release_data_tests.yaml Resolved
Comment thread release/release_data_tests.yaml Outdated

# Same as above but with batch_size="auto" on the two CPU stages (gen_data, cpu_process).
# GPU stage batch size stays fixed (memory constraint).
- name: heterogeneous_memory_batch_inference_auto_cpu

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here and elsewhere. Can do in separate follow up PR if you want to keep the scope small

# to call `map_groups` with GPUs, we need a separate method that doesn't
# perform batch size validation.

if batch_size == "default":

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should nuke "default". Responsible thing would be in a separate PR to keep the scope of this PR small an keep the git blame clean

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 4f8a1568b272850e70f21587bb1362a054091e77. Configure here.

ayushk7102 and others added 14 commits April 17, 2026 15:03
Signed-off-by: Ayush Kumar <[email protected]>
Adds four control test variants alongside each auto batch size release test
so we can directly compare throughput and runtime between batch_size="auto"
and a fixed/default batch size on the same cluster configuration.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Signed-off-by: Ayush Kumar <[email protected]>
ayushk7102 and others added 7 commits April 17, 2026 15:03
- Use Arrow tables directly (no pandas roundtrip) with hardcoded byte values
- Track batch sizes via UDF side effects instead of output block structure
- Inline test construction per reviewer feedback (no _make_transformer helper)
- Remove vacuous tests that always passed due to output block sizing

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Signed-off-by: Ayush Kumar <[email protected]>

@bveeramani bveeramani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⠀⠀⢀⣴⣿⣿⣷⣦⣌⠛⢦⡀⠀⠈⠓⢦⣀⡀⠀⣸⣿⣿⣿⡀⠀
⠀⠀⡾⠋⠉⢿⣿⣿⡿⠟⠦⣝⡲⣄⣀⠀⠈⠉⠉⣽⡿⢿⣿⡇⠀
⠀⠀⣷⠀⣠⣿⡿⠋⠀⠀⣶⢤⣙⠳⢭⣙⠲⠤⠴⠋⠑⠀⠁⣧⠀
⠀⠀⢸⡼⠛⠛⠀⠀⠀⣼⠉⢿⣿⣧⣶⡿⠛⠶⢤⣀⠀⠀⠀⣻⠀
⠀⠀⢨⡇⠀⠀⠀⠀⠀⠈⠉⠉⢸⡟⣺⠃⠀⠀⠀⠈⠙⠲⠶⠋⠀
⠀⠀⣸⠁⠀⠀⠀⠀⠀⢀⡀⠀⢸⡷⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⣰⠃⠀⠀⠀⠠⣄⡀⠀⠉⣳⣼⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣞⠁⠀⠲⣄⠀⠀⠀⠉⠉⡷⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣌⠳⣤⡀⠈⠓⠦⢤⡴⠚⠁⠀⠀⠀⠀⠀⣀⣀⡀⠀⠀⠀⠀⠀⠀
⣿⣷⣤⡿⢷⠀⣀⡴⣷⠒⠒⢒⣶⢤⠞⠉⠙⢻⣿⣷⣄⠀⠀⠀⠀
⠙⠻⣿⣷⠈⠛⠙⡇⣿⠀⠀⢯⣽⢿⠀⠀⠀⣴⠚⠉⠛⠀⠀⠀⠀
⣶⣆⠀⢹⣠⠶⣄⡇⢻⠛⠓⠒⠚⠋⠙⠓⠲⠮⠿⠆⠀⠀⠀⠀⠀
⣿⣿⠀⢸⠙⠒⢃⣇⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

@bveeramani
bveeramani enabled auto-merge (squash) April 20, 2026 21:11
@bveeramani
bveeramani merged commit 99e1281 into ray-project:master Apr 20, 2026
4 checks passed
HLDKNotFound pushed a commit to chichic21039/ray that referenced this pull request Apr 22, 2026
…atch row count from target row batch size (ray-project#62648)

## Description
Passing large batches to UDFs can increase the memory pressure on
workers and increase the risk of OOMs. Currently, the default batch size
is None, which passes entire 128 MiB blocks to the UDFs as batches. This
PR proposes an `'auto'` parameter to automatically resolve the number of
rows in batch at runtime, to maintain `default_batch_size_bytes` in a
batch, which is configured to `16 MiB` for now. We choose `16 MiB`
because of throughput/memory tradeoffs seen in experimental benchmarks,
which we are working on expanding.

## Implementation Details
| File | Change |
|---|---|
| `context.py` | Added `default_batch_size_bytes` field (default 16 MiB)
to `DataContext` |
| `map_transformer.py` | Added `_compute_auto_batch_size` and updated
`_pre_process` in `BatchMapTransformFn` |
| `map_operator.py` | Extended `MapBatches.batch_size` type to accept
`"auto"` |
| `dataset.py` | Exposed `"auto"` in `map_batches` signature;
`min_rows_per_bundled_input=None` for auto |

At a high level, the 'auto' keyword functions by resolving the batch
size of the map batches operator at execution time, rather than planning
time, based on the estimated workload size (by consuming the first block
in the dataset).

## Concerns
- We need to maintain the current default of `batch_size=None` consuming
entire blocks as batches
- Variability in the distribution of data size, especially due to
variable length types, can throw off our estimate of the right row count
- Optimal batch size is workload dependent and we still need to profile
to see if this `16MiB` batch size provides reasonable performance
tradeoffs for all workloads

---------

Signed-off-by: Ayush Kumar <[email protected]>
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Lucas61000 pushed a commit to Lucas61000/ray that referenced this pull request May 15, 2026
…atch row count from target row batch size (ray-project#62648)

## Description
Passing large batches to UDFs can increase the memory pressure on
workers and increase the risk of OOMs. Currently, the default batch size
is None, which passes entire 128 MiB blocks to the UDFs as batches. This
PR proposes an `'auto'` parameter to automatically resolve the number of
rows in batch at runtime, to maintain `default_batch_size_bytes` in a
batch, which is configured to `16 MiB` for now. We choose `16 MiB`
because of throughput/memory tradeoffs seen in experimental benchmarks,
which we are working on expanding.

## Implementation Details
| File | Change |
|---|---|
| `context.py` | Added `default_batch_size_bytes` field (default 16 MiB)
to `DataContext` |
| `map_transformer.py` | Added `_compute_auto_batch_size` and updated
`_pre_process` in `BatchMapTransformFn` |
| `map_operator.py` | Extended `MapBatches.batch_size` type to accept
`"auto"` |
| `dataset.py` | Exposed `"auto"` in `map_batches` signature;
`min_rows_per_bundled_input=None` for auto |

At a high level, the 'auto' keyword functions by resolving the batch
size of the map batches operator at execution time, rather than planning
time, based on the estimated workload size (by consuming the first block
in the dataset).

## Concerns
- We need to maintain the current default of `batch_size=None` consuming
entire blocks as batches
- Variability in the distribution of data size, especially due to
variable length types, can throw off our estimate of the right row count
- Optimal batch size is workload dependent and we still need to profile
to see if this `16MiB` batch size provides reasonable performance
tradeoffs for all workloads

---------

Signed-off-by: Ayush Kumar <[email protected]>
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
dstrodtman added a commit that referenced this pull request Sep 30, 2026
)

## 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]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…-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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data Ray Data-related issues go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants