Repository navigation
Conversation
- Add base node IDs for sequential access. - Scattered writes happen only in deserialization step using host memory.
- `materialize_to_hnswlib` enables disk-to-disk materialization of a layered HNSW artifact to a standard hnswlib index fiel. - Adds bindings
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
…-index # Conflicts: # cpp/bench/ann/src/cuvs/cuvs_cagra_hnswlib.cu # cpp/bench/ann/src/cuvs/cuvs_cagra_hnswlib_wrapper.h # cpp/include/cuvs/neighbors/hnsw.hpp # cpp/include/cuvs/util/file_io.hpp # cpp/src/neighbors/detail/cagra/cagra_build.cuh # cpp/src/neighbors/detail/hnsw.hpp # cpp/src/util/file_io.cpp # cpp/tests/neighbors/ann_hnsw_ace.cuh # cpp/tests/neighbors/ann_hnsw_ace/test_float_uint32_t.cu # cpp/tests/neighbors/ann_hnsw_ace/test_half_uint32_t.cu # cpp/tests/neighbors/ann_hnsw_ace/test_int8_t_uint32_t.cu # cpp/tests/neighbors/ann_hnsw_ace/test_uint8_t_uint32_t.cu # examples/cpp/CMakeLists.txt # examples/cpp/src/hnsw_ace_layered_example.cu # java/cuvs-java/src/main/java/com/nvidia/cuvs/HnswIndexParams.java # java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/HnswIndexImpl.java # python/cuvs/cuvs/neighbors/hnsw/hnsw.pyx
julianmi
marked this pull request as ready for review
September 23, 2026 06:19
…IA#2654) BBQ is a data compression technique that is a variant of RaBitQ. It is used in Lucene and Elasticsearch to compresses vectors while keeping search fast and accurate. Supporting it in cuVS enables indexing on data compressed up to ~32× With this PR cuVS users will be able to build a CAGRA index using the NN-Descent algorithm with their BBQ-Quantized Data. Closes NVIDIA#2326 Authors: - Micka (https://github.com/lowener) - Artem M. Chirkin (https://github.com/achirkin) - Yuxi Sun (https://github.com/sherylll) - Anupam (https://github.com/aamijar) - Igor Motov (https://github.com/imotov) Approvers: - Tamas Bela Feher (https://github.com/tfeher) - Kyle Edwards (https://github.com/KyleFromNVIDIA) - Igor Motov (https://github.com/imotov) - Corey J. Nolet (https://github.com/cjnolet) URL: NVIDIA#2654
Due to updates to dependencies and cuvs we have hit our previous limit for CUDA 12 binary size. Bump the limit by 7mb to allow more feature development. Authors: - Robert Maynard (https://github.com/robertmaynard) Approvers: - Kyle Edwards (https://github.com/KyleFromNVIDIA) URL: NVIDIA#2676
julianmi
force-pushed
the
materialize-layered-index
branch
from
September 23, 2026 12:06
d489e9d to
693f022
Compare
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.
#2148 added a HNSW layered index that compacts the HNSW index by stripping out the dataset. This can be especially beneficial if the index is built on an accelerated machine and moved over a network to a search node. This proposal adds
cuvs::neighbors::hnsw::materialize_to_hnswlib, a file-to-file API that converts aGRAPH_ONLYartifact (graph topology only, stored in ACE/build order) plus its original-ID-ordered dataset into a standard hnswlib index file.Public API (
cpp/include/cuvs/neighbors/hnsw.hpp)I don't think there is a similar API in cuVS nor hnswlib. Thus, I've aligned the naming with the existing
serialize_to_hnswliband usedmaterializeto clarify that the result is a hnswlib index file. I'm open for other naming suggestions.A single entry point covers all dtypes: the element type (
float,half,uint8_t,int8_t) isread from the artifact header and dispatched internally.
Implementation (
cpp/src/neighbors/detail/hnsw.hpp)The goal is to minimize the random access necessary for the ID reordering. The random access in main memory is cheap but severe for disk I/O. Thus, two passes are used:
layout constants from a dummy single-element index, compute the output layout,
posix_fallocatethe output, and write the native hnswlib header.
vectors, emitting
[level-0 link block | vector | label]sequentially. Two strategies:max_host_memory_gb;id_record_spiller) otherwise — sequential append + sequential replayper bucket, peak RAM bounded near the budget.
sequentially, with the same in-memory / bucketed fallback.
The output is the exact upstream layout (header + level-0 array + per-element link lists), loadable
by
hnswlib::loadIndexand bycuvs::neighbors::hnsw::deserializewithhierarchy == CPU.Details
base_links_bytes / num_buckets) + small (~64 MiB) streamingbuffers +
levels(n bytes) + the upper locator. With the in-memory pass, RAM ≈ the base topologyonly and a budget lowers it further.
(in-memory) or read once + temp write/read once (bucketed), and upper read once + written once.
cpp/tests/neighbors/ann_hnsw_ace*.examples/cpp/src/hnsw_ace_layered_example.cuwas updated to use the materialization path.