Use direct IO when accessing raw vectors for BBQ (when rescoring) #125921
Merged
thecoop merged 24 commits intoelastic:mainfrom Apr 24, 2025
Merged
Use direct IO when accessing raw vectors for BBQ (when rescoring) #125921thecoop merged 24 commits intoelastic:mainfrom
thecoop merged 24 commits intoelastic:mainfrom
Conversation
e39b14a to
a9be5ea
Compare
server/src/main/java/org/elasticsearch/index/codec/vectors/es818/ES818FlatVectorsFormat.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/store/FsDirectoryFactory.java
Outdated
Show resolved
Hide resolved
ChrisHegarty
reviewed
Apr 4, 2025
server/src/main/java/org/elasticsearch/index/codec/vectors/es818/DirectIODirectory.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/store/FsDirectoryFactory.java
Outdated
Show resolved
Hide resolved
Collaborator
|
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
ChrisHegarty
approved these changes
Apr 15, 2025
Contributor
ChrisHegarty
left a comment
There was a problem hiding this comment.
LGTM. @jimczi @benwtrent any concerns?
server/src/main/java/org/elasticsearch/index/codec/vectors/es818/ES818FlatVectorsFormat.java
Show resolved
Hide resolved
jimczi
reviewed
Apr 15, 2025
server/src/main/java/org/elasticsearch/index/codec/vectors/es818/ES818FlatVectorsFormat.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/codec/vectors/es818/ES818FlatVectorsReader.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/store/FsDirectoryFactory.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/store/FsDirectoryFactory.java
Show resolved
Hide resolved
Contributor
|
@thecoop The use of direct I/O for BBQ rescoring by default is good 👍. However, there can be some cases where there is sufficient RAM available which could be somewhat negatively affected by this change - the float32 vectors would eventually become fully paged into memory. Let's add a system property that allows to revert to the previous behaviour. That way, for some narrow set of environments, a user could restore the previous behaviour. |
Member
Author
|
Is there a way to detect if we do actually have enough memory to keep all the floats paged in? Or will that come later with the memory usage monitoring? |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Copy and modify Lucene99FlatVectorsReader allowing direct IO to be used for raw vector data.
This has a 10-15% increase in performance on searches for the so_vector rally track, but a few tests have dropped ~10% (knn-search-10-50-match-all, knn-search-10-50-css, knn-search-10-50-match-all-force-merge)