Repository navigation
Conversation
Including TopK/Range/Memory tests Also add a script to convert fp32/fp16 index files to sq8
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1062 +/- ##
==========================================
- Coverage 97.58% 97.56% -0.02%
==========================================
Files 142 142
Lines 9095 9148 +53
==========================================
+ Hits 8875 8925 +50
- Misses 220 223 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
Author
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.
Describe the changes in the pull request
Ports ARM-software/VectorSimilarity-for-Arm#6: V5 SQ8 HNSW snapshots and FP32/FP16 single/multi tiered benchmarks for memory, add/delete, TopK, and range. Unquantized snapshots retain V4 writes and legacy V3 reads.
The port also preserves the trained mean when saving, updates the converter for current Python bindings, and normalizes cosine inputs for IP SQ8 snapshots. SQ8 registrations reuse the existing TopK and range helpers; range recall measures label overlap. Full DBpedia/fashion snapshots for FP32/FP16 are included in the existing download manifests. These benchmarks use prebuilt backends and do not measure training.
Initial validation: Intel targeted suites passed (2,048 tests, one unsupported-hardware skip), all four basics binaries built, four converter integration cases (including absolute-radius checks) passed, and all eight SQ8 add/delete smoke cases passed. All four Intel query/memory configurations completed three repetitions. Arm targeted suites passed (2,011 tests, zero skips), all eight requested targets built, and the single-FP32 query/memory run completed three repetitions using SHA256-identical inputs. Both Arm single-FP32 SQ8 add/delete smoke cases passed (1,024 iterations each).
After the review cleanups, all four FP32/FP16 single/multi benchmark targets rebuilt on Intel and Arm, and all 153 SQ8 tests passed on each architecture. All four full snapshots were regenerated using the current converter, passed save/reload integrity and vector-count checks, and passed 20 Intel smoke cases covering memory, TopK, range, add and delete. Anonymous downloads from the benchmark bucket match the generated SHA-256 checksums.
The full-data timing results below use DBpedia FP32 files that are byte-for-byte identical to the newly generated snapshots. The new smoke checks are functional validation, not replacement timing measurements.
Sample benchmark results
DBpedia single FP32: 1M vectors, dimension 768, M=64, efConstruction=512. Three repetitions, mean range times; radius=0.35, epsilon=0.01, ten queries/repetition.
Tiered index allocator memory was 3.493 GiB unquantized and 1.361 GiB SQ8 on both hosts. Range compares unquantized HNSW with SQ8 tiered HNSW over prebuilt backends, at matching settings rather than equal recall. Shared queries are normalized outside timing. TopK uses eight workers and 10 ms completion polling; no small TopK speedup is claimed. These measure index choices, not before/after-port kernel performance or training.
Intel uses GCC 13.3 and the prebuilt SVS dependency; Arm uses GCC 12.3 and the pinned SVS source dependency. The host comparison includes these configuration differences.
Which issues this PR fixes
Main objects this PR modified
Mark if applicable
Note
High Risk
Introduces a new on-disk format and load/save paths for quantized HNSW; incorrect mean/metric/normalization handling would break index fidelity across restarts.
Overview
Adds HNSW encoding V5 so SQ8 indexes can be saved and reloaded with
quantTypeand an optional mean vector, while unquantized indexes still write V4. Saving no longer throws for quantized indices; write version is chosen viagetWriteVersion().Factory/load path reads V5 metadata, builds SQ8 components (FP32/FP16, L2/IP), rejects unknown quantizers, and documents
is_normalized=truefor pre-normalized cosine SQ8 snapshots. Test builds keep quantization metadata on the index for round-trip checks (replacing the old “reject SQ8 serialization” test).Microbenchmarks gain standalone and tiered SQ8 HNSW fixtures (DBpedia/fashion), V5 download lists, query normalization for IP-style cosine SQ8, tiered TopK/range/memory/add/delete registrations, set-based range recall, and a
convert_to_sq8.pyhelper plus benchmark docs for regenerating*-sq8.hnsw_v5files.Reviewed by Cursor Bugbot for commit 226ddda. Bugbot is set up for automated code reviews on this repo. Configure here.