Skip to content

Common knn graph build params #949

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

Open
wants to merge 8 commits into
base: branch-25.08
Choose a base branch
from

Conversation

jinsolp
Copy link
Contributor

@jinsolp jinsolp commented May 28, 2025

Reusing graph build params for cagra and all neighbors.
Related issue: #931

@jinsolp jinsolp requested review from a team as code owners May 28, 2025 02:23
@jinsolp jinsolp self-assigned this May 28, 2025
@jinsolp jinsolp added non-breaking Introduces a non-breaking change improvement Improves an existing functionality labels May 28, 2025
@@ -0,0 +1,78 @@
/*
Copy link
Member

Choose a reason for hiding this comment

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

cuVS isn't header-only, so the header files are very lightweight. Instead of introducing new headers for structs and enums, can we just reuse common.hpp?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

common.hpp has the base index_params (link), so declaring graph_build_params in that file results in a circular dependency (because we make use of ivf_pq::index_params and nn_descent::index_params inside `graph_build_params)

struct ivf_pq_params {
cuvs::neighbors::ivf_pq::index_params build_params;
cuvs::neighbors::ivf_pq::search_params search_params;
float refinement_rate = 2.0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the default value 1 or 2?

Copy link
Contributor Author

@jinsolp jinsolp Jun 5, 2025

Choose a reason for hiding this comment

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

That's a bit tricky here... cagra uses the ivf_pq_params() constructor and expects a default refinement rate of 1.0, whereas all neighbors expects a default refinement rate of 2.0.

I agree that this is confusing. Maybe we should set the default to 1.0 and make changes from the all neighbors usage.

@jinsolp
Copy link
Contributor Author

jinsolp commented Jun 10, 2025

@lowener Changed defaults. Ready for another round of reviews : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake cpp improvement Improves an existing functionality non-breaking Introduces a non-breaking change
Projects
Development

Successfully merging this pull request may close these issues.

3 participants