Faiss has added flat support for HNSW and supports SQ/PQ/PRQ, which currently results in two HNSW options within knowhere, both offering identical parameters and capabilities but with different naming (FAISS_HNSW_FLAT vs. HNSW). This dual support increases future maintenance costs (since both sets of HNSW need to be maintained) and adds user complexity (users must rebuild and replace indexes).
If the goal is to use FAISS_HNSW to replace HNSW, a compatibility solution should be provided—allowing FAISS_HNSW to load pre-existing HNSW indexes and support search/range_search/iterator capabilities. This would centralize all HNSW-related logic into FAISS_HNSW, automatically transitioning users to FAISS_HNSW after upgrading.
Two potential approaches to address this:
Code Compatibility Handling
Remove hnsw.cc and associated hnswlib code.
Rename FAISS_HNSW_FLAT to "HNSW" and route HNSW-related requests to FAISS_HNSW.
When deserializing, FAISS_HNSW should recognize HNSW binaries and load them compatibly, handling iterator/search/range_search requests.
Version Isolation
Rename HNSW in hnsw.cc to HNSWXXX.
Upgrade the index version (from 5 to 6).
Rename FAISS_HNSW_FLAT to "HNSW" and route HNSW-related requests to FAISS_HNSW.
FAISS_HNSW should delegate requests to HNSWXXX for versions ≤ 5; for versions > 5, FAISS_HNSW should handle them internally.
Faiss has added flat support for HNSW and supports SQ/PQ/PRQ, which currently results in two HNSW options within knowhere, both offering identical parameters and capabilities but with different naming (FAISS_HNSW_FLAT vs. HNSW). This dual support increases future maintenance costs (since both sets of HNSW need to be maintained) and adds user complexity (users must rebuild and replace indexes).
If the goal is to use FAISS_HNSW to replace HNSW, a compatibility solution should be provided—allowing FAISS_HNSW to load pre-existing HNSW indexes and support search/range_search/iterator capabilities. This would centralize all HNSW-related logic into FAISS_HNSW, automatically transitioning users to FAISS_HNSW after upgrading.
Two potential approaches to address this:
Code Compatibility Handling
Version Isolation