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.
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.
| Silicon | scalar | SSE (PR #278) | AVX2 | AVX-512 | speedup (→SSE) |
|---|---|---|---|---|---|
| AMD EPYC 9V74 (x86) | 1.7 | 16.0 | 16.1 | — | 9.4× |
| Intel Xeon Platinum 8573C (x86) | 2.1 | 8.8 | 8.8 | 10.0 | 4.2× |
| Ampere Neoverse-N1 (ARM, shipped) | 1.9 | 7.2 | NEON (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.)
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 build | insert qps | ANN qps (warm) | recall@10 |
|---|---|---|---|---|
| 10k × 128-d | 2.1 s | 6,334 | 2,192 | 0.98 |
| 20k × 784-d | 41.9 s | 1,646 | 358 | 0.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.