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

ANN_BENCH: common AnnBase::index_type #2315

Merged
merged 4 commits into from
May 15, 2024

Conversation

achirkin
Copy link
Contributor

@achirkin achirkin commented May 14, 2024

Replace the size_t type in the AnnBase::search for the output neighbor indices with a common AnnBase::index_type.
This PR stops short of changing the behavior of the benchmarks, since it keeps using index_type = size_t.

The introduction of the new type has couple benefits:

  • Makes the usage of the index_type more clear in the code, distinguishing it from the extents type, which is usually size_t as well.
  • Makes it possible to quickly change the alias to uint32_t during development and experiments. This is needed to avoid calling extra linalg::map on the produced results when the algorithm output is not compatible with size_t.

As a small extra change, I've factored out common IVF-PQ - CAGRA-Q refinement code into a separate refine_helper function.

@achirkin achirkin added 3 - Ready for Review improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels May 14, 2024
@achirkin achirkin requested a review from a team as a code owner May 14, 2024 13:26
@github-actions github-actions bot added the cpp label May 14, 2024
Copy link
Contributor

@tfeher tfeher left a comment

Choose a reason for hiding this comment

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

Thanks Artem for the PR, it is nice to have an easy way to change index type in the benchmarks. ! It is great to have the helper function for refinement. LGTM.

@achirkin
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit eb1333d into rapidsai:branch-24.06 May 15, 2024
69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review cpp improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
Development

Successfully merging this pull request may close these issues.

2 participants