-
Notifications
You must be signed in to change notification settings - Fork 129
Ensure topk results for IVF_FLAT_CC #353
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,6 +71,7 @@ struct Level1Quantizer { | |
| struct SearchParametersIVF : SearchParameters { | ||
| size_t nprobe = 1; ///< number of probes at query time | ||
| size_t max_codes = 0; ///< max nb of codes to visit to do a query | ||
| bool ensure_topk_full = false; ///< indicate whether we make sure topk result is full | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd add more comments here. It did not become clear what this parameter does before I read the code :)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, I will add more comments in the next pr. |
||
| SearchParameters* quantizer_params = nullptr; | ||
|
|
||
| virtual ~SearchParametersIVF() {} | ||
|
|
@@ -493,7 +494,8 @@ struct InvertedListScanner { | |
| const idx_t* ids, | ||
| float* distances, | ||
| idx_t* labels, | ||
| size_t k) const; | ||
| size_t k, | ||
| size_t& scan_cnt) const; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add comments to the description of the function. |
||
|
|
||
| // same as scan_codes, using an iterator | ||
| virtual size_t iterate_codes( | ||
|
|
||
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're not using
IndexIVFFlat, justIndexIVFFlatCCall the time, right?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.
Actually I dont know why we need a seperate code branch for IndexIVFFlat, it is the same with IVFPQ, IVFSQ, etc
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.
But we do need a new code branch for IndexIVFFlatCC, so I replace it.