Skip to content

Add native macOS ARM64 support and NEON kernels - #113

Merged
gouyt13 merged 4 commits into
mainfrom
macos-arm64-neon
Sep 24, 2026
Merged

gouyt13 merged 4 commits into
mainfrom
macos-arm64-neon

Conversation

@gouyt13

@gouyt13 gouyt13 commented Sep 24, 2026

Copy link
Copy Markdown
Member

Summary

  • Add native macOS ARM64 kernels using NEON, with portable scalar implementations for shared quantization and search operations.
  • Select x86 or ARM64 source groups in CMake and retain runtime dispatch for supported backends.
  • Build and test macOS ARM64 wheels with the OpenMP runtime bundled.
  • Extend C++ and Python coverage for SIMD parity, L2/IP search, bit widths, persistence, and thread counts; update the Python examples to keep Faiss clustering in a separate process.

Local validation

On Linux x86-64 (GCC 14.3, CPython 3.13) with RABITQ_ENABLE_NATIVE_OPTIMIZATION=OFF:

  • C++: 186/186 CTest cases passed; 13 explicit AVX tests passed.
  • Python: rebuilt and installed the branch extension; 393 tests passed, one macOS wheel-only test skipped.
  • Installed CMake consumer: 1/1 test passed.
  • C++ formatting, Python lint/format, and 21 release-script unit tests passed.

Windows/MSVC and macOS ARM64 build and wheel validation remain for PR CI. Linux AArch64 has not been validated and is not claimed as supported.

Raven and others added 4 commits September 24, 2026 12:52
Build IVF, HNSW, SymphonyQG and Python bindings on ARM64 without x86
translation units. Add portable reference kernels and NEON distance,
FastScan, packed-code, rotation and query-preparation implementations
while retaining existing metrics, layouts and persisted formats.

Cap thread counts at available hardware and treat zero as automatic.
Separate Faiss clustering from example indexing processes. Add native
Apple Silicon CI and CPython 3.11-3.14 arm64 wheel builds with bundled
OpenMP and its license. Keep the package version at 0.3.8.

Validation on Apple M5 Pro, macOS 27.0, Apple Clang 21, native tuning off:
- C++: 178 passed, 9 skipped; installed CMake consumer passed.
- Working Python environment: 391 passed, 3 skipped.
- Four repaired installed wheels: 392 passed, 2 skipped per ABI.
- Formatting, Ruff, ShellCheck and 21 CI-routing tests passed.
- Full configured clang-tidy passed with the LLVM 21 compatibility wrapper.
- Query-preparation benchmarks and fixed-index search comparisons retained
  identical returned IDs and distances for the measured workload.

Linux AArch64 and current x86 backend execution remain to be validated
on their respective platforms.
@gouyt13
gouyt13 merged commit 367060b into main Sep 24, 2026
23 checks passed
@gouyt13
gouyt13 deleted the macos-arm64-neon branch September 24, 2026 13:57
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.

1 participant