mlxvs

by mikepapadim · Framework · Text & code

A Python library that searches for nearest neighbours among vectors and builds graph indexes on the Apple Silicon GPU, on your own Mac.

Latest · Nov 12Released pip-installable library with exact k-NN, k-means, NN-Descent k-NN graphs and CAGRA, all as runtime-compiled mx.fast.metal_kernel kernels

AccessOpen codeLicenseApache 2.0

Seen running on

MachineSpeedHowSeen by
1 run, memory not given
MacBook Pro
and 2 more builds in the same post
no speed givenMLXmikepapadim · Nov 12

Evidence

  1. Nov 12
    Ports GPU nearest-neighbor algorithms from NVIDIA cuVS; NN-Descent kernels come from JVector's Metal backend, the rest is new
    Maker's claimMLX: Show and tell
  2. Nov 12
    SIFT1M, 10k-query batches: builds in 10.8 s vs 91.8 s, recall@10 0.976 vs 0.964, 76,400 vs 28,100 queries/s versus hnswlib on 12 CPU cores
    Maker's claimMLX: Show and tell
  3. Nov 12
    ada-002 1M (1536-d), 10k-query batches: builds in 125 s vs 732 s, recall@10 0.979 vs 0.974, 10,000 vs 5,100 queries/s versus hnswlib
    Maker's claimMLX: Show and tell
  4. Nov 12
    Single-query latency is about 0.95 ms on the GPU versus 0.21 ms for single-threaded hnswlib; batches up to ~64 cost about the same as one query
    Maker's claimMLX: Show and tell

Everything said about mlxvs, on the wire

Alternatives

Works with