Skip to content

Add native int4 operation benchmarks; fix JDK22+ test guards#145096

Merged
john-wagster merged 5 commits intoelastic:mainfrom
ldematte:native/int4-benchmarks-and-tests-adjustment
Mar 28, 2026
Merged

Add native int4 operation benchmarks; fix JDK22+ test guards#145096
john-wagster merged 5 commits intoelastic:mainfrom
ldematte:native/int4-benchmarks-and-tests-adjustment

Conversation

@ldematte
Copy link
Copy Markdown
Contributor

Summary

  • Add native benchmarks (nativeWithNativeSeg, nativeWithHeapSeg) to VectorScorerInt4OperationBenchmark, comparing native libvec int4 dot product against the scalar and Lucene implementations
  • Fix int4 benchmark tests to skip on JDK < 22, since the native scorer requires MemorySegment heap segment support (JDK 22+)
  • Add test assertions for the new native benchmarks in VectorScorerInt4OperationBenchmarkTests

Cross-check benchmark results (Mac, Apple M2)

These are just a local cross-check. Full benchmark results on cloud instances are in #144429 and #144649.

Benchmark                                               (size)  Mode  Cnt    Score    Error  Units
VectorScorerInt4OperationBenchmark.scalar                 2048  avgt   15  651.558 ±  1.992  ns/op
VectorScorerInt4OperationBenchmark.lucene                 2048  avgt   15  697.716 ± 11.837  ns/op
VectorScorerInt4OperationBenchmark.nativeWithHeapSeg      2048  avgt   15   41.390 ±  0.409  ns/op
VectorScorerInt4OperationBenchmark.nativeWithNativeSeg    2048  avgt   15   42.997 ±  0.162  ns/op

Test plan

  • VectorScorerInt4OperationBenchmarkTests passes (new native assertions)
  • VectorScorerInt4BenchmarkTests passes (JDK22+ guard)
  • VectorScorerInt4BulkBenchmarkTests passes (JDK22+ guard)

…corerInt4 benchmark tests to run only on JDK22+, as the native scorer requires that.
@elasticsearchmachine elasticsearchmachine added v9.4.0 needs:triage Requires assignment of a team area label labels Mar 27, 2026
@ldematte ldematte added >test Issues or PRs that are addressing/adding tests :Search Relevance/Vectors Vector search and removed needs:triage Requires assignment of a team area label labels Mar 27, 2026
@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Mar 27, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Contributor

@john-wagster john-wagster left a comment

Choose a reason for hiding this comment

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

lgtm

@ldematte ldematte enabled auto-merge (squash) March 27, 2026 14:47
@john-wagster
Copy link
Copy Markdown
Contributor

retried serverless checks a couple of times; there's a PR to fix the failing test in flight: https://github.com/elastic/elasticsearch-serverless/pull/6048

merging.

@john-wagster john-wagster disabled auto-merge March 28, 2026 01:46
@john-wagster john-wagster merged commit 99e2c25 into elastic:main Mar 28, 2026
35 of 36 checks passed
GalLalouche pushed a commit to GalLalouche/elasticsearch that referenced this pull request Mar 29, 2026
…corerInt4 benchmark tests to run only on JDK22+, as the native scorer requires that. (elastic#145096)

Co-authored-by: John Wagster <john.wagster@elastic.co>
mamazzol pushed a commit to mamazzol/elasticsearch that referenced this pull request Mar 30, 2026
…corerInt4 benchmark tests to run only on JDK22+, as the native scorer requires that. (elastic#145096)

Co-authored-by: John Wagster <john.wagster@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch >test Issues or PRs that are addressing/adding tests v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants