Repository navigation
[Data] enable GPU_SHUFFLE in grouped_data.py - #62410
Conversation
Signed-off-by: Lee Yang <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request introduces a should_sort parameter to the GPU shuffle implementation, enabling optional sorting of data by key columns during the shuffle process. Key changes include updating the BulkRapidsMPFShuffler to perform sorting before Arrow conversion, modifying the execution planner to propagate the sort flag, and ensuring cudf dataframes are converted to Arrow without preserving indices. Additionally, GPU_SHUFFLE is now correctly handled in the partition logic for map_groups. I have no feedback to provide.
Signed-off-by: Lee Yang <[email protected]>
311bcdb to
d24c001
Compare
Signed-off-by: Lee Yang <[email protected]>
Signed-off-by: Lee Yang <[email protected]>
Signed-off-by: Lee Yang <[email protected]>
Signed-off-by: Lee Yang <[email protected]>
Signed-off-by: Lee Yang <[email protected]>
Signed-off-by: Lee Yang <[email protected]>
| first_time = True | ||
| while not self.shuffler.finished() or first_time: | ||
| first_time = False |
There was a problem hiding this comment.
Why does this flag exist?
There was a problem hiding this comment.
this is emulating a do/while to fix a race condition where shuffler.finished() was true before entering the loop.
Signed-off-by: Lee Yang <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 1f3f526. Configure here.
| # partition id produces exactly one block, so downstream queues | ||
| # that require contiguous key ranges (e.g. ReorderingBundleQueue) | ||
| # don't stall. | ||
| block = pa.Table.from_pylist([], schema=self._arrow_schema) |
There was a problem hiding this comment.
_arrow_schema is None when actor receives no data
Medium Severity
self._arrow_schema is initialized to None and only set during insert_batch. When there are more GPU ranks than input blocks, the round-robin distribution in _add_input_inner means some actors never receive an insert_batch call. For those actors, self._arrow_schema remains None. When finish_and_extract encounters a zero-column partition on such an actor, pa.Table.from_pylist([], schema=None) produces a columnless table instead of an empty table with the correct schema, causing a schema mismatch with blocks from other actors.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 1f3f526. Configure here.
## Description This PR enables GPU_SHUFFLE in grouped_data.py, i.e. `groupby()`. The `map_groups()` is still left on CPU for now. ## Related issues Related to ray-project#61371 ## Additional information - Also adds `should_sort` argument to the GPU shuffle path so the groups are correctly ordered. - Fixes a bug in test_gpu_shuffle.py --------- Signed-off-by: Lee Yang <[email protected]> Co-authored-by: Goutam <[email protected]>
## Description This PR enables GPU_SHUFFLE in grouped_data.py, i.e. `groupby()`. The `map_groups()` is still left on CPU for now. ## Related issues Related to ray-project#61371 ## Additional information - Also adds `should_sort` argument to the GPU shuffle path so the groups are correctly ordered. - Fixes a bug in test_gpu_shuffle.py --------- Signed-off-by: Lee Yang <[email protected]> Co-authored-by: Goutam <[email protected]>


Description
This PR enables GPU_SHUFFLE in grouped_data.py, i.e.
groupby(). Themap_groups()is still left on CPU for now.Related issues
Related to #61371
Additional information
should_sortargument to the GPU shuffle path so the groups are correctly ordered.