[minmax] Expose minmax heterogeneous distance api#833
Conversation
There was a problem hiding this comment.
Pull request overview
This PR exposes heterogeneous MinMax distance support by generalizing MinMax distance trait impls (and related multi-vector distances) from a single bitrate const generic to separate (N, M) bitrates, enabling e.g. MinMax<8> queries against MinMax<4/2/1> documents as introduced in #798.
Changes:
- Generalize
MinMaxIP,MinMaxL2Squared,MinMaxCosine, andMinMaxCosineNormalizedto accept different bitrates for left/right operands. - Update MinMax multi-vector
MaxSim/Chamferimplementations and tests to cover heterogeneous(8,4),(8,2),(8,1)cases. - Adjust heterogeneous InnerProduct test labels to pass
lazy_format!(...)by value.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| diskann-quantization/src/minmax/vectors.rs | Makes MinMax single-vector distance impls heterogeneous via (N, M) const generics. |
| diskann-quantization/src/minmax/multi/max_sim.rs | Extends MinMax multi-vector distances to heterogeneous bitrates and adds tests for them. |
| diskann-quantization/src/bits/distances.rs | Minor test harness update to pass lazy_format! without borrowing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #833 +/- ##
==========================================
- Coverage 89.11% 89.10% -0.01%
==========================================
Files 443 443
Lines 83354 83359 +5
==========================================
+ Hits 74278 74280 +2
- Misses 9076 9079 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
I missed exposing the public api for minmax distance functions from #798.
Bumped version to 0.49.1