Skip to content
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() #997

Open
alwayslove2013 opened this issue Dec 19, 2024 · 0 comments
Open

Use search_pool to control iterator->Next() #997

alwayslove2013 opened this issue Dec 19, 2024 · 0 comments
Assignees

Comments

@alwayslove2013
Copy link
Collaborator

The current AnnIterator function utilizes the search pool for concurrency control only when initializing the Iterator. Once the returned iterator is handed over to the upper layer, the ->next() calls are not subjected to any thread restrictions, which may lead to issues such as OMP conflicts.

To address this, we propose the following considerations:

  • All iterators will accept a use_knowhere_search_pool parameter during construction.
    • When set to True (the default), the iterator->next() will be scheduled by the knowhere_search_thread_pool.
    • When set to False, iterator->next() will not involve thread scheduling internally, so please take caution.
  • The initialization of iterator in the AnnIterator function will no longer be concurrent, which helps to avoid potential deadlocks.
    • Furthermore, to enhance performance for large_nq, we will try to streamline the initialization process for all iterators by deferring heavier pre-computation tasks to the first call of ->next().
@alwayslove2013 alwayslove2013 self-assigned this Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant