diff --git a/cpp/src/db/ExecutionEngine.h b/cpp/src/db/ExecutionEngine.h index 1a396cd72b..f942e1faa6 100644 --- a/cpp/src/db/ExecutionEngine.h +++ b/cpp/src/db/ExecutionEngine.h @@ -20,7 +20,7 @@ enum class EngineType { FAISS_IVFFLAT, FAISS_IVFSQ8, NSG_MIX, - MAX_VALUE = FAISS_IVFSQ8, + MAX_VALUE = NSG_MIX, }; class ExecutionEngine { diff --git a/cpp/src/wrapper/knowhere/vec_index.cpp b/cpp/src/wrapper/knowhere/vec_index.cpp index 70fa488dec..1473afbc23 100644 --- a/cpp/src/wrapper/knowhere/vec_index.cpp +++ b/cpp/src/wrapper/knowhere/vec_index.cpp @@ -203,11 +203,13 @@ void AutoGenParams(const IndexType &type, const long &size, zilliz::knowhere::Co case IndexType::NSG_MIX: { auto scale_factor = round(cfg["dim"].as() / 128.0); scale_factor = scale_factor >= 4 ? 4 : scale_factor; - if (!cfg.contains("nprobe")) { cfg["nprobe"] = 16 + 10 * scale_factor; } + cfg["nlist"] = int(size / 1000000.0 * 8192); + if (!cfg.contains("nprobe")) { cfg["nprobe"] = 6 + 10 * scale_factor; } if (!cfg.contains("knng")) { cfg["knng"] = 100 + 100 * scale_factor; } - if (!cfg.contains("search_length")) { cfg["search_length"] = 30 + 10 * scale_factor; } - if (!cfg.contains("out_degree")) { cfg["out_degree"] = 40 + 5 * scale_factor; } + if (!cfg.contains("search_length")) { cfg["search_length"] = 40 + 5 * scale_factor; } + if (!cfg.contains("out_degree")) { cfg["out_degree"] = 50 + 5 * scale_factor; } if (!cfg.contains("candidate_pool_size")) { cfg["candidate_pool_size"] = 200 + 100 * scale_factor; } + WRAPPER_LOG_DEBUG << pretty_print(cfg); break; } } diff --git a/cpp/thirdparty/knowhere b/cpp/thirdparty/knowhere index 5032e91e3d..6a4f242ec4 160000 --- a/cpp/thirdparty/knowhere +++ b/cpp/thirdparty/knowhere @@ -1 +1 @@ -Subproject commit 5032e91e3d8bee1760c3f86f7eb4c857e59546ad +Subproject commit 6a4f242ec40c539f1e6d9a7305282f7ff03c19d2 diff --git a/cpp/unittest/index_wrapper/knowhere_test.cpp b/cpp/unittest/index_wrapper/knowhere_test.cpp index 8043c3b961..abe7c84d4e 100644 --- a/cpp/unittest/index_wrapper/knowhere_test.cpp +++ b/cpp/unittest/index_wrapper/knowhere_test.cpp @@ -110,9 +110,9 @@ INSTANTIATE_TEST_CASE_P(WrapperParam, KnowhereWrapperTest, Config::object{{"dim", 64}, {"k", 10}, {"nprobe", 5}} ), std::make_tuple(IndexType::NSG_MIX, "Default", - 128, 100000, 10, 10, - Config::object{{"dim", 128}, {"nlist", 1638}, {"nprobe", 10}, {"metric_type", "L2"}, - {"knng", 50}, {"search_length", 40}, {"out_degree", 30}, {"candidate_pool_size", 200}}, + 128, 250000, 10, 10, + Config::object{{"dim", 128}, {"nlist", 8192}, {"nprobe", 16}, {"metric_type", "L2"}, + {"knng", 200}, {"search_length", 40}, {"out_degree", 60}, {"candidate_pool_size", 200}}, Config::object{{"k", 10}, {"search_length", 20}} ) //std::make_tuple(IndexType::SPTAG_KDT_RNT_CPU, "Default",