Skip to content

Copy Lucene99FlatVectorsReader allowing direct IO to be specified directly #125921

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 24 commits into from
Apr 24, 2025

Conversation

thecoop
Copy link
Member

@thecoop thecoop commented Mar 31, 2025

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)

@thecoop thecoop force-pushed the modified-flat-vector-direct-io branch from e39b14a to a9be5ea Compare March 31, 2025 09:04
@thecoop thecoop marked this pull request as ready for review April 8, 2025 12:26
@thecoop thecoop requested a review from a team as a code owner April 8, 2025 12:26
@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Apr 8, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-relevance (Team:Search Relevance)

Copy link
Contributor

@ChrisHegarty ChrisHegarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @jimczi @benwtrent any concerns?

@ChrisHegarty
Copy link
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.

@thecoop
Copy link
Member Author

thecoop commented Apr 16, 2025

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?

@thecoop thecoop requested a review from jimczi April 23, 2025 15:46
Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thecoop thecoop merged commit c5ada66 into elastic:main Apr 24, 2025
17 checks passed
@thecoop thecoop deleted the modified-flat-vector-direct-io branch April 24, 2025 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>refactoring :Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants