Skip to content
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

Convert rank to use to experimental row comparators #12481

Merged
merged 22 commits into from
Feb 8, 2023

Conversation

divyegala
Copy link
Member

@divyegala divyegala commented Jan 5, 2023

Description

Converts the rank function to use experimental row comparators, which support list and struct types. Part of #11844.

Throughput benchmarks are available below. It seems like when size_bytes is constrained, the generator generates fewer rows in list types for increasing depths. That's why, depth=4 has a higher throughput than depth=1 because the number of leaf elements generated are the same, but with much fewer rows.

Checklist

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

@divyegala divyegala added feature request New feature or request non-breaking Non-breaking change labels Jan 5, 2023
@github-actions github-actions bot added the libcudf Affects libcudf (C++/CUDA) code. label Jan 5, 2023
@codecov
Copy link

codecov bot commented Jan 5, 2023

Codecov Report

❗ No coverage uploaded for pull request base (branch-23.04@291c751). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@               Coverage Diff               @@
##             branch-23.04   #12481   +/-   ##
===============================================
  Coverage                ?   85.81%           
===============================================
  Files                   ?      158           
  Lines                   ?    25153           
  Branches                ?        0           
===============================================
  Hits                    ?    21586           
  Misses                  ?     3567           
  Partials                ?        0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@divyegala divyegala marked this pull request as ready for review January 31, 2023 18:25
@divyegala divyegala requested a review from a team as a code owner January 31, 2023 18:25
@divyegala divyegala requested review from bdice and nvdbaranec January 31, 2023 18:25
@divyegala divyegala requested review from a team as code owners February 1, 2023 00:09
@divyegala divyegala requested review from vyasr and removed request for a team February 1, 2023 00:09
@github-actions github-actions bot added ci CMake CMake build issue labels Feb 1, 2023
@divyegala divyegala changed the base branch from branch-23.02 to branch-23.04 February 1, 2023 00:09
@divyegala divyegala removed request for a team and vyasr February 1, 2023 00:10
@github-actions github-actions bot removed ci Java Affects Java cuDF API. Python Affects Python cuDF API. labels Feb 1, 2023
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.

Looks good overall. The actual comparator changes were fairly small, so the bulk of it is benchmarks and tests.

Can you post a benchmark result comparing the throughput (GB/s) of ranking lists of ints/floats to ranking plain ints or floats?

cpp/benchmarks/sort/nested_types_common.hpp Outdated Show resolved Hide resolved
cpp/benchmarks/sort/rank_lists.cpp Outdated Show resolved Hide resolved
cpp/tests/sort/rank_test.cpp Outdated Show resolved Hide resolved
cpp/tests/sort/rank_test.cpp Outdated Show resolved Hide resolved
@divyegala
Copy link
Member Author

divyegala commented Feb 3, 2023

Throughput: (GB/s)
int, rank_method::FIRST, null_frequency=0.2:

   nulls_type  size_bytes  throughput
0    no_nulls        4096    0.067143
1    no_nulls       16384    0.270018
2    no_nulls      131072    1.008052
3    no_nulls     1048576    7.954703
4    no_nulls     8388608   17.807422
5    no_nulls    67108864   17.511224
6    no_nulls   268435456   17.633304
7       nulls        4096    0.041735
8       nulls       16384    0.092360
9       nulls      131072    0.522772
10      nulls     1048576    2.862868
11      nulls     8388608    1.865691
12      nulls    67108864    1.905172
13      nulls   268435456    1.883955

List<int>, rank_method::FIRST:

    null_frequency  depth  size_bytes  throughput
0              0.0      1        1024    0.001656
1              0.0      1      262144    0.119881
2              0.0      1    16777216    0.322392
3              0.0      1   268435456    0.219398
4              0.0      4        1024    0.001183
5              0.0      4      262144    0.102692
6              0.0      4    16777216    1.481422
7              0.0      4   268435456    1.318262
8              0.2      1        1024    0.001730
9              0.2      1      262144    0.118890
10             0.2      1    16777216    0.439320
11             0.2      1   268435456    0.313680
12             0.2      4        1024    0.001368
13             0.2      4      262144    0.123197
14             0.2      4    16777216    1.981596
15             0.2      4   268435456    2.129115

@bdice
Copy link
Contributor

bdice commented Feb 3, 2023

It surprises me that lists of depth 4 achieve a higher throughput than lists of depth 1. Can you verify that result or comment on why you think that is happening? Are the "size_bytes" including list offsets, or just list contents (the leaf column of integers)?

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.

All looks good -- I'll approve after we make a small tweak to the benchmark axes.

cpp/benchmarks/sort/rank_lists.cpp Outdated Show resolved Hide resolved
cpp/benchmarks/sort/rank_lists.cpp Outdated Show resolved Hide resolved
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.

Looks good to me!

@bdice
Copy link
Contributor

bdice commented Feb 6, 2023

@divyegala Can you please tag the meta-issue #11844 in the description for all PRs that switch code to use experimental comparators? I edited the description for this PR.

@bdice bdice changed the title rank to use to experimental row comparators Convert rank to use to experimental row comparators Feb 6, 2023
Copy link
Member

@PointKernel PointKernel left a comment

Choose a reason for hiding this comment

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

LGTM

@divyegala
Copy link
Member Author

/merge

@rapids-bot rapids-bot bot merged commit b87b64f into rapidsai:branch-23.04 Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake CMake build issue feature request New feature or request libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants