Commit Graph

3 Commits (fa53e2c9410d8a18380d45dfa32d342c99d116b3)

Author SHA1 Message Date
Matthijs Douze 1c4cb67855 Support more indexes for merge (#2533)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2533

Implements merge_from for IndexIDMap[2] and IndexPreTransform. In the process, split off IndexIDMap to their own .h/.cpp files.

Reviewed By: alexanderguzhva

Differential Revision: D40420373

fbshipit-source-id: 1570a460706dd3fbc1447f9fcc0e2721eab869bb
2022-10-31 11:10:42 -07:00
Abdelrahman Elmeniawy 47a9953a35 add remove and merge features for IndexFastScan (#2497)
Summary:
* Modify pq4_get_paked_element to make it not depend on an auxiliary table
* Create pq4_set_packed_element which sets a single element in codes in packed format
(These methods would be used in merge and remove for IndexFastScan
get method is also used in FastScan indices for reconstruction)
* Add remove feature for IndexFastScan
* Add merge feature for indexFast Scan

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2497

Test Plan:
cd build && make -j
make test
cd faiss/python && python setup.py build && cd ../../..
PYTHONPATH="$(ls -d ./build/faiss/python/build/lib*/)" pytest tests/test_*.py

Reviewed By: mdouze

Differential Revision: D39927403

Pulled By: mdouze

fbshipit-source-id: 45271b98419203dfb1cea4f4e7eaf0662523a5b5
2022-10-11 04:14:29 -07:00
Abdelrahman Elmeniawy c6c7862089 T132029385 support merge for IndexFlatCodes (#2488)
Summary:
support merge for all IndexFlatCodes children
make merge_from and check_compatible_for_merge methods of Index and IndexIVF and IndexFlatCodes(the only supported types) inherit them from Index.

This is part 1 of 2 as merge_into still not updated

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2488

Test Plan:
cd build
make -j
make test
cd faiss/python && python setup.py build
cd ../../..
PYTHONPATH="$(ls -d ./build/faiss/python/build/lib*/)" pytest tests/test_*.py

# fbcode

 buck test //faiss/tests/:test_index_merge

buck test //faiss/tests/:test_io

Reviewed By: mdouze

Differential Revision: D39726378

Pulled By: AbdelrahmanElmeniawy

fbshipit-source-id: 6739477fddcad3c7a990f3aae9be07c1b2b74fef
2022-09-23 07:19:21 -07:00