-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Enable bfloat16 and on-disk rescoring for dense vectors #138492
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
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
58a03e5
Update docs on dense_vector for new types
thecoop 5ee9ea1
Remove feature flag
thecoop 248c9f6
Doc updates
thecoop 492b5aa
Update docs/changelog/138492.yaml
thecoop 74987de
Update docs/changelog/138492.yaml
thecoop a44267b
Docs
thecoop 7270d90
Disallow bfloat16 with semantic_text at the moment
thecoop a6bffff
Update semantic text tests
thecoop 47d666e
Add an index version
thecoop 387bb35
Merge branch 'main' into enable-generic-vector-formats
thecoop bf465d5
Remove feature flag refrences
thecoop 056bd28
Another one
thecoop 171d1d3
Update docs/changelog/138492.yaml
thecoop 678463e
Fix changelog
thecoop bd6c612
Merge branch 'main' into enable-generic-vector-formats
thecoop ad48d03
Merge branch 'main' into enable-generic-vector-formats
thecoop 3ecf6ac
Merge branch 'main' into enable-generic-vector-formats
thecoop 5dded6d
Merge branch 'main' into enable-generic-vector-formats
thecoop b8497d1
Update changelog
thecoop b395f63
Merge branch 'main' into enable-generic-vector-formats
thecoop 73b01ad
Get the right feature flags in
thecoop 6d9455f
Merge branch 'main' into enable-generic-vector-formats
thecoop 40a3403
Doc updates
thecoop dfe27ef
Don't use bfloat16 here
thecoop 178df59
Merge branch 'main' into enable-generic-vector-formats
thecoop 677898f
Merge branch 'main' into enable-generic-vector-formats
thecoop e89db84
Rounding, not truncating
thecoop f5da14b
Merge branch 'main' into enable-generic-vector-formats
thecoop ac62b97
Merge branch 'main' into enable-generic-vector-formats
thecoop ccf8193
Merge branch 'main' into enable-generic-vector-formats
thecoop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| pr: 138492 | ||
| summary: Enable bfloat16 and on-disk rescoring for dense vectors | ||
| area: Vector Search | ||
| type: feature | ||
| issues: [] | ||
| highlight: | ||
| title: New dense_vector options for storing bfloat16 vectors and utilising on-disk | ||
| rescoring | ||
| body: |- | ||
| New options have been added to the `dense_vector` field type. | ||
|
|
||
| The first is support for storing vectors in bfloat16 format. | ||
| This is a floating-point format that utilises two bytes per value rather than four, halving the storage space | ||
| required compared to `element_type: float`. This can be specified with `element_type: bfloat16` | ||
| when creating the index, for all `dense_vector` indexing types. | ||
|
|
||
| Float values are automatically rounded to two bytes when writing to disk, so this format can be used | ||
| with original source vectors at two- or four-byte precision. BFloat16 values are zero-expanded back to four-byte floats | ||
| when read into memory. Using `bfloat16` will cause a loss of precision compared to | ||
| the original vector values, as well as a small performance hit due to converting between `bfloat16` and `float` | ||
| when reading and writing vectors; however this may be counterbalanced by a corresponding decrease in I/O, | ||
| depending on your workload. | ||
|
|
||
| The second option is to enable on-disk rescoring. When rescoring vectors during kNN searches, the raw vectors | ||
| are read into memory. When the vector data is larger than the amount of available RAM, this might cause the OS | ||
| to evict some in-memory pages that then need to be paged back in immediately afterwards. This can cause | ||
| a significant slowdown in search speed. Enabling on-disk rescoring causes rescoring to use raw vector data | ||
| on-disk during rescoring, and to not read it into memory first. This can significantly increase search performance | ||
| in such low-memory situations. | ||
|
|
||
| Enable on-disk rescoring using the `on_disk_rescore: true` index option. | ||
| notable: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.