-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Introduce an int4 off-heap vector scorer #129824
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
Conversation
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
server/src/main/java/org/elasticsearch/index/codec/vectors/DefaultIVFVectorsReader.java
Outdated
Show resolved
Hide resolved
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.
This is a good step one towards bulk scoring!
I wonder if we can be even faster if we did "two pass" approximations e.g. dot-product against the centroids with their higher bits, and then only refined with lower bits if within some acceptable error threshold. This would complicate the centroid query logic as we would need to do multiple passes over the centroids. But since we score all of them right now, it seems pretty simple to do.
…aultIVFVectorsReader.java Co-authored-by: Benjamin Trent <[email protected]>
* Introduce an int4 off-heap vector scorer * iter * Update server/src/main/java/org/elasticsearch/index/codec/vectors/DefaultIVFVectorsReader.java Co-authored-by: Benjamin Trent <[email protected]> --------- Co-authored-by: Benjamin Trent <[email protected]>
In our IVF implementation, we are currently scoring centroid quantized using int4 on heap. We know that scoring vectors directly from the Index can yield good speedups. Therefore this commit introduces a new class that scorers vectors quantized using int4 off-heap data structures.
this indeed yields a nice speed up: