Skip to content

Use radix sort for float/double types #19137

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 11 commits into from
Jun 24, 2025

Conversation

davidwendt
Copy link
Contributor

@davidwendt davidwendt commented Jun 11, 2025

Description

Use a custom decomposer on the CUB radix sort APIs to influence NaN behavior for sorting floats in libcudf.
This is for cudf::sorted_order(). A follow-on PR will address cudf::sort.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@davidwendt davidwendt self-assigned this Jun 11, 2025
@davidwendt davidwendt added 2 - In Progress Currently a work in progress libcudf Affects libcudf (C++/CUDA) code. improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jun 11, 2025
Copy link

copy-pr-bot bot commented Jun 11, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@davidwendt
Copy link
Contributor Author

/ok to test

@davidwendt davidwendt added 3 - Ready for Review Ready for review by team and removed 2 - In Progress Currently a work in progress labels Jun 16, 2025
@davidwendt davidwendt changed the title Use radix sort for float/double types (experimental) Use radix sort for float/double types Jun 16, 2025
@davidwendt
Copy link
Contributor Author

/ok to test

@davidwendt
Copy link
Contributor Author

Significant performance improvement using radix sort for floats

## [0] NVIDIA RTX A6000

|  T  | stable | nulls | num_rows | cols |   Ref Time |   Cmp Time |           Diff |   %Diff |
|-----|--------|-------|----------|------|------------|------------|----------------|---------|
| F32 |   0    |   0   |  262144  |  1   | 322.647 us | 168.108 us |    -154.539 us | -47.90% |
| F32 |   1    |   0   |  262144  |  1   | 322.563 us | 167.250 us |    -155.314 us | -48.15% |
| F32 |   0    |   0   | 2097152  |  1   |   2.674 ms | 839.339 us |   -1834.595 us | -68.61% |
| F32 |   1    |   0   | 2097152  |  1   |   2.675 ms | 839.226 us |   -1835.679 us | -68.63% |
| F32 |   0    |   0   | 16777216 |  1   |  35.399 ms |   5.805 ms |  -29593.680 us | -83.60% |
| F32 |   1    |   0   | 16777216 |  1   |  35.403 ms |   5.807 ms |  -29595.568 us | -83.60% |
| F32 |   0    |   0   | 67108864 |  1   | 197.619 ms |  22.857 ms | -174762.562 us | -88.43% |
| F32 |   1    |   0   | 67108864 |  1   | 197.643 ms |  22.854 ms | -174788.901 us | -88.44% |

@davidwendt
Copy link
Contributor Author

/ok to test

@davidwendt
Copy link
Contributor Author

/ok to test

@davidwendt davidwendt marked this pull request as ready for review June 17, 2025 20:42
@davidwendt davidwendt requested a review from a team as a code owner June 17, 2025 20:42
Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. Two questions/comments.

@davidwendt
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 89f0abe into rapidsai:branch-25.08 Jun 24, 2025
91 checks passed
@davidwendt davidwendt deleted the float-sort branch June 24, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants