Repository navigation
[diskann] Add aarch64 NeighborPriortyQueue.get_lower_bound - #1512
Mark Hildebrand (hildebrandmw) merged 3 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The architecture guards leave other targets without get_lower_bound, causing missing-method compilation errors.
1 open issue
What changed in this PR
This PR specializes the neighbor priority queue’s lower-bound search for AArch64, using scalar linear search based on the reported benchmark results.
Changes:
- Adds an AArch64 scalar implementation of
get_lower_bound. - Restricts the existing SIMD implementation and its imports to x86-64.
| File | Description |
|---|---|
diskann/src/neighbor/queue.rs |
Adds architecture-specific lower-bound implementations and gates SIMD imports. |
Review effort: Balanced
Mark Hildebrand (hildebrandmw)
left a comment
There was a problem hiding this comment.
Thanks! One very tiny suggestion from me.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1512 +/- ##
==========================================
+ Coverage 91.02% 92.07% +1.04%
==========================================
Files 602 602
Lines 124080 124080
==========================================
+ Hits 112948 114245 +1297
+ Misses 11132 9835 -1297
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Mark Hildebrand (hildebrandmw)
left a comment
There was a problem hiding this comment.
Thanks - looks good to me! CI failure should be taken care of by merging/rebasing with the latest main. Apologies for the flakiness.
…et_lower_bound on non-x86_64 targets' Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2c73395 to
dbb571a
Compare
|
No worries, hopefully CI passes now :) |
|
Note that openai v3 vectors at 3072 dimensions, and naive binary search will win there I think. At least it did last I benchmarked this. In the future I think we will have some way to dynamically select an NPQ algorithm based on dimension, but for now matching the existing thing is probably the right call. |
|
It seems quite surprising that a) our fallback is much less efficient and b) not using SIMD is as good as doing the work 8x as fast? |
|
Jack Moffitt (@metajack) - The big issue with the SIMD approach on aarch64 is that |
65443a6
into
microsoft:main

Add an AArch64-specific implementation of get_lower_bound that uses a scalar linear search.
Benchmarks showed that scalar linear search gives the best overall QPS across different vector dimensions (dim128, dim256, dim768) and L sizes (10,20...,80).
We tested several alternatives:
It was clear from testing that a scalar linear approach is best.