ANN_BENCH: common AnnBase::index_type - #2315
Merged
rapids-bot[bot] merged 4 commits intoMay 15, 2024
Merged
Conversation
tfeher
approved these changes
May 15, 2024
tfeher
left a comment
Contributor
There was a problem hiding this comment.
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.
Contributor
Author
|
/merge |
loulankxh
pushed a commit
to loulankxh/raft
that referenced
this pull request
Oct 14, 2025
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. Authors: - Artem M. Chirkin (https://github.com/achirkin) Approvers: - Tamas Bela Feher (https://github.com/tfeher) URL: NVIDIA#2315
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Replace the
size_ttype in theAnnBase::searchfor the output neighbor indices with a commonAnnBase::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:
index_typemore clear in the code, distinguishing it from the extents type, which is usuallysize_tas well.uint32_tduring development and experiments. This is needed to avoid calling extralinalg::mapon the produced results when the algorithm output is not compatible withsize_t.As a small extra change, I've factored out common IVF-PQ - CAGRA-Q refinement code into a separate
refine_helperfunction.