diff --git a/cpp/src/wrapper/knowhere/vec_impl.cpp b/cpp/src/wrapper/knowhere/vec_impl.cpp index edb20cf8a3d4a3afe6e0cb9cdaa73beae57535ea..cecf9dc8ce3da869dac766137837d668478ddaef 100644 --- a/cpp/src/wrapper/knowhere/vec_impl.cpp +++ b/cpp/src/wrapper/knowhere/vec_impl.cpp @@ -74,7 +74,7 @@ server::KnowhereError VecIndexImpl::Search(const long &nq, const float *xq, floa Config search_cfg = cfg; - AutoTurnParams(type, search_cfg); + ParameterValidation(type, search_cfg); auto res = index_->Search(dataset, search_cfg); auto ids_array = res->array()[0]; diff --git a/cpp/src/wrapper/knowhere/vec_index.cpp b/cpp/src/wrapper/knowhere/vec_index.cpp index 2e4be3f2549b6743ba163a16dda567c4618f7b75..95ca7edb90a444671c4ff2dba3c89411e672f57b 100644 --- a/cpp/src/wrapper/knowhere/vec_index.cpp +++ b/cpp/src/wrapper/knowhere/vec_index.cpp @@ -241,7 +241,7 @@ void AutoGenParams(const IndexType &type, const long &size, zilliz::knowhere::Co #define GPU_MAX_NRPOBE 1024 #endif -void AutoTurnParams(const IndexType &type, Config &cfg) { +void ParameterValidation(const IndexType &type, Config &cfg) { switch (type) { case IndexType::FAISS_IVFSQ8_GPU: case IndexType::FAISS_IVFFLAT_GPU: @@ -249,7 +249,7 @@ void AutoTurnParams(const IndexType &type, Config &cfg) { if (cfg.get_with_default("nprobe", 0) != 0) { auto nprobe = cfg["nprobe"].as(); if (nprobe > GPU_MAX_NRPOBE) { - WRAPPER_LOG_ERROR << "When search with GPU, nprobe shoud be no more than " << GPU_MAX_NRPOBE << ", but you passed " << nprobe + WRAPPER_LOG_WARNING << "When search with GPU, nprobe shoud be no more than " << GPU_MAX_NRPOBE << ", but you passed " << nprobe << ". Search with " << GPU_MAX_NRPOBE << " instead"; cfg.insert_or_assign("nprobe", GPU_MAX_NRPOBE); } diff --git a/cpp/src/wrapper/knowhere/vec_index.h b/cpp/src/wrapper/knowhere/vec_index.h index b5170acb72cb3f0f844ccf37f4f5b552953aab96..c2b7d9e8908ea8876377bb9bd29b1e88eafbb8ec 100644 --- a/cpp/src/wrapper/knowhere/vec_index.h +++ b/cpp/src/wrapper/knowhere/vec_index.h @@ -92,7 +92,7 @@ extern VecIndexPtr LoadVecIndex(const IndexType &index_type, const zilliz::knowh extern void AutoGenParams(const IndexType& type, const long& size, Config& cfg); -extern void AutoTurnParams(const IndexType& type, Config& cfg); +extern void ParameterValidation(const IndexType& type, Config& cfg); extern IndexType ConvertToCpuIndexType(const IndexType& type); extern IndexType ConvertToGpuIndexType(const IndexType& type);