-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Enable directIO and bfloat16 for bbq and unquantized HNSW vector field types #135940
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
Enable directIO and bfloat16 for bbq and unquantized HNSW vector field types #135940
Conversation
8119a8c to
803dfc1
Compare
4f81b03 to
05f0b71
Compare
|
I've added a feature flag to enable the new formats - so we can turn them on all at once when ready |
BASE=bcb861ae10000f94977487193d242c6f30443741 HEAD=eed749e3a6d09e03e0731f5c526fa49e15cd471a Branch=main
...amlRestTest/resources/rest-api-spec/test/search.vectors/200_dense_vector_docvalue_fields.yml
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java
Outdated
Show resolved
Hide resolved
BASE=bcb861ae10000f94977487193d242c6f30443741 HEAD=ab5ee251aa0c298a2ee2d980c54eb93af40a064a Branch=main
benwtrent
left a comment
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.
I think this is good. I have reviewed it many times.
My concerns are:
- I think we should run yaml tests all the time, so let's enable the feature flag for the yaml test runners?
- Let's not parse on_disk_rescore for BBQHnsw (I think thats the only one that was added?) unless the flag is enabled. My concern is that we accept the parameter and then do nothing (which we shouldn't do)
| Object onDiskRescoreNode = indexOptionsMap.remove("on_disk_rescore"); | ||
| Object onDiskRescoreNode = ES93GenericFlatVectorsFormat.GENERIC_VECTOR_FORMAT.isEnabled() | ||
| ? indexOptionsMap.remove("on_disk_rescore") | ||
| : 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.
I am not sure we can do this? Do we know if we have shipped a version of ES that allowed this option for diskbbq?
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.
9.2 didn't include it, so we can change it here
john-wagster
left a comment
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.
this is a lot of changes but I tried to go through it bit at a time today and I think it looks good. Nothing stood out to me as bad or missing. lgtm
…ypes (elastic#135940) Currently behind a feature flag, pending further development
Enables direct IO rescoring and bfloat16 elements for the
bbq_hnswandbbq_diskvector types, and bfloat16 elements forhnswandbbq_flatelement types, using a new generic flat vector format that is element-type-agnostic.This adds new options
on_disk_rescoring: trueandelement_type: bfloat16to index options, allowing direct IO to be used for rescoring, and bfloat16 to be used as a raw vector type.element_type: bfloat16reduces disk usage for raw vectors (by far the dominating cost of storing vectors on disk) by 50%, at the cost of a ~5% runtime performance reductionon_disk_rescore: truedoes not load raw vectors into disk when rescoring vectors, significantly improving HNSW performance when the vectors do not all fit in memory. Due to architectural limitations, this option can only be set on newly-indexed vectors, requiring a reindex to enable on-disk rescoring for existing vectors.Int and flat vector types will be updated in a separate PR.
Specifing bfloat16 and using the new formats is currently behind a feature flag, pending further PRs in this area