Add native SIMD testing and benchmark module - #708
Open
r-devulap wants to merge 6 commits into
Open
Conversation
Covers cosine_f32, dot_product_f32, euclidean_f32, elementwise ops, and CPU-feature dispatch across SSE42/AVX2/AVX512 lane widths and tail paths.
- New benchmarks/bench_similarity_f32.cpp: parameterised benchmarks for cosine_f32, dot_product_f32, and euclidean_f32 over array sizes 128, 256, 512, 1024, 1536, and 3072. - meson.build: add optional google-benchmark dependency (required: false); builds bench_simd_kernels executable only when the library is present.
- Install libgtest-dev alongside meson/ninja so GTest is found by meson.
- Build test_simd_kernels with 'ninja -C build test_simd_kernels' after
checkout (before the JDK setup, since it is a pure C++ step).
- Run the binary once per matrix.max_isa leg:
avx512f → no JVECTOR_MAX_ISA cap (auto-detects best ISA on runner)
avx2 → JVECTOR_MAX_ISA=avx2
sse42 → JVECTOR_MAX_ISA=sse42
r-devulap
requested review from
MarkWolters,
ashkrisk,
jshook and
tlwillke
as code owners
August 3, 2026 05:58
Contributor
|
Before you submit for review:
If you did not complete any of these, then please explain below. |
…to the jar replace all hardcoded relative ../../../../ paths with variables rooted at $(git rev-parse --show-toplevel), so the script works correctly regardless of the working directory it is invoked from.
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.
This pull request adds comprehensive native C++ unit tests and benchmarks for the SIMD kernel dispatcher and vector similarity functions, and integrates them into the build and CI pipeline. The most important changes are:
Testing and Benchmarking Enhancements:
test_simd_kernelsexecutable using Google Test, with tests for ISA detection and SIMD kernel correctness, and integrates it into the Meson build and GitHub Actions CI workflow.bench_simd_kernelsexecutable using Google Benchmark to micro-benchmarkcosine_f32,dot_product_f32, andeuclidean_f32functions at realistic embedding dimensions.Build System and Code Organization:
CI Improvements:
libgtest-dev, build, and run the new native C++ tests for all relevant ISA tiers, ensuring dispatcher correctness across hardware.