Skip to content

ARM SVE optimization for L2 distance kernels adapted to new simd_impl structure#5098

Open
ThatikondV wants to merge 2 commits into
facebookresearch:mainfrom
ThatikondV:feature-l2-sve-v2
Open

ARM SVE optimization for L2 distance kernels adapted to new simd_impl structure#5098
ThatikondV wants to merge 2 commits into
facebookresearch:mainfrom
ThatikondV:feature-l2-sve-v2

Conversation

@ThatikondV
Copy link
Copy Markdown

Description:

This PR introduces ARM SVE (Scalable Vector Extension) optimization for L2 metric functions. The new implementation extends the existing NEON/SVE SIMD logic with SVE vectorized kernels for distance computations, improving both indexing and search performance.

Benchmarking Setup:

To evaluate the performance impact of the new SVE-enabled L2 distance computations, a dedicated benchmarking script was developed. This script systematically compares the earlier FAISS version and the latest SVE-optimized version using the SIFT1M dataset with 128-dimensional vectors. The benchmarks cover all major index types like FLAT, IVF_FLAT, IVF_PQ, IVF_SQ8, and HNSW.

Results:

Index OSS QPS SVE QPS Improvement
Flat (L2) 888.53 1188.12 33.70%
IVF1024-Flat 33,437.76 45,871.00 37.20%
IVF1024-PQ32x8 33,597.01 40,650.00 21.00%
HNSW (M=16, ef=64) 72,837.67 77,482.00 6.40%
IVF1024-SQ8 17,002.79 20,657.00 21.50%

The above results clearly demonstrate that enabling SVE vectorization yields consistent performance gains across all tested index types, where both indexing and search times improved significantly.

These improvements validate the effectiveness of the SVE implementation in accelerating L2 distance computations on modern ARM platforms.

Co-author: This work was jointly developed with @abhijain1204fujitsu.

@mnorris11
Copy link
Copy Markdown
Contributor

cc @algoriddle
Thanks @ThatikondV for this contribution, it looks like a big improvement! We are still revamping the SIMD structure of the codebase. We will review the big backlog of SIMD changes hopefully in the next few weeks.

@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 23, 2026

@mnorris11 has imported this pull request. If you are a Meta employee, you can view this in D106149015.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants