-
Notifications
You must be signed in to change notification settings - Fork 83
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
Use search_pool to control iterator->Next() #1008
base: main
Are you sure you want to change the base?
Use search_pool to control iterator->Next() #1008
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: alwayslove2013 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@alwayslove2013 🔍 Important: PR Classification Needed! For efficient project management and a seamless review process, it's essential to classify your PR correctly. Here's how:
For any PR outside the kind/improvement category, ensure you link to the associated issue using the format: “issue: #”. Thanks for your efforts and contribution to the community!. |
ee16112
to
3c70c4b
Compare
@@ -202,7 +203,7 @@ class IndexNode : public Object { | |||
return GenResultDataSet(nq, std::move(range_search_result)); | |||
} | |||
|
|||
auto its_or = AnnIterator(dataset, std::move(cfg), bitset); | |||
auto its_or = AnnIterator(dataset, std::move(cfg), bitset, false); |
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.
Please add a comment about why this parameter is false
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.
added.
The range_search function has utilized the search_pool to concurrently handle various queries.
To prevent potential deadlocks, the iterator for a single query no longer requires additional thread control over the next() call.
// If use_knowhere_search_pool is True (the default), the iterator->Next() will be scheduled by the | ||
// knowhere_search_thread_pool. | ||
// If False, will Not involve thread scheduling internally, so please take caution. | ||
template <bool use_knowhere_search_pool = true> |
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.
What are the justifications for adding use_knowhere_search_pool
as a template parameter instead of making a regular IndexIterator::use_knowhere_search_pool
field? I'm not sure I follow
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.
Just to reduce the judgment of use_knowhere_search_pool
in each iterator->next()
call.
distances_id.id = distances_id.id == -1 ? -1 : distances_id.id + xb_id_offset; | ||
if (xb_id_offset != 0) { | ||
for (auto& distances_id : distances_ids) { | ||
distances_id.id = distances_id.id == -1 ? -1 : distances_id.id + xb_id_offset; |
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.
just to confirm: this is evaluated as distances_id.id = a ? b : c
, not `distances_id.id = (a ? b : c) + xb_id_offset'?
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.
@cqy123456 help check~
Signed-off-by: min.tian <[email protected]>
3c70c4b
to
3bcefff
Compare
Signed-off-by: min.tian <[email protected]>
Signed-off-by: min.tian <[email protected]>
Signed-off-by: min.tian <[email protected]>
issue: #997