-
Notifications
You must be signed in to change notification settings - Fork 130
Add support for PQ preprocessing API #1278
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
base: branch-25.12
Are you sure you want to change the base?
Conversation
Signed-off-by: Mickael Ide <mide@nvidia.com>
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
@@ -0,0 +1,164 @@ | |||
/* | |||
* Copyright (c) 2024-2025, NVIDIA CORPORATION. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please only include the current year in new files
Signed-off-by: Mickael Ide <mide@nvidia.com>
pq_params.add_data_on_build = false; | ||
pq_params.max_train_points_per_pq_code = params.max_train_points_per_pq_code; | ||
|
||
auto pq_index = cuvs::neighbors::ivf_pq::build(res, pq_params, dataset); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried using ivf build + pq-centeres api to get the generated centroids as part of generating pq for diskann. It appears I get significant lower recall values. I think it because the pq strategy used by ivf has 2 quantizers and also ivf uses balanced kmeans which can lower the recall.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on my understanding, the current VPQ also has two quantizers. @lowener correct me if I am missing something, but based on what I had seen in DiskANN, the raw vectors are PQ quantized directly, there is no coarse quantizer (VQ centroids).
Signed-off-by: Mickael Ide <mide@nvidia.com>
Signed-off-by: Mickael Ide <mide@nvidia.com>
Signed-off-by: Mickael Ide <mide@nvidia.com>
Signed-off-by: Mickael Ide <mide@nvidia.com>
Signed-off-by: Mickael Ide <mide@nvidia.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved trivial CMake changes
Signed-off-by: Mickael Ide <mide@nvidia.com>
Signed-off-by: Mickael Ide <mide@nvidia.com>
Signed-off-by: Mickael Ide <mide@nvidia.com>
Signed-off-by: Mickael Ide <mide@nvidia.com>
Signed-off-by: Mickael Ide <mide@nvidia.com>
Signed-off-by: Mickael Ide <mide@nvidia.com>
Related issue: #107
This PR adds support for a PQ preprocessing API. It gives access to
train()
andtransform()
function that can be used to transform a dataset into PQ codes. It is re-using the VPQ functions from CAGRA-Q.