[SVS] Implement memory-mapped I/O for Flat and static Vamana SVS indices#5271
[SVS] Implement memory-mapped I/O for Flat and static Vamana SVS indices#5271rfsaliev wants to merge 5 commits into
Conversation
|
Hi @rfsaliev! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
94b5e8d to
c557940
Compare
|
@mnorris11 has imported this pull request. If you are a Meta employee, you can view this in D108313487. |
This pull request adds support for memory-mapped I/O (mmap) loading of static SVS (Scalable Vector Search) indices in Faiss, enabling faster and more memory-efficient index loading. The main changes include implementing mmap-based deserialization for static Vamana and Flat indices, updating the index loading logic to use mmap when requested, and adding comprehensive tests for the new functionality.
Memory-mapped index loading support:
map_tomethods toIndexSVSVamanaandIndexSVSFlatfor loading static indices directly from memory-mapped files, including logic to manage memory mapping ownership and adjust file positions after mapping.Index and file structure updates:
IndexSVSVamanaandIndexSVSFlatclasses to hold a reference to the mmap owner, ensuring the mapped memory remains valid for the lifetime of the index. Also added forward declarations and includes for mmap-related types.resetmethods to release memory mappings when the index is reset, preventing resource leaks.Testing and interface improvements:
tests/test_svs.cppThese changes collectively provide robust and efficient support for memory-mapped loading of static SVS indices, improving both performance and usability for large-scale vector search applications.