Uh oh!
There was an error while loading. Please reload this page.
Add tiled MinMax MaxSim kernels - #1375
Draft
juchen-ms (partychen) wants to merge 6 commits into
Draft
Conversation
Implement MinMax8 query by MinMax4 document matrix kernels with Scalar, AVX2, AVX-512, and Neon paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
juchen-ms (partychen)
marked this pull request as draft
September 4, 2026 16:57
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use architecture intrinsics directly in the matrix kernel and restore unrelated distance and diskann-wide changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reuse diskann-wide operations where available and handle unsupported ISAs in tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pack queries with grouped slice copies, build document panels in one pass, and consume accumulators while borrowing metadata. Initialize scores within each query block and extend tail coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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 freeto 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
Adds a prepared MaxSim matrix kernel for MinMax8 queries against packed MinMax4 documents.
Driver -> PanelKernel -> MicroKernelMaxSimIsaKernels
maddubs+maddpdep_u64+ 512-bit VNNIUDOTV4 processes eight dimensions per step. Each
pdep_u64expands four packed MinMax4 bytes, VNNI accumulates two four-byte groups per query row, and adjacent accumulator lanes are combined before compensation.The micro-kernel enters the selected target-feature context through
run_inline. This is required for LLVM to emit directvpdpbusdinstructions instead of calling intrinsic shims from the contraction loop.API
Performance
Workload: 1,000 documents,
16 query vectors x 16 document vectors x 250 dimensions. Query packing is performed once and excluded. All implementations produced identical results.On x86-64, Grouped-8 V4 is approximately 32% faster than the best Grouped-4 V4 variant. V3 retains AVX2 nibble expansion because it is within about 2% of BMI2 on this Intel CPU while avoiding slow
pdepimplementations on older AMD CPUs supported by V3.Validation
Scalar, V3, V4, Neon, and Auto match the existing MinMax8 x MinMax4 implementation across tested dimensions, row counts, and panel tails. Generated assembly contains direct
vpdpbusdon V4 and directudoton ARM64 Neon.