mlxVS brings cuVS-style GPU vector search to Apple Silicon
The developer released mlxVS, an Apache-2.0 library built on MLX that ports NVIDIA cuVS-style exact k-NN, k-means, NN-Descent, and CAGRA algorithms to Apple Silicon through Python and C++ interfaces. On SIFT1M and a MacBook Pro M3 Pro, the developer reported CAGRA recall@10 of 0.976 at 69,500 queries per second with itopk 64, and 0.993 at 37,800 queries per second with itopk 128. These figures apply to batched queries, were not independently reproduced, and lack an apples-to-apples comparison with CUDA-based cuVS.
mlxVS gives Apple Silicon developers an open-source path to GPU-accelerated vector-search workflows modeled on NVIDIA cuVS, although its current evidence is limited to one developer-run dataset and several operational constraints.
I've released mlxVS, an open-source (Apache-2.0) library that runs the main GPU nearest-neighbor algorithms from NVIDIA's cuVS on Apple Silicon, built on MLX. It covers exact k-NN, k-means, NN-Descent k-NN graphs and CAGRA (graph pruning plus GPU graph search), with cuVS's parameter names, from Python (NumPy in) or C++.
Results (SIFT1M, 985k x 128, L2, MacBook Pro M3 Pro: 18-core GPU, 12-core CPU) | Index | Build | Search setting | Recall@10 | Queries/s | |---|---:|---|---:|---:| | mlxVS CAGRA, degree 32 (from a 64-NN graph) | 10.4 s | itopk 64 | 0.976 | 69,500 | | | | itopk 128 | 0.993 | 37,800 | | mlxVS CAGRA, degree 64 (from a 128-NN graph) | 19.6 s | itopk 64 | 0.994 | 43,600 | | mlxVS unpruned NN-Descent graph, degree 32 | 8.8 s | itopk 128 | 0.939 | 42,400 | | hnswlib, M=16, efC=200, 12 threads | 88.1 s | ef 64 | 0.964 | 32,200 | | | | ef 128 | 0.990 | 17,600 |
10,000 queries in one batch, recall@10 against exact neighbors (computed on the GPU with brute_force_knn), best of 3 runs, on AC power. Chart: https://github.com/mikepapadim/mlxvs#benchmarks
How it works
Limitations
Code
python import mlxvs graph = mlxvs.cagra_build(vectors, graph_degree=32, metric="cosine") ids, dist = mlxvs.graph_search(vectors, graph, queries, k=10, metric="cosine", itopk_size=64)
pip install mlxvs, macOS 14+ on Apple Silicon. Benchmarks are reproducible with bench/bench_search.py (it also runs the hnswlib baseline).
GitHub: https://github.com/mikepapadim/mlxvs
Happy to answer questions about the Metal kernels or the cuVS port. submitted by /u/mikebmx1
[link] [comments] |
#mlxVS#MLX#NVIDIA cuVS#CAGRA#NN-Descent#Apple Silicon#hnswlib