Fix FastScan for indices without own inverted lists + performance optimizations in RaBitQ handler (#5080)#5080
Closed
ALittleYam wants to merge 1 commit intofacebookresearch:mainfrom
Closed
Conversation
Contributor
|
@ALittleYam has exported this pull request. If you are a Meta employee, you can view the originating Diff in D100354524. |
ALittleYam
pushed a commit
to ALittleYam/faiss
that referenced
this pull request
Apr 10, 2026
…imizations in RaBitQ handler (facebookresearch#5080) Summary: When IndexIVFFastScan is created with own_invlists=false (e.g., in unicorn where posting lists are managed externally), two things crash: 1. init_code_packer() asserts that invlists is a BlockInvertedLists, but it's an ArrayInvertedLists. Fix: skip when invlists is not block-packed. 2. RaBitQ scan_codes calls set_list_context which reads from invlists to get factor data. But invlists is empty. Fix: guard the invlists access, and fall back to the codes pointer passed to scan_codes (which already contains the block data with embedded factors). Differential Revision: D100354524
ALittleYam
pushed a commit
to ALittleYam/faiss
that referenced
this pull request
Apr 13, 2026
…imizations in RaBitQ handler (facebookresearch#5080) Summary: When IndexIVFFastScan is created with own_invlists=false (e.g., in unicorn where posting lists are managed externally), two things crash: 1. init_code_packer() asserts that invlists is a BlockInvertedLists, but it's an ArrayInvertedLists. Fix: skip when invlists is not block-packed. 2. RaBitQ scan_codes calls set_list_context which reads from invlists to get factor data. But invlists is empty. Fix: guard the invlists access, and fall back to the codes pointer passed to scan_codes (which already contains the block data with embedded factors). Differential Revision: D100354524
7074e2a to
c1bb2a4
Compare
ALittleYam
pushed a commit
to ALittleYam/faiss
that referenced
this pull request
Apr 13, 2026
…imizations in RaBitQ handler (facebookresearch#5080) Summary: Pull Request resolved: facebookresearch#5080 When IndexIVFFastScan is created with own_invlists=false (e.g., in unicorn where posting lists are managed externally), two things crash: 1. init_code_packer() asserts that invlists is a BlockInvertedLists, but it's an ArrayInvertedLists. Fix: skip when invlists is not block-packed. 2. RaBitQ scan_codes calls set_list_context which reads from invlists to get factor data. But invlists is empty. Fix: guard the invlists access, and fall back to the codes pointer passed to scan_codes (which already contains the block data with embedded factors). Differential Revision: D100354524
c1bb2a4 to
7bef72a
Compare
ALittleYam
pushed a commit
to ALittleYam/faiss
that referenced
this pull request
Apr 13, 2026
…imizations in RaBitQ handler (facebookresearch#5080) Summary: When IndexIVFFastScan is created with own_invlists=false (e.g., in unicorn where posting lists are managed externally), two things crash: 1. init_code_packer() asserts that invlists is a BlockInvertedLists, but it's an ArrayInvertedLists. Fix: skip when invlists is not block-packed. 2. RaBitQ scan_codes calls set_list_context which reads from invlists to get factor data. But invlists is empty. Fix: guard the invlists access, and fall back to the codes pointer passed to scan_codes (which already contains the block data with embedded factors). Differential Revision: D100354524
7bef72a to
c5fae6a
Compare
…imizations in RaBitQ handler (facebookresearch#5080) Summary: When IndexIVFFastScan is created with own_invlists=false (e.g., in unicorn where posting lists are managed externally), two things crash: 1. init_code_packer() asserts that invlists is a BlockInvertedLists, but it's an ArrayInvertedLists. Fix: skip when invlists is not block-packed. 2. RaBitQ scan_codes calls set_list_context which reads from invlists to get factor data. But invlists is empty. Fix: guard the invlists access, and fall back to the codes pointer passed to scan_codes (which already contains the block data with embedded factors). Differential Revision: D100354524
c5fae6a to
e5befa3
Compare
Contributor
|
This pull request has been merged in 740d3a3. |
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:
When IndexIVFFastScan is created with own_invlists=false (e.g., in unicorn
where posting lists are managed externally), two things crash:
init_code_packer() asserts that invlists is a BlockInvertedLists, but it's
an ArrayInvertedLists. Fix: skip when invlists is not block-packed.
RaBitQ scan_codes calls set_list_context which reads from invlists to get
factor data. But invlists is empty. Fix: guard the invlists access, and
fall back to the codes pointer passed to scan_codes (which already
contains the block data with embedded factors).
Differential Revision: D100354524