Repository navigation
[Data]Implement Join on hash shuffle v2 - #64538
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the shuffle execution framework to support multi-input shuffle reduce operations, enabling a new V2 shuffle-based join implementation. Key changes include modifying ShuffleReduceOp to accept multiple upstream ShuffleMapOp inputs, updating the reduce task to process lists of tables grouped by input, and planning joins using the new shuffle path. The review feedback highlights a critical issue where incremental_resource_usage underestimates peak memory for multi-input shuffles by only considering the first dependency, which could lead to out-of-memory errors. Additionally, defensive checks are recommended in hash_shuffle_v2.py to prevent potential IndexErrors when accessing tables_by_input.
Generalize ShuffleReduceOp / _shuffle_reduce_task to N co-partitioned inputs (pairing per (partition, input), all-inputs-done flush, tables_by_input). This is now based on master after ray-project#64481, so the PR carries only multi-input support and not the streaming-reduce removal. Signed-off-by: You-Cheng Lin <[email protected]>
Signed-off-by: You-Cheng Lin <[email protected]>
Signed-off-by: You-Cheng Lin <[email protected]>
dccf2a9 to
720d787
Compare
…fle-reduce # Conflicts: # python/ray/data/_internal/execution/operators/hash_shuffle_v2.py # python/ray/data/_internal/execution/operators/shuffle_operators/shuffle_reduce_operator.py # python/ray/data/tests/test_hash_shuffle_v2.py
Signed-off-by: You-Cheng Lin <[email protected]> (cherry picked from commit bb429a4)
Signed-off-by: You-Cheng Lin <[email protected]>
Signed-off-by: You-Cheng Lin <[email protected]>
| assert op0_output == op1_input | ||
|
|
||
|
|
||
| def test_sub_operator_num_rows(shutdown_only): |
There was a problem hiding this comment.
Removing this because we don't have sub operator in join after this pr
| return tables | ||
|
|
||
|
|
||
| @ray.remote(max_calls=1) |
There was a problem hiding this comment.
Removing this because worker restart can have huge regression with small dataset & inadequate resource.
The OOM of shuffle previously is mainly from mixing shuffle map tasks and other tasks not from reducer. So this is fine
Signed-off-by: You-Cheng Lin <[email protected]>
|
@cursor review |
Signed-off-by: You-Cheng Lin <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit fd3f539. Configure here.
Signed-off-by: You-Cheng Lin <[email protected]>
Signed-off-by: You-Cheng Lin <[email protected]>
Signed-off-by: You-Cheng Lin <[email protected]>
|
Ran the TPC-H q21 release test since its workload is heavier. tpch21: 453.3s → 408.2s (≈10% runtime reduction) The gain is modest here because memory isn't a bottleneck in this test and the aggregation still runs on v1 shuffle. We expect a larger improvement once aggregation on v2 lands as well. |
There was a problem hiding this comment.
LGTM, only stylistic comments. My only hesitation is if we should first enable it off-by-default until we validate with some users. The baseline stability of the existing join/hash shuffle is a bit suspect though, so personally I'm OK with turning this on by default from the get-go assuming that release tests are stable.
@goutamvenkat-anyscale @bveeramani LMK what you think.
Signed-off-by: You-Cheng Lin <[email protected]>
Signed-off-by: You-Cheng Lin <[email protected]>
Signed-off-by: You-Cheng Lin <[email protected]>
0eb06e7 to
953cf2f
Compare
Signed-off-by: You-Cheng Lin <[email protected]>
…orker kill on map_groups_autoscaling release test (#64737) ## Description The `map_groups_autoscaling_hash_shuffle_*` nightly release test started failing with worker OOM kills on `_shuffle_reduce_task`, beginning after #64538, which removed setting `max_calls=1` on the remote task to alleviate the performance regressions on join tests. In order to circumvent this issue, we can give reduce tasks their own dedicated worker pool via `runtime_env` We isolate the shuffle reduce tasks into running on their own pool of workers (mirroring the same isolation done on the shuffle map tasks in https://github.com/ray-project/ray/blob/bb3934d01ca5bd4c88cc66326a32e7c364ffeff9/python/ray/data/_internal/execution/operators/hash_shuffle_v2.py#L15) ## Related issues ## Additional information --------- Signed-off-by: Ayush Kumar <[email protected]>
## Description Implement joins on top of the shuffle v2, no additional tests added because we're using the old test. ## Related issues > Link related issues: "Fixes ray-project#1234", "Closes ray-project#1234", or "Related to ray-project#1234". ## Additional information > Optional: Add implementation details, API changes, usage examples, screenshots, etc. --------- Signed-off-by: You-Cheng Lin <[email protected]> Signed-off-by: You-Cheng Lin <[email protected]> Signed-off-by: 400Ping <[email protected]>
…orker kill on map_groups_autoscaling release test (ray-project#64737) ## Description The `map_groups_autoscaling_hash_shuffle_*` nightly release test started failing with worker OOM kills on `_shuffle_reduce_task`, beginning after ray-project#64538, which removed setting `max_calls=1` on the remote task to alleviate the performance regressions on join tests. In order to circumvent this issue, we can give reduce tasks their own dedicated worker pool via `runtime_env` We isolate the shuffle reduce tasks into running on their own pool of workers (mirroring the same isolation done on the shuffle map tasks in https://github.com/ray-project/ray/blob/bb3934d01ca5bd4c88cc66326a32e7c364ffeff9/python/ray/data/_internal/execution/operators/hash_shuffle_v2.py#L15) ## Related issues ## Additional information --------- Signed-off-by: Ayush Kumar <[email protected]> Signed-off-by: 400Ping <[email protected]>

Description
Implement joins on top of the shuffle v2, no additional tests added because we're using the old test.
Related issues
Additional information