-
Notifications
You must be signed in to change notification settings - Fork 67
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
[FEA] Support for Cosine distance in IVF-Flat #179
Conversation
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.
Thanks @lowener for this work! It looks good overall, I have left some comments. I still need to take a closer look at the modified distance kernels
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.
Thanks @lowener for the updates. The PR looks good overall. There might be a potential for improving the norm computations, but that need not stop this PR.
if constexpr (ComputeNorm) { | ||
norm_query += queryRegs[k] * queryRegs[k]; | ||
norm_data += encV[k] * encV[k]; | ||
} |
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.
We should ask the question whether it is more efficient to compute the norms here or precompute them:
- we could store norm of database vectors in the index
- query norm is recalculated every time we process vector in the cluster. I expect that it would be better to use precalculated query norm, but we should confirm that by measurement. Please open an issue to track this, and improve this in a follow-up PR.
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.
The implementation is looking good. We need to make sure we are testing all cases (for all supported languages) and properly conveying the support metrics to the users (also for all supported languages).
/merge |
No description provided.