Skip to content

Benchmark: DiskSeismic latency/residency/recall + OPT_LEVEL-matching link - #38

Merged
chishui merged 1 commit into
opensearch-project:mainfrom
zirui-song-18:disk-seismic-benchmark
Aug 28, 2026
Merged

chishui merged 1 commit into
opensearch-project:mainfrom
zirui-song-18:disk-seismic-benchmark

Conversation

@zirui-song-18

Copy link
Copy Markdown
Collaborator

Description

Adds a DiskSeismic search mode to sq_residency_bench (cut / k' args, selecting the block-budget path) plus a driver script and a results doc, and fixes the benchmark build to link the SIMD library matching NSPARSE_OPT_LEVEL.

Kernel selection in nsparse/utils/distance_simd.h is a compile-time #if, and the -m flags live only on the per-ISA library targets (nsparse_avx2/avx512/sve); NSPARSE_OPT_LEVEL only decides which is built, so the consumer must link the matching one. The benchmarks linked the base nsparse, so they ran the scalar kernels regardless of the requested level. This selects nsparse_${OPT_LEVEL} (as nsparse/python/CMakeLists.txt does) and logs the choice.

Measured impact — same index (f32.dat, ≈122.6 GB), only the linked kernel differs; A/B/A/B interleaved, 1 warmup + 5 timed batches, 6,980 queries, single-thread mmap. DiskSeismic float32, cut=3 k'=20, recall@10 = 0.90053 (identical before/after):

metric scalar AVX2 speedup
mean 0.166155 ms 0.140755 ms 1.180×
p50 0.164574 ms 0.139644 ms 1.179×
p90 0.213735 ms 0.177479 ms 1.204×
p99 0.261281 ms 0.214770 ms 1.217×
best batch 1113.39 ms 953.81 ms 1.167×
qps 6267.28 7310.26 1.166×

Recall is bit-identical, so this is purely a code-path change (the AVX2 kernel can't hardware-gather 16-bit term ids, so only the FMA is vectorized — hence ~1.2×).

Issues Resolved

List any issues this PR will resolve, e.g. Closes [...].

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

… OPT_LEVEL library

Signed-off-by: Zirui Song <zrsong@amazon.com>
@chishui
chishui merged commit 0605a02 into opensearch-project:main Aug 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants