-
Notifications
You must be signed in to change notification settings - Fork 72
[Review] Add fast path for multi-column sorting #229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5ad586d
add fast path for multi-column sorting
quasiben 8fc9a7b
lint
quasiben ac7bad8
Merge remote-tracking branch 'upstream/main' into multi-col-sort
charlesbluca c86cdab
Prevent single column Dask dataframes from calling sort_values
charlesbluca d321ca3
Wrap dask_cudf import in try/except block
charlesbluca ed65228
Add test for fast multi column sort
charlesbluca 76eb2aa
Move multi_col_sort contents to apply_sort
charlesbluca 927c618
Ignore index for dask-cudf sorting
charlesbluca 963ad5e
Fix show tables test for cudf enabled fixture
charlesbluca 5fb3c41
Trigger CI
charlesbluca 645eebf
Add single partition sort case
charlesbluca 2e65ca8
Return cudf sorted dataframe without persisting
charlesbluca 49d6cf2
Update nan sort test to reflect Pandas' sort_values ordering
charlesbluca d55fc84
Add comments tracking relevant [dask-]cudf issues
charlesbluca 55f7725
Merge remote-tracking branch 'upstream/main' into multi-col-sort
charlesbluca a185755
Move GPU sorting tests to test_sort.py
charlesbluca 9f4868c
Remove unnecessary isin import
charlesbluca File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really not a fan of these single partition checks, but this is reflective of cuDF's
sort_values
behavior, which can only do:ascending
with no support forna_position
ascending
with support forna_position
Ideally we would want cuDF to match Pandas' behavior and support
na_position
when providing a list forascending
, which would simplify this whole block to:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you include these comments in the code so we can go back an fix at a later date. Also, can you file an issue with cuDF to help track support for
na_position
with a list for ascending ? Hmm, are these cudf or dask-cudf issues ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are cuDF specific - right now ascending sort / null positioning are still WIP in dask-cudf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right. Ok, then maybe comments with links to those PRs and we can continue iterating
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also something that might be worth discussing is the eventual upstreaming of this logic - in the long run, it might make sense to have these
map_partition
calls done implicitly indf.sort_values
if we see thatdf.npartitions == 1
. This would allow us to simplify the logic here to just a singlesort_values
call that is optimal regardless of partition count.I discussed that possibility for Dask briefly here:
dask/dask#8225 (comment)