Skip to content

Conversation

thecoop
Copy link
Member

@thecoop thecoop commented Mar 13, 2025

Resolves #117096

This gets about a 6-10x speedup:

Benchmark (dims) (docType) (function) (queryType) (type) Mode Cnt Score Error Units DistanceFunctionBenchmark.benchmark 1024 BIT DOT FLOAT BINARY avgt 2 441.688 ns/op DistanceFunctionBenchmark.benchmark 1024 BIT DOT BYTE BINARY avgt 2 357.740 ns/op DistanceFunctionBenchmark.vectorBenchmark 1024 BIT DOT FLOAT BINARY avgt 2 48.748 ns/op DistanceFunctionBenchmark.vectorBenchmark 1024 BIT DOT BYTE BINARY avgt 2 55.824 ns/op 

Still need to determine if 128-bit versions are helpful

@thecoop thecoop added the WIP label Mar 14, 2025
@thecoop thecoop marked this pull request as ready for review March 14, 2025 11:20
@thecoop thecoop force-pushed the vector-bit-dot-product branch from e7c3f9a to d66ee15 Compare March 24, 2025 11:25
@thecoop thecoop removed the WIP label Mar 24, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Mar 24, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@benwtrent
Copy link
Member

Could you add tests to ESVectorUtilTests ? I don't think the ones I have written there actually cover indices that are big enough to be vectorized.

@thecoop
Copy link
Member Author

thecoop commented Mar 24, 2025

The PR includes changes to ESVectorUtilTests that creates random vectors up to 1024 dims

@elasticsearchmachine
Copy link
Collaborator

Hi @thecoop, I've created a changelog YAML for you.

Copy link
Member

@benwtrent benwtrent left a comment

Choose a reason for hiding this comment

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

marked it as enhancement as its a performance improvement :)

@thecoop thecoop merged commit 7f1203e into elastic:main Mar 25, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.1.0

3 participants