Skip to content

Accelerate quantization rescale search with SIMD interval pruning - #98

Merged
gouyt13 merged 1 commit into
mainfrom
perf/quantization-rescale-search
Sep 12, 2026
Merged

Accelerate quantization rescale search with SIMD interval pruning#98
gouyt13 merged 1 commit into
mainfrom
perf/quantization-rescale-search

Conversation

@gouyt13

@gouyt13 gouyt13 commented Sep 12, 2026

Copy link
Copy Markdown
Member

Problem and change

Extra-bit quantization spends substantial time processing rescale candidates through a priority queue. This change adds a float32 AVX2/AVX-512 interval search with conservative pruning and scalar fallback for ambiguous comparisons or work limits. The scalar sweep also replaces pop/push pairs with one heap repair, and successful warmed SIMD searches reuse thread-local scratch buffers.

Validation

Recorded branch validation:

  • Portable Release and ASan/UBSan builds: 71 C++ tests passed each, including explicit AVX2 and AVX-512 coverage. LeakSanitizer was disabled under ptrace.
  • Rebuilt portable wheel: 102 Python tests passed. Installed CMake consumer passed.
  • Formatting, Python lint, whitespace, and configured core/test clang-tidy checks passed.
  • Reference checks covered exhaustive objectives, interval bounds, threshold ties, zeros, tails, and threaded scratch reuse. Link-order checks verified backend ISA isolation.
  • Strict MkDocs build and git diff --check passed after the documentation update.
    GIST benchmark: 960 dimensions, 96 pinned workers, Intel Xeon Gold 6418H, GCC 14.3.0, portable build; median of five trials, each encoding 24,576 distinct rotated residuals four times. Timing includes code/factor emission and fallback, excluding preparation.
    At eight total bits, throughput increased from 79,280 encodings/s to 184,433 with AVX2 (2.33×) and 372,528 with AVX-512 (4.70×). Across bits 2–9, all 196,608 input/bit cases matched baseline scales, code bytes, and normalization factors.
    These results measure quantization throughput, not full index-build speed. Both backends ran on an AVX-512-capable host; AVX2-only emulation was unavailable.

Compatibility

No changes to public APIs, index formats, code layouts, dependencies, or distance-estimation formulas. The fixed-scale quantization path is unchanged.

@gouyt13 gouyt13 self-assigned this Sep 12, 2026
@gouyt13 gouyt13 added the enhancement New feature or request label Sep 12, 2026
@gouyt13
gouyt13 merged commit 7a1cc84 into main Sep 12, 2026
17 checks passed
@gouyt13
gouyt13 deleted the perf/quantization-rescale-search branch September 12, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant