Conversation
Reconstruct level-oriented Panorama codes into flat row-major vectors prior to calling add_entries() during InvertedLists::merge_from(), InvertedLists::copy_subset_to(), and IVFlib::get_invlist_range(). Also add check_compatible_for_merge() override in IndexIVFFlatPanorama and test coverage.
This branch has not been deployed
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.
Fixes #5607
Summary
When merging an index backed by
ArrayInvertedListsPanoramausingmerge_from(), vectors transferred from the source index were corrupted becauseInvertedLists::merge_from()calledScopedCodes(oivf, i).get()(which returns Panorama's internal level-major layout) and passed it toadd_entries()(which expects flat row-major vectors).Changes
faiss/invlists/InvertedLists.cpp&.h:InvertedLists::merge_from()virtual.pano.reconstruct()before callingadd_entries()when merging from anArrayInvertedListsPanorama.InvertedLists::copy_subset_to()forSUBSET_TYPE_INVLISTwhen source isArrayInvertedListsPanorama.faiss/IndexIVFFlatPanorama.cpp&.h: Addedcheck_compatible_for_merge()override to enforcen_levelsandbatch_sizeconsistency.faiss/IVFlib.cpp: Handled Panorama vector reconstruction inget_invlist_range().tests/test_merge_index.py: Added unit testtest_merge_IVFFlatPanoramavalidating vector reconstruction fidelity and exact equivalence of search results with vanillaIndexIVFFlat.Test Plan
0.0).pytest tests/test_merge_index.py tests/test_flat_panorama.py(all passed).