From b0d58665077dab361a455b72e4318566633dfd79 Mon Sep 17 00:00:00 2001
From: liliu-z <105927039+liliu-z@users.noreply.github.com>
Date: Tue, 15 Oct 2024 12:29:22 +0800
Subject: [PATCH] enhance: add checkers for Faiss-based HNSW (#36857)
Knowhere introduced FAISS-based HNSQ Flat/SQ/PQ/PRQ. This PR adds param
check in Milvus side.
This PR actually do nothing but let the check pass, since:
1. All indexes param check will be moved to Knowhere recently. @foxspy
2. The index name will be changed from `FAISS_HNSW_xx` to `HNSW_xx`
after QA test. @alexanderguzhva
Signed-off-by: Li Liu
---
pkg/util/indexparamcheck/conf_adapter_mgr.go | 4 ++++
pkg/util/indexparamcheck/index_type.go | 8 ++++++++
2 files changed, 12 insertions(+)
diff --git a/pkg/util/indexparamcheck/conf_adapter_mgr.go b/pkg/util/indexparamcheck/conf_adapter_mgr.go
index 2ff7320c9b3a2..f9957a95ee524 100644
--- a/pkg/util/indexparamcheck/conf_adapter_mgr.go
+++ b/pkg/util/indexparamcheck/conf_adapter_mgr.go
@@ -57,6 +57,10 @@ func (mgr *indexCheckerMgrImpl) registerIndexChecker() {
mgr.checkers[IndexHNSW] = newHnswChecker()
mgr.checkers[IndexDISKANN] = newDiskannChecker()
mgr.checkers[IndexSparseInverted] = newSparseInvertedIndexChecker()
+ mgr.checkers[IndexFaissHNSW] = newFloatVectorBaseChecker()
+ mgr.checkers[IndexFaissHNSWPQ] = newFloatVectorBaseChecker()
+ mgr.checkers[IndexFaissHNSWSQ] = newFloatVectorBaseChecker()
+ mgr.checkers[IndexFaissHNSWPRQ] = newFloatVectorBaseChecker()
// WAND doesn't have more index params than sparse inverted index, thus
// using the same checker.
mgr.checkers[IndexSparseWand] = newSparseInvertedIndexChecker()
diff --git a/pkg/util/indexparamcheck/index_type.go b/pkg/util/indexparamcheck/index_type.go
index c71de97b0590c..0fc409bf6fe63 100644
--- a/pkg/util/indexparamcheck/index_type.go
+++ b/pkg/util/indexparamcheck/index_type.go
@@ -40,6 +40,14 @@ const (
IndexDISKANN IndexType = "DISKANN"
IndexSparseInverted IndexType = "SPARSE_INVERTED_INDEX"
IndexSparseWand IndexType = "SPARSE_WAND"
+ // For temporary use, will be removed in the future.
+ // 1. All Index related param check will be moved to Knowhere recently.
+ // 2. FAISS_HNSW_xxx will be rename to HNSW_xxx after QA test. We keep the original name for comparison purpose.
+ // TODO: @liliu-z @foxspy
+ IndexFaissHNSW IndexType = "FAISS_HNSW_FLAT"
+ IndexFaissHNSWPQ IndexType = "FAISS_HNSW_PQ"
+ IndexFaissHNSWSQ IndexType = "FAISS_HNSW_SQ"
+ IndexFaissHNSWPRQ IndexType = "FAISS_HNSW_PRQ"
// scalar index
IndexSTLSORT IndexType = "STL_SORT"