Add CAGRA build heuristics independent of HNSW parameters#2345
Open
achirkin wants to merge 2 commits into
Open
Add CAGRA build heuristics independent of HNSW parameters#2345achirkin wants to merge 2 commits into
achirkin wants to merge 2 commits into
Conversation
tfeher
requested changes
Jul 22, 2026
tfeher
left a comment
Contributor
There was a problem hiding this comment.
Thanks Artem, it makes sense to separate the dataset shape dependent CAGRA heuristics to general CAGRA heuristic and HNSW specific ones. The PR looks good to me, apart from two small docstring issues.
| * @param dataset The shape of the input dataset | ||
| * @param intermediate_graph_degree The intermediate (kNN) graph degree the build should target | ||
| * @param metric The distance metric to search | ||
| * @param build_quality Higher values increase the build quality (and cost) up to a point. |
Contributor
There was a problem hiding this comment.
What is the range of the values the user could provide here?
Comment on lines
+253
to
+255
| * @param graph_degree Degree of the output graph. | ||
| * @param metric The distance metric to search | ||
| * @param build_quality Higher values increase the build quality (and cost) up to a point. |
Contributor
There was a problem hiding this comment.
Please document valid range for build_quality. Also it would make sense to give a hint for graph_degree. E.g multiples of 32 is a good practice.
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.
Split the
cagra::index_params::from_hnsw_paramsinto a corecagra::index_params::from_datasetand a thin wrapper ``cagra::index_params::from_hnsw_params`. This solves two problems:The new parameter defaults are selected to yield exactly the same configurations at old call sites of
from_hnsw_params