Repository navigation
Conversation
Cover both zero-vector batch orderings, byte-for-byte file integrity, exact document and embedding retrieval, subsequent insertion, and reopening. Refs cactus-compute#824 Signed-off-by: th-shivam <dreamyshivam01@gmail.com>
Stage the existing FP16 conversion and normalization for every document before resizing either index file. Reuse the staged embeddings in the write loop so normalization failures leave files and document mappings unchanged. Fixes cactus-compute#824 Signed-off-by: th-shivam <dreamyshivam01@gmail.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
@HenryNdubuaku @ncylich @jakmro Whenever you have some time, could you please review this PR? This PR fixes #824 by staging FP16 conversion and embedding normalization before mutating the mmap-backed index files. It also adds regression coverage for both batch orderings, rejected IDs, file integrity, subsequent insertions, vector correctness, and persistence after reopening. If any changes are required, please let me know and I will update the PR accordingly. Thank you! |
Summary
Fixes #824.
Index::add_documents()previously resized and mutated the index files before all embeddings in a batch had been normalized successfully. If a later embedding was a zero vector, the call failed after partially committing earlier documents. Subsequent insertions could then return incorrect content/vectors, and the successful later insertion could disappear after reopening.This change stages FP16 conversion and normalization for the complete batch before resizing or mutating persistent index state.
Changes
Validation
index.binanddata.binunchanged after rejection.The full ARM64 CMake/inference build was not available in the x86-64 validation environment.
Files changed
cactus-engine/src/index.cppcactus-engine/tests/test_index.cpp