perf(index): use SIMD-dispatched l2_u8 in SQDistCalculator#6692
Merged
Conversation
SQDistCalculator was calling l2_distance_uint_scalar (pure scalar loop) for L2/Cosine distance computation on quantized u8 vectors. This misses the runtime-dispatched SIMD implementations (AVX2 / AVX-512 VNNI) that were added in lance-format#6517 and wired into the L2 trait. Replace the direct scalar call with l2_u8::l2_u8(), which automatically selects the best available SIMD backend at runtime: - AVX-512 VNNI: 64 elements/iter - AVX2: 32 elements/iter - Scalar fallback for other architectures Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
@claude review |
There was a problem hiding this comment.
An organization admin can view or raise the cap at claude.ai/admin-settings/claude-code. The cap resets at the start of the next billing period.
Once the cap resets or is raised, comment @claude review on this pull request to trigger a review.
Xuanwo
approved these changes
May 7, 2026
Collaborator
Xuanwo
left a comment
There was a problem hiding this comment.
Thank you for this change!
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
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.
SQDistCalculator was calling l2_distance_uint_scalar (pure scalar loop) for L2/Cosine distance computation on quantized u8 vectors. This misses the runtime-dispatched SIMD implementations (AVX2 / AVX-512 VNNI) that were added in #6517 and wired into the L2 trait.
Replace the direct scalar call with l2_u8::l2_u8(), which automatically selects the best available SIMD backend at runtime: