[Data] Skip unconditional null strip in find_partition_index#62594
Merged
goutamvenkat-anyscale merged 3 commits intoApr 14, 2026
Merged
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
793d4bb to
486dfdf
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 486dfdfbdaca9fd15634dabfb3a7f5c7806ca706. Configure here.
486dfdf to
7464f32
Compare
Signed-off-by: You-Cheng Lin <mses010108@gmail.com>
goutamvenkat-anyscale
approved these changes
Apr 14, 2026
HLDKNotFound
pushed a commit
to chichic21039/ray
that referenced
this pull request
Apr 22, 2026
…roject#62594) ## Description `find_partition_index` was changed to unconditionally run pd.isna(col_vals) + boolean indexing on every iteration to strip nulls. This is O(n) with an array allocation on every call, and find_partition_index is called O(blocks × boundaries × columns) times during the sort-shuffle map phase. For SF100 with no nulls (the common case), this added ~10k+ unnecessary allocations per task, causing map tasks to regress from ~3-4 min to ~5-6 min (~50% slower). Fix: use Arrow's O(1) column.null_count to skip the expensive path when there are no nulls. ### Release test result Regressed runtime: 600+ seconds ``` Result of case main: {'time': 380.45604542899997, 'object_store_spilled_total_gb': 0.0, 'sf': '100', 'group_by': ['column08', 'column13', 'column14'], 'shuffle_strategy': 'sort_shuffle_pull_based', 'aggregate': True, 'map_groups': False} -- Finished benchmark, metrics exported to '/tmp/release_test_out.json': { "main": { "time": 424.48728577200006, "object_store_spilled_total_gb": 0.0, "sf": "100", "group_by": [ "column08", "column13", "column14" ], "shuffle_strategy": "sort_shuffle_pull_based", "aggregate": true, "map_groups": false } } ``` ## 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 <mses010108@gmail.com>
Lucas61000
pushed a commit
to Lucas61000/ray
that referenced
this pull request
May 15, 2026
…roject#62594) ## Description `find_partition_index` was changed to unconditionally run pd.isna(col_vals) + boolean indexing on every iteration to strip nulls. This is O(n) with an array allocation on every call, and find_partition_index is called O(blocks × boundaries × columns) times during the sort-shuffle map phase. For SF100 with no nulls (the common case), this added ~10k+ unnecessary allocations per task, causing map tasks to regress from ~3-4 min to ~5-6 min (~50% slower). Fix: use Arrow's O(1) column.null_count to skip the expensive path when there are no nulls. ### Release test result Regressed runtime: 600+ seconds ``` Result of case main: {'time': 380.45604542899997, 'object_store_spilled_total_gb': 0.0, 'sf': '100', 'group_by': ['column08', 'column13', 'column14'], 'shuffle_strategy': 'sort_shuffle_pull_based', 'aggregate': True, 'map_groups': False} -- Finished benchmark, metrics exported to '/tmp/release_test_out.json': { "main": { "time": 424.48728577200006, "object_store_spilled_total_gb": 0.0, "sf": "100", "group_by": [ "column08", "column13", "column14" ], "shuffle_strategy": "sort_shuffle_pull_based", "aggregate": true, "map_groups": false } } ``` ## 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 <mses010108@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
find_partition_indexwas changed to unconditionally run pd.isna(col_vals) + boolean indexing on every iteration to strip nulls.This is O(n) with an array allocation on every call, and find_partition_index is called O(blocks × boundaries × columns) times during the sort-shuffle map phase. For SF100 with no nulls (the common case), this added ~10k+ unnecessary allocations per task, causing map tasks to regress from ~3-4 min to ~5-6 min (~50% slower).
Fix: use Arrow's O(1) column.null_count to skip the expensive path when there are no nulls.
Release test result
Regressed runtime: 600+ seconds
Related issues
Additional information