-
Notifications
You must be signed in to change notification settings - Fork 378
Experimental Multi-Vector Chamfer Distance with SIMD & BLAS Optimizations #730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
suri-kumkaran
wants to merge
6
commits into
main
Choose a base branch
from
users/suryangupta/multivector-bench
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hildebrandmw
reviewed
Feb 6, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Experimental multi-vector support with fast Chamfer distance for
f32embeddings and benchmarking infrastructure.Changes
Core Types
MultiVector- Row-major token embeddingsTransposedMultiVector- Block-transposed layout (16 vectors/block, SIMD-optimized)Chamfer<Approach>- Generic distance using Inner Product (implementsDistanceFunction)Implementations
NaiveApproach- Scalar baselineSimdApproach- SIMD viadiskann_vector::InnerProductTransposedApproach- Block-transposed SIMDTransposedWithTilingApproach- Query tiling (transposes docs, processes query pairs)QueryTransposedWithTilingApproach- Doc tiling (transposes query, processes doc pairs)SgemmApproach- BLAS SGEMM + SIMD row-max (via faer library)Benchmark Results (100 points, 10 iterations)
Machine: Intel Core i7-1365U, AVX2 supported, AVX-512 not supported, 32 GB RAM
Note: Times are median over 50 measurements, each measuring 10 consecutive distance computations across 100 points.
Speedup vs SIMD Baseline (Median, Lower Latency = Better)
Dimension 256
Dimension 384
Future Work
f16,u8quantized, etc.)Testing
cargo build --release -p multi-vector cargo run --release -p multi-vector --bin multivec-bench -- run \ --input-file multi-vector/examples/bench.json --output-file results.jsonContributing
This work is experimental and will be submitted as separate PRs.