Skip to content

Implemantion for two-level KMeans Trees in ScaNN#1878

Open
rmaschal wants to merge 1 commit intorapidsai:mainfrom
rmaschal:scann-two-level
Open

Implemantion for two-level KMeans Trees in ScaNN#1878
rmaschal wants to merge 1 commit intorapidsai:mainfrom
rmaschal:scann-two-level

Conversation

@rmaschal
Copy link
Contributor

@rmaschal rmaschal commented Mar 4, 2026

This PR adds the option for a second level in the kmeans tree for the ScaNN index. The second level is built in a bottom-up fashion, e.g. second-level cluster centers are trained on leaf centers of the bottom level. AVQ and SOAR are also applied to second-level node centers.

One divergence from OSS ScaNN is that the second-level centers are trained on the normalized leaf centers, rather than directly on leaf centers. I've found this gives better recall than training directly on leaf centers, and often gives better recall compared to the OSS algo.

I've also added a notebook giving example code for producing missing protobuf artifacts for using cuVS built ScaNN indices with OSS ScaNN search functionality.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@rmaschal rmaschal changed the title Impl for two-level tree Implemantion for two-level KMeans Trees in ScaNN Mar 4, 2026
@rmaschal rmaschal added feature request New feature or request non-breaking Introduces a non-breaking change labels Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request non-breaking Introduces a non-breaking change

Projects

Development

Successfully merging this pull request may close these issues.

2 participants