-
Notifications
You must be signed in to change notification settings - Fork 140
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
Add HNSW changes to support Faiss byte vector #1823
Add HNSW changes to support Faiss byte vector #1823
Conversation
5d532b0
to
374b81c
Compare
src/main/java/org/opensearch/knn/index/codec/transfer/VectorTransferByteToFloat.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/codec/transfer/VectorTransferByteToFloat.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/mapper/MethodFieldMapper.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/codec/KNN80Codec/KNN80DocValuesConsumer.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/query/KNNQueryBuilder.java
Outdated
Show resolved
Hide resolved
4391fa2
to
66ed657
Compare
src/main/java/org/opensearch/knn/index/codec/KNN80Codec/KNN80DocValuesConsumer.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/codec/KNN80Codec/KNN80DocValuesConsumer.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/codec/transfer/VectorTransferByteToFloat.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/mapper/KNNVectorFieldMapper.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/mapper/KNNVectorFieldMapperUtil.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/mapper/MethodFieldMapper.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/mapper/MethodFieldMapper.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/query/KNNQueryBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/codec/transfer/VectorTransferByteToFloat.java
Outdated
Show resolved
Hide resolved
68db524
to
1b344be
Compare
0e173b1
to
66ec044
Compare
5e0bea8
to
fa9af8d
Compare
b500228
to
1533a91
Compare
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.
Looks good from the integration stand point
src/main/java/org/opensearch/knn/index/codec/transfer/OffHeapBinaryVectorTransfer.java
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/mapper/MethodFieldMapper.java
Outdated
Show resolved
Hide resolved
1533a91
to
80a6494
Compare
Signed-off-by: Naveen Tatikonda <[email protected]>
80a6494
to
a48ddeb
Compare
// If VectorDataType is Byte using Faiss engine then manipulate Index Description to use "SQ8_direct_signed" scalar quantizer | ||
// For example, Index Description "HNSW16,Flat" will be updated as "HNSW16,SQ8_direct_signed" | ||
String indexDescription = methodAsMapBuilder.indexDescription; | ||
if (indexDescription != null && indexDescription.isEmpty() == 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.
why not just use StringUtils.isEmpty() from apache commons.
Also what will happen in the case indexDescription is null or empty. I think we should throw an exception rather than just silently not doing anything.
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 a heads up - as part of the mode/compression support, Im going to adjust the default logic to provide kinda of a default provider as opposed to just a default. So we wont need this additional logic once thats changed, because we will be able to supply default quantizer based on data type.
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.
Updated to use StringUtils for now. But, I'm not throwing an exception for the else case as Jack mentioned that we will be refactoring it.
append | ||
); | ||
} | ||
return 0; |
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.
Should this return the vector address? Just thinking in append scenario
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, we don't need to check if list is empty or not because we are calling this if list size is equal to transfer limit or during flush (where we are verifying if list is not empty)
08eca5d
to
ec1570d
Compare
ec1570d
to
2b2435d
Compare
Signed-off-by: Naveen Tatikonda <[email protected]>
2b2435d
to
3cd458b
Compare
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.
LGTM
* Add HNSW changes to support Faiss byte vector Signed-off-by: Naveen Tatikonda <[email protected]> * Address Review Comments Signed-off-by: Naveen Tatikonda <[email protected]> --------- Signed-off-by: Naveen Tatikonda <[email protected]> (cherry picked from commit 59c312b)
* Add HNSW changes to support Faiss byte vector Signed-off-by: Naveen Tatikonda <[email protected]> * Address Review Comments Signed-off-by: Naveen Tatikonda <[email protected]> --------- Signed-off-by: Naveen Tatikonda <[email protected]> (cherry picked from commit 59c312b) Co-authored-by: Naveen Tatikonda <[email protected]>
* Add HNSW changes to support Faiss byte vector Signed-off-by: Naveen Tatikonda <[email protected]> * Address Review Comments Signed-off-by: Naveen Tatikonda <[email protected]> --------- Signed-off-by: Naveen Tatikonda <[email protected]> Signed-off-by: Akash Shankaran <[email protected]>
Description
Add HNSW changes to support Faiss byte vector which behind the scenes uses Faiss
SQ8_direct_signed
scalar quantizer.Issues Resolved
#1659
Check List
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.