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

Add public enum for select-k algorithm selection #2046

Merged
merged 10 commits into from
Jan 10, 2024

Conversation

benfred
Copy link
Member

@benfred benfred commented Dec 7, 2023

Add an enum that controls which select-k algorithm is used. This takes the enum that was in the raft_internal and exposes in the public api. This lets users pick which select algorithm they want to use directly

Add an enum that controls with select-k algorithm is used.
This takes the enum that was in the raft_internal and expose
in the public api.  This lets users pick which select algorithm
they want to use directly
@benfred benfred requested a review from a team as a code owner December 7, 2023 00:50
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@benfred benfred marked this pull request as draft December 7, 2023 00:50
@github-actions github-actions bot added the cpp label Dec 7, 2023
@cjnolet cjnolet added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Dec 7, 2023
@benfred
Copy link
Member Author

benfred commented Dec 7, 2023

By adding all of the remaining different select-k variants to the matrix::select_k instantiations, this increases the libraft.so binary size from 425MB to 429MB (cuda11 x86_64). I think this is probably acceptable, given the alternative would be much more complex - @cjnolet @tfeher what are your thoughts here?

@benfred benfred marked this pull request as ready for review December 20, 2023 00:05
Copy link
Member

@cjnolet cjnolet left a comment

Choose a reason for hiding this comment

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

Wow, it's crazy how big the diff got for such a small change to the API.

The new enumeration uses its own vocabularu, which is not going to be immediately obvious to anyone outside of the RAFT development team so we should briefly summarize.

Otherwise, it all looks great to me!

@@ -76,6 +77,8 @@ namespace raft::matrix {
* whether to select k smallest (true) or largest (false) keys.
* @param[in] sorted
* whether to make sure selected pairs are sorted by value
* @param[in] algo
* the selection algorithm to use
Copy link
Member

Choose a reason for hiding this comment

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

Can we expand the algorithms here a bit to give a brief summary of what they mean? I expect this API to be used mostly by power users, but I can't imagine even power users (outside of RAFT immediate developers) would be able to use these options without a brief description and summary of why each might be used. It's also a great opportunity to add the "see also" for the air-top-k paper.

Copy link
Member

@cjnolet cjnolet left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks Ben!

@cjnolet
Copy link
Member

cjnolet commented Jan 10, 2024

/merge

@rapids-bot rapids-bot bot merged commit 26d310b into rapidsai:branch-24.02 Jan 10, 2024
61 checks passed
@benfred benfred deleted the select_k_enum branch January 10, 2024 18:14
ChristinaZ pushed a commit to ChristinaZ/raft that referenced this pull request Jan 17, 2024
Add an enum that controls which select-k algorithm is used. This takes the enum that was in the raft_internal and exposes in the public api.  This lets users pick which select algorithm they want to use directly

Authors:
  - Ben Frederickson (https://github.com/benfred)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)

URL: rapidsai#2046
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cpp improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
Development

Successfully merging this pull request may close these issues.

3 participants