x86 & cross-ISA — PR #278 kernel validation

MyVector distance kernels on AMD EPYC · Intel Xeon · ARM Neoverse — measured on real silicon · generated 2026-11-07 00:03:59 UTC

← cross-engine (fashion-mnist) · real-dataset · glove · village

PR #278 (merged to main, commit 1cf3030) vectorized MyVector's three scalar HNSW distance kernels — L2Sqr, InnerProduct, and computeCosineDistance — which previously ran scalar in every shipped build on every CPU. This page validates that the speedup is not arm-specific: it reproduces on AMD and Intel x86 silicon, and the optimized component runs end-to-end on a real x86 host. Numbers are measured on GitHub-hosted runners (the project's OCI tenancy cannot launch an x86 host — Free-Tier account block); read the honest caveats below before comparing absolute throughput across chips.

1 · Kernel speedup (scalar → vectorized), same-runner A/B

A self-contained microbench of the exact kernel loops, compiled at each optimization level and run back-to-back within one job on one runner (so the ratio is a valid A/B). Figures are L2Sqr at 784-d (the fashion-mnist dimensionality), in millions of distances/sec. SSE is what the portable default build emits from the PR #278 reassoc-math pragma; AVX2/AVX-512 need -march.

SiliconscalarSSE (PR #278)AVX2AVX-512speedup (→SSE)
AMD EPYC 9V74 (x86)1.716.016.1—9.4×
Intel Xeon Platinum 8573C (x86)2.18.88.810.04.2×
Ampere Neoverse-N1 (ARM, shipped)1.97.2NEON (no AVX)3.8×

Reading it: the win holds on every ISA. SSE ≈ AVX2 on both x86 vendors and AVX-512 adds only ~14% — the high-dim kernel is memory-bandwidth-bound, so wider lanes don't help. That means the portable SSE build (no -march) already captures the full win — a correctness/portability win, not a compromise. (Absolute Mdist/s differ by chip mostly because the GHA AMD runners have ~1.8× the per-core memory bandwidth of the Intel ones; the speedup ratio is the comparable quantity.)

2 · x86 end-to-end (optimized post-#278 component)

The merged component, built and benchmarked on an x86 runner via the repo's own myvectorbench.yml (MySQL 8.4.13, AMD EPYC, 4 cores, the real MYVECTOR_IS_ANN query rewrite active). Recall@10 scored vs exact brute-force KNN.

Dataset (synthetic)index buildinsert qpsANN qps (warm)recall@10
10k × 128-d2.1 s6,3342,1920.98
20k × 784-d41.9 s1,6463580.89

ef_search sweep (784-d): ef=10 → 614 qps @ 0.41 · ef=50 → 497 @ 0.68 · ef=200 → 333 @ 0.89. Synthetic Gaussian vectors at 784-d are an intentionally hard recall case (near-equidistant, like glove), so recall-per-ef is low; the QPS is the x86 datapoint here.

Caveats & honesty