Skip to content

Implement serialization for IndexIVFFlatPanorama#4636

Closed
aknayar wants to merge 2 commits into
facebookresearch:mainfrom
aknayar:panorama-read-write
Closed

Implement serialization for IndexIVFFlatPanorama#4636
aknayar wants to merge 2 commits into
facebookresearch:mainfrom
aknayar:panorama-read-write

Conversation

@aknayar

@aknayar aknayar commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

Changes

This PR implements write_index and read_index for IndexIVFFlatPanorama.

Testing

Added a test to test_panorama to verify integrity of search() results after writing and reading back the index from disk.

@meta-cla meta-cla Bot added the CLA Signed label Oct 24, 2025
WRITE1(ailp->nlist);
WRITE1(ailp->code_size);
WRITE1(ailp->n_levels);
uint32_t list_type = fourcc("full");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice that the implementation for ArrayInvertedLists potentially writes a sparse buffer. However, I'm pretty sure that case is incredibly unlikely, and thus didn't implement it here. That being said, if others think it's worthwhile to implement that case, I will.

Comment thread tests/test_panorama.py
xt, xb, xq = self.generate_data(d, nt, nb, nq, seed=2024)

# Create and populate Panorama indexes
indexes = [self.create_panorama(d, nlist, nlevels, xt, xb, nprobe=32)]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintained as a list to prepare for other incoming Panorama indexes (e.g. IndexHNSWFlatPanorama #4621).

@mnorris11 mnorris11 self-requested a review October 24, 2025 17:22
@meta-codesync

meta-codesync Bot commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

@mnorris11 has imported this pull request. If you are a Meta employee, you can view this in D85450597.

@meta-codesync

meta-codesync Bot commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

@mnorris11 merged this pull request in 859127c.

dimitraseferiadi pushed a commit to dimitraseferiadi/SuCo_CSPG_SHG that referenced this pull request Mar 8, 2026
…4636)

Summary:
## Changes
This PR implements `write_index` and `read_index` for `IndexIVFFlatPanorama`.

## Testing
Added a test to `test_panorama` to verify integrity of `search()` results after writing and reading back the index from disk.

Pull Request resolved: facebookresearch#4636

Reviewed By: subhadeepkaran

Differential Revision: D85450597

Pulled By: mnorris11

fbshipit-source-id: 19e065f223b60f8abe14bb0bb8f67f2c8f339234
dimitraseferiadi pushed a commit to dimitraseferiadi/SuCo_CSPG_SHG that referenced this pull request Mar 16, 2026
…4636)

Summary:
## Changes
This PR implements `write_index` and `read_index` for `IndexIVFFlatPanorama`.

## Testing
Added a test to `test_panorama` to verify integrity of `search()` results after writing and reading back the index from disk.

Pull Request resolved: facebookresearch#4636

Reviewed By: subhadeepkaran

Differential Revision: D85450597

Pulled By: mnorris11

fbshipit-source-id: 19e065f223b60f8abe14bb0bb8f67f2c8f339234
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.

2 participants