Skip to content

Commit

Permalink
revert hnsw to hnswlib
Browse files Browse the repository at this point in the history
Signed-off-by: xianliang.li <[email protected]>
  • Loading branch information
foxspy committed Dec 18, 2024
1 parent cae8d1f commit 10579c2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
24 changes: 12 additions & 12 deletions src/index/hnsw/faiss_hnsw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2272,21 +2272,21 @@ class BaseFaissRegularIndexHNSWPRQNodeTemplate : public BaseFaissRegularIndexHNS
}
};

// MV is only for compatibility
#ifdef KNOWHERE_WITH_CARDINAL
KNOWHERE_SIMPLE_REGISTER_DENSE_FLOAT_ALL_GLOBAL(HNSW_DEPRECATED,
BaseFaissRegularIndexHNSWFlatNodeTemplateWithSearchFallback,
knowhere::feature::MMAP | knowhere::feature::MV)
#else
KNOWHERE_SIMPLE_REGISTER_DENSE_FLOAT_ALL_GLOBAL(HNSW, BaseFaissRegularIndexHNSWFlatNodeTemplateWithSearchFallback,
knowhere::feature::MMAP | knowhere::feature::MV)
#endif
//// MV is only for compatibility
// #ifdef KNOWHERE_WITH_CARDINAL
// KNOWHERE_SIMPLE_REGISTER_DENSE_FLOAT_ALL_GLOBAL(HNSW_DEPRECATED,
// BaseFaissRegularIndexHNSWFlatNodeTemplateWithSearchFallback,
// knowhere::feature::MMAP | knowhere::feature::MV)
// #else
// KNOWHERE_SIMPLE_REGISTER_DENSE_FLOAT_ALL_GLOBAL(HNSW, BaseFaissRegularIndexHNSWFlatNodeTemplateWithSearchFallback,
// knowhere::feature::MMAP | knowhere::feature::MV)
// #endif

KNOWHERE_SIMPLE_REGISTER_DENSE_FLOAT_ALL_GLOBAL(HNSW_SQ, BaseFaissRegularIndexHNSWSQNodeTemplate,
knowhere::feature::MMAP)
knowhere::feature::NONE)
KNOWHERE_SIMPLE_REGISTER_DENSE_FLOAT_ALL_GLOBAL(HNSW_PQ, BaseFaissRegularIndexHNSWPQNodeTemplate,
knowhere::feature::MMAP)
knowhere::feature::NONE)
KNOWHERE_SIMPLE_REGISTER_DENSE_FLOAT_ALL_GLOBAL(HNSW_PRQ, BaseFaissRegularIndexHNSWPRQNodeTemplate,
knowhere::feature::MMAP)
knowhere::feature::NONE)

} // namespace knowhere
8 changes: 6 additions & 2 deletions src/index/hnsw/hnsw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ template class HnswIndexNode<knowhere::fp32, hnswlib::QuantType::None>;
template class HnswIndexNode<knowhere::fp16, hnswlib::QuantType::None>;
template class HnswIndexNode<knowhere::bf16, hnswlib::QuantType::None>;

KNOWHERE_SIMPLE_REGISTER_DENSE_ALL_GLOBAL(HNSWLIB_DEPRECATED, HnswIndexNode,
knowhere::feature::MMAP | knowhere::feature::MV)
#ifdef KNOWHERE_WITH_CARDINAL
KNOWHERE_SIMPLE_REGISTER_DENSE_FLOAT_ALL_GLOBAL(HNSW_DEPRECATED, HnswIndexNode,
knowhere::feature::MMAP | knowhere::feature::MV)
#else
KNOWHERE_SIMPLE_REGISTER_DENSE_FLOAT_ALL_GLOBAL(HNSW, HnswIndexNode, knowhere::feature::MMAP | knowhere::feature::MV)
#endif

} // namespace knowhere

0 comments on commit 10579c2

Please sign in to comment.