Skip to content

[diskann-vector] Neon Squared L2 kernels for int8 and uint8 - #1540

Merged
Harsha Simhadri (harsha-simhadri) merged 4 commits into
microsoft:mainfrom
pfoxARM:pfoxARM/full_precision_l2_8bit
Oct 30, 2026
Merged

Harsha Simhadri (harsha-simhadri) merged 4 commits into
microsoft:mainfrom
pfoxARM:pfoxARM/full_precision_l2_8bit

Conversation

@pfoxARM

@pfoxARM pfoxARM commented Oct 29, 2026

Copy link
Copy Markdown
Contributor
  • Adds Neon squared-L2 kernels for int8 and uint8 inputs, using absolute differences and dot-product accumulation.
  • Changes both kernels accumulators from eight lanes to four
  • Expand tests with boundary cases for minimum and maximum input

This changes:

  • diskann-vector/src/distance/simd.rs
  • diskann-wide/src/arch/aarch64/algorithms.rs

Both myself and Utsav Goel have worked on this together.

@pfoxARM
pfoxARM requested review from a team and a balanced review from Copilot October 29, 2026 18:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the AArch64 Neon squared-L2 kernel and distance-schema updates.

No open issues 🎉

What changed in this PR

This PR optimizes DiskANN’s AArch64 Neon squared-L2 kernels for signed and unsigned 8-bit vectors, keeping the distance schemas aligned with the updated kernels.

Changes:

  • Replaces widening subtraction and multiplication with absolute differences and dot-product accumulation.
  • Reduces accumulators from eight lanes to four and updates scalar-tail handling.
  • Expands kernel tests with minimum and maximum input and accumulator values.
File Description
diskann-wide/​src/​arch/​aarch64/​algorithms.rs Updates both Neon kernels and adds boundary-case tests.
diskann-vector/​src/​distance/​simd.rs Adapts Neon L2 schemas and scalar tails to four-lane accumulators.

Review effort: Balanced

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small request, since we have an opportunity here to delete even more code.

Comment thread diskann-vector/src/distance/simd.rs Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block approval of the Neon squared-L2 kernel changes.

No open issues 🎉

Review effort: Balanced

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.06%. Comparing base (413be59) to head (247be00).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1540      +/-   ##
==========================================
+ Coverage   91.01%   91.06%   +0.04%     
==========================================
  Files         602      602              
  Lines      124144   124137       -7     
==========================================
+ Hits       112994   113045      +51     
+ Misses      11150    11092      -58     
Flag Coverage Δ
miri 91.06% <ø> (+0.04%) ⬆️
unittests 90.77% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
diskann-vector/src/distance/simd.rs 78.15% <ø> (ø)

... and 23 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@harsha-simhadri
Harsha Simhadri (harsha-simhadri) merged commit ffeaa9f into microsoft:main Oct 30, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants