-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Use vector bulk scoring in entry-point and filter hnsw search #15500
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: main
Are you sure you want to change the base?
Conversation
| int size = Lucene99HnswVectorsReader.EXHAUSTIVE_BULK_SCORE_ORDS; | ||
| // visit limit is a "best effort" limit given our bulk scoring logic; assert that we are | ||
| // within | ||
| // reasonable bounds |
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.
nit: clean up spotless multi-line comment
| results.collect(eps[0], score); | ||
| } | ||
| } else { | ||
| scorer.bulkScore(eps, scores, eps.length); |
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.
Saying this outloud in case my assumption is wrong. I assume the reason we don't need benchmarking here is that we know from prior work at the leaf level that there's definitely a benefit to bulk scoring eps here instead of doing an early termination check for each entry point.
john-wagster
left a comment
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.
lgtm
We currently use the bulk scoring interface on the lowest HNSW level, but there isn't any technical reason why we cannot use bulk scoring on higher levels to find the entry point. For highly connected graphs with many levels, this could provide a small speed improvement.
Additionally, I noticed that we were not doing bulk scoring when using the Filtered hnsw searcher. Again, we should be using bulk scoring even when using the filter optimized HNSW scorer.