Skip to content

Use PQ API in CAGRA-Q + SCANN#1746

Merged
rapids-bot[bot] merged 21 commits intorapidsai:mainfrom
lowener:26.04-use-pq
Mar 13, 2026
Merged

Use PQ API in CAGRA-Q + SCANN#1746
rapids-bot[bot] merged 21 commits intorapidsai:mainfrom
lowener:26.04-use-pq

Conversation

@lowener
Copy link
Contributor

@lowener lowener commented Jan 27, 2026

Follow-up to the PQ PR #1278 .
Closes #1575
Closes #1747
This PR removes the need to compile multiple times the same code for PQ in CAGRA-Q and SCANN, removing code duplication and improving build time.
CAGRA-Q can't use the new public API since it is using half for its math type so an private API function is used.

A small test is added to SCANN to make sure that the returned index is not complete garbage but more testing should be done there. (Created issue #1747 to track this)

This PR saves ~2-3 Mb on libcuvs.so compiled on a single architecture (141 Mb -> 138Mb)

Signed-off-by: Mickael Ide <mide@nvidia.com>
Signed-off-by: Mickael Ide <mide@nvidia.com>
Signed-off-by: Mickael Ide <mide@nvidia.com>
@lowener lowener added improvement Improves an existing functionality non-breaking Introduces a non-breaking change C++ labels Jan 27, 2026
@rmaschal
Copy link
Contributor

rmaschal commented Jan 28, 2026

I know it's hard to test the recall of a ScaNN index, I apologize for that. I pulled this PR to test. Compared to main, recall looks overall the same, so no concern there, but there is a build time regression due to the two issues I mentioned in the comments.

Your prior PR #1278 improved PQ training quite a lot for ScaNN, thank you for that :) For larger dim datasets like LAION and OpenAI, it shaves 2-4s from the overall build time.

Signed-off-by: Mickael Ide <mide@nvidia.com>
@lowener
Copy link
Contributor Author

lowener commented Mar 13, 2026

/merge

@rapids-bot rapids-bot bot merged commit 51fb88e into rapidsai:main Mar 13, 2026
294 of 301 checks passed
@lowener lowener deleted the 26.04-use-pq branch March 13, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C++ improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Development

Successfully merging this pull request may close these issues.

[FEA] Improve tests for SCANN [FEA] Use PQ public API in Vamana and SCANN

5 participants