-
Notifications
You must be signed in to change notification settings - Fork 127
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
Adds in lazy execution for Lucene kNN queries #2305
Adds in lazy execution for Lucene kNN queries #2305
Conversation
@kotwanikunal can you fix the CIs. Change looks good to me as it is minial in terms of changing the code and getting the best performance out of the system |
e9b5456
to
38dc781
Compare
@navneet1v I have updated the description with updated flame graphs and benchmarking numbers. |
@kotwanikunal thanks. This p99 seems interesting. Rest all latency have decreased as expected. |
38dc781
to
564c783
Compare
@kotwanikunal can you please add the details like:
|
Added to the description. |
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.
overall code looks good to me. One question I have is why we are not changing the DiversifyingChildrenByteKnnVectorQuery
and DiversifyingChildrenFloatKnnVectorQuery
in this PR? Is there some other PR that is taking care of this?
NVM, I see this PR: https://github.com/opensearch-project/k-NN/pull/2283/files#diff-d6bb9cc296becc98be3ac4bddc74c2b1520d09ff8b7d77467b3a765df17c4c11 is handling that case. |
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.
Overall code looks good, added few minor comments.
Did you see impact of efficient filtering with Lucene, can you run a benchmark to check if there is an impact?
@@ -512,7 +512,7 @@ public void testDoToQuery_KnnQueryWithFilter_Lucene() throws Exception { | |||
|
|||
// Then | |||
assertNotNull(query); | |||
assertTrue(query.getClass().isAssignableFrom(KnnFloatVectorQuery.class)); | |||
assertTrue(query.getClass().isAssignableFrom(LuceneEngineKnnVectorQuery.class)); |
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.
is there a way to check the type of the underlying lucene query, looks like this is what we're asserting in today's version? How about adding a package private getter for the lucene query, or a public method that returns the type of the query class.
src/main/java/org/opensearch/knn/index/query/lucene/LuceneEngineKnnVectorQuery.java
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.
Please address my comments in follow up PRs
355a060
564c783
to
355a060
Compare
Conflicts fixed. Will wait for CI to complete |
355a060
to
f1381a3
Compare
The BWC test: k-NN Rolling-Upgrade BWC Tests (21, ubuntu-latest, 2.19.0-SNAPSHOT, 3.0.0-SNAPSHOT) will fixed once we have code for innerhits merges and added in 2.19 snapshot. |
f1381a3
to
b265e45
Compare
Signed-off-by: Kunal Kotwani <[email protected]>
b265e45
to
c348fcf
Compare
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-2305-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 2b9a741a7cfb8c9a55c7412a6e19ea699b7a921d
# Push it to GitHub
git push --set-upstream origin backport/backport-2305-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x Then, create a pull request where the |
Signed-off-by: Kunal Kotwani <[email protected]> (cherry picked from commit 2b9a741)
Signed-off-by: Kunal Kotwani <[email protected]> (cherry picked from commit 2b9a741) Co-authored-by: Kunal Kotwani <[email protected]>
Signed-off-by: Kunal Kotwani <[email protected]>
Description
rewrite
method would potentially be skipped with this execution mechanism.Setup and Dataset
Flame Graph
Default 2.18 code
Patched 2.18 code
Benchmarks
2.18 Default Code:
Patched new 2.18 code:
JFRs
JFR-patched-default.zip
Related Issues
Resolves #2115
Check List
API changes companion pull request created.--signoff
.Public documentation issue/PR created.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.