Skip to content

[cherry-pick][2.58.0][Data] Update docs for hash shuffle v2 (#65372) in release 2.58 - #65612

Merged
elliot-barn merged 5 commits into
releases/2.58.0from
cherry-pick-2.58.0-shuffle-v2-docs
Aug 24, 2026
Merged

[cherry-pick][2.58.0][Data] Update docs for hash shuffle v2 (#65372) in release 2.58#65612
elliot-barn merged 5 commits into
releases/2.58.0from
cherry-pick-2.58.0-shuffle-v2-docs

Conversation

@owenowenisme

@owenowenisme owenowenisme commented Aug 20, 2026

Copy link
Copy Markdown
Member

Description

Backfill the doc of shuffle v2 into release 2.58 and use the name of hash_shuffle_v2 because the nameshuffle_v2 only exist on 2.58

This is a doc only changes so it's not blocking the PyPI release

Related issues

Link related issues: "Fixes #1234", "Closes #1234", or "Related to #1234".

Additional information

Optional: Add implementation details, API changes, usage examples, screenshots, etc.
(cherry picked from commit fd223b6)

@owenowenisme
owenowenisme requested review from a team as code owners August 20, 2026 08:17
@owenowenisme owenowenisme added docs An issue or change related to documentation data Ray Data-related issues docs-go RtD-only checks for docs-only changes. Doesn't run full library doc-test suites. labels Aug 20, 2026
owenowenisme and others added 3 commits August 20, 2026 16:18
(cherry picked from commit fd223b6)
Signed-off-by: You-Cheng Lin <mses010108@gmail.com>
## Summary

Three claims on the Ray Data join and save pages don't match the code.
This PR corrects only those claims, deliberately leaving the surrounding
prose alone so the diff is small enough to review as a technical
question rather than a wording one.

Each correction is cited below. I don't own Ray Data, so please check
the reasoning rather than the phrasing.

## 1. `saving-data.rst` sets the shuffle strategy on the class, not the
context

```python
DataContext.shuffle_strategy=ShuffleStrategy.SHUFFLE_V2   # before
DataContext.get_current().shuffle_strategy = ShuffleStrategy.SHUFFLE_V2   # after
```

`shuffle_strategy` is a `property` with a setter
(`python/ray/data/context.py`, the `@property` at ~L1246 and
`@shuffle_strategy.setter` at ~L1258). Assigning to it on the class
object rebinds the class attribute over the descriptor instead of
invoking the setter. Two consequences: the example never actually
selects the strategy it says it's selecting, and `shuffle_strategy`
stops working for every `DataContext` instance in that process.

This is a `testcode` block, so it runs in CI. Note that because the
assignment never took effect, the block has so far only ever exercised
the default `HASH_SHUFFLE`. With the fix it genuinely runs `SHUFFLE_V2`
for the first time. I don't have a Ray build locally, so **please
confirm that job passes** rather than taking my word for it. If
`SHUFFLE_V2` isn't ready to be load-bearing in a doctest, setting
`HASH_SHUFFLE` on `get_current()` would fix the descriptor bug without
that exposure.

@gemini-code-assist flagged this on two separate passes (#65372); the
value got updated to `SHUFFLE_V2` but the receiver didn't.

## 2. `partition_size_hint` is documented as a live tuning parameter

The page described it as `(optional)`, gave it a default of
`DataContext.target_max_block_size`, and offered two bullets on how to
size it for skew. But `Dataset.join` documents it as "**Deprecated** and
ignored ... This parameter has no effect and will be removed in a future
release" (`python/ray/data/dataset.py` ~L3601), and passing a value
emits a `DeprecationWarning` (~L3712).

So the guidance told readers how to tune something inert. I removed the
sizing advice rather than rewriting it, since there's nothing to tune.

The page also said "Expect this parameter to be deprecated in 2.58."
That deprecation has already landed, so the sentence was predicting the
past.

## 3. The aggregator pool doesn't default to 64

The page said "Defaults to 64 or `num_partitions` (in cases when there
are less than 64 partitions)."

From `_derive_max_shuffle_aggregators` and its caller in
`python/ray/data/_internal/execution/operators/hash_shuffle.py` (~L485
and ~L591):

```
num_aggregators = min(target_num_partitions, max_shuffle_aggregators)
max_shuffle_aggregators = min(ceil(total_cluster_cpu),
                              max_hash_shuffle_aggregators or DEFAULT_MAX_HASH_SHUFFLE_AGGREGATORS)
```

`DEFAULT_MAX_HASH_SHUFFLE_AGGREGATORS` is 128 (`context.py` ~L128). So
the cap is 128 rather than 64, and there's a cluster-CPU bound the page
never mentioned.

**One thing worth a maintainer's eye:** the comment on the
`max_hash_shuffle_aggregators` field (`context.py` ~L886) says the unset
default is the smaller of "Total # of CPUs available in the cluster * 2"
and 128. The code has no `* 2`. I documented the code, not the comment,
but one of the two is stale and I can't tell which is intended.

## Out of scope

These pages have wider style and prose issues, plus a genuine RST
rendering bug in the join-type lists. Those are handled separately in
#65374 so this PR stays reviewable as a technical correction. #65374
touches the same region of `joining-data.rst`, so whichever merges
second needs a trivial rebase.

Signed-off-by: Douglas Strodtman <douglas@anyscale.com>
(cherry picked from commit a74234c)
Signed-off-by: You-Cheng Lin <mses010108@gmail.com>
Signed-off-by: You-Cheng Lin <mses010108@gmail.com>
@owenowenisme
owenowenisme force-pushed the cherry-pick-2.58.0-shuffle-v2-docs branch from 1565811 to 746051b Compare August 20, 2026 08:18

@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 updates the Ray Data documentation to introduce and detail the new Shuffle v2 (ShuffleStrategy.HASH_SHUFFLE_V2) backend, which is currently in Alpha. It explains the driver-driven architecture of Shuffle v2, its benefits (such as disk spilling and adaptive memory sizing), supported operations, and configuration/tuning knobs like input batch size and inline object threshold. Additionally, the documentation deprecates partition_size_hint in joins, updates the default aggregator pool size logic, and deprecates DataContext.use_push_based_shuffle in favor of configuring the shuffle strategy directly. There are no review comments, and I have no feedback to provide.

@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.

Stamp

@sai-miduthuri sai-miduthuri changed the title [Data] Update docs for hash shuffle v2 (#65372) in release 2.58 [cherry-pick][Data] Update docs for hash shuffle v2 (#65372) in release 2.58 Aug 20, 2026
@sai-miduthuri sai-miduthuri changed the title [cherry-pick][Data] Update docs for hash shuffle v2 (#65372) in release 2.58 [cherry-pick][2.58.0][Data] Update docs for hash shuffle v2 (#65372) in release 2.58 Aug 20, 2026
@sai-miduthuri sai-miduthuri added the go add ONLY when ready to merge, run all tests label Aug 20, 2026
@owenowenisme owenowenisme removed the docs-go RtD-only checks for docs-only changes. Doesn't run full library doc-test suites. label Aug 20, 2026
@elliot-barn
elliot-barn merged commit e83929a into releases/2.58.0 Aug 24, 2026
6 checks passed
@elliot-barn
elliot-barn deleted the cherry-pick-2.58.0-shuffle-v2-docs branch August 24, 2026 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data Ray Data-related issues docs An issue or change related to documentation go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants