Conversation
iaojnh
requested review from
chinaux,
feihongxu0824 and
richyreachy
as code owners
September 16, 2026 07:27
Reduce construction RSS by streaming merged inputs, copying only selected PQ training vectors, and releasing completed build buffers earlier. Use a prefix view to preserve the existing PQ training population and sampling order. Bound encoding batches to a 4 MiB target and release graph vectors before encoding. Apply the IVF build lifecycle to DiskANN: release the completed builder before opening the persisted index, retain retryable state after failures, and free input holders, converters, and cached vectors after success. Propagate deferred source read failures during streaming dumps. Add regression coverage for FP32/FP16 and L2/Cosine builds, resource cleanup, dump/open retries, deferred read failures, and legacy PQ sample order. Validation on Linux ARM64: 112 tests passed, with 2 architecture-specific skips. Peak RSS decreased by 30.6-59.7% across direct and merged FP32/FP16 builds in the 20,000 x 768 synthetic workload. Direct FP32 uses the median of three runs per version; other cases use one run per version.
iaojnh
force-pushed
the
fix/merge-memory-used
branch
from
September 16, 2026 07:35
a3eb9be to
c2ee3b3
Compare
Preserve DiskANN build-state and memory-release behavior while adopting main's method naming. Update the regression test initialization call to the renamed API.
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.
Summary
Reduce peak RSS during DiskANN index construction by avoiding redundant vector copies and releasing build buffers earlier. Apply the build lifecycle and streaming merge approach introduced for IVF in #733.
Changes
Validation
Linux ARM64, GCC 13.3, Release build:
Peak RSS
Measured against baseline
70f12576using 20,000 vectors with 768 dimensions, 4 threads, graph degree 32, build list size 50, and 48 PQ chunks.Direct FP32 values are medians of three runs per version; other cases use one run per version. Peak RSS includes input preparation, construction, dumping, and opening the index. All 12 builds passed document-count and sampled-vector checks.
These synthetic measurements establish RSS savings for the tested workload. Limited query coverage and substantial timing variation do not establish recall or build-time equivalence.