Skip to content

Fix FastScan for indices without own inverted lists + performance optimizations in RaBitQ handler (#5080)#5080

Closed
ALittleYam wants to merge 1 commit intofacebookresearch:mainfrom
ALittleYam:export-D100354524
Closed

Fix FastScan for indices without own inverted lists + performance optimizations in RaBitQ handler (#5080)#5080
ALittleYam wants to merge 1 commit intofacebookresearch:mainfrom
ALittleYam:export-D100354524

Conversation

@ALittleYam
Copy link
Copy Markdown

@ALittleYam ALittleYam commented Apr 10, 2026

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

@meta-cla meta-cla bot added the CLA Signed label Apr 10, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync bot commented Apr 10, 2026

@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
@meta-codesync meta-codesync bot changed the title Fix FastScan for indices without own inverted lists + performance optimizations in RaBitQ handler Fix FastScan for indices without own inverted lists + performance optimizations in RaBitQ handler (#5080) Apr 13, 2026
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
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
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
…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
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync bot commented Apr 13, 2026

This pull request has been merged in 740d3a3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant