diff --git a/cpp/CHANGELOG.md b/cpp/CHANGELOG.md index b50a7e90fcc4c88f611eed34a0efeffdc5054bfa..3d87261868e5af6b15fa0f70126f2934328d1bd6 100644 --- a/cpp/CHANGELOG.md +++ b/cpp/CHANGELOG.md @@ -92,6 +92,7 @@ Please mark all change in change log and use the ticket from JIRA. - MS-487 - Define metric type in CreateTable - MS-488 - Improve code format in scheduler - MS-495 - cmake: integrated knowhere +- MS-496 - Change the top_k limitation from 1024 to 2048 - MS-505 - Install core unit test and add to coverage ## New Feature diff --git a/cpp/src/utils/ValidationUtil.cpp b/cpp/src/utils/ValidationUtil.cpp index f12d68b36402583be0ed94ffec902806ca41f680..bce8143c1a4045a5b4c4ca2e0a467daf76d82e8c 100644 --- a/cpp/src/utils/ValidationUtil.cpp +++ b/cpp/src/utils/ValidationUtil.cpp @@ -94,7 +94,7 @@ ValidationUtil::ValidateTableIndexMetricType(int32_t metric_type) { ErrorCode ValidationUtil::ValidateSearchTopk(int64_t top_k, const engine::meta::TableSchema& table_schema) { - if (top_k <= 0 || top_k > 1024) { + if (top_k <= 0 || top_k > 2048) { return SERVER_INVALID_TOPK; } diff --git a/cpp/src/wrapper/knowhere/vec_index.cpp b/cpp/src/wrapper/knowhere/vec_index.cpp index e14496884de959f7198febc684b5e3ece3da01d4..1ee8697d64a97da5b316657cad96b8814365831e 100644 --- a/cpp/src/wrapper/knowhere/vec_index.cpp +++ b/cpp/src/wrapper/knowhere/vec_index.cpp @@ -14,6 +14,8 @@ #include "vec_impl.h" #include "wrapper_log.h" +#include + namespace zilliz { namespace milvus { @@ -246,11 +248,13 @@ void ParameterValidation(const IndexType &type, Config &cfg) { case IndexType::FAISS_IVFSQ8_GPU: case IndexType::FAISS_IVFFLAT_GPU: case IndexType::FAISS_IVFPQ_GPU: { + //search on GPU if (cfg.get_with_default("nprobe", 0) != 0) { auto nprobe = cfg["nprobe"].as(); if (nprobe > GPU_MAX_NRPOBE) { - 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"; + 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 137429d1ad5168345cac1c1345f84392988a38ae..a5cdcabf04a836d6c8f9a6e4970c671cc5da5e66 100644 --- a/cpp/src/wrapper/knowhere/vec_index.h +++ b/cpp/src/wrapper/knowhere/vec_index.h @@ -14,8 +14,6 @@ #include "knowhere/common/config.h" #include "knowhere/common/binary_set.h" -#include "cuda.h" - namespace zilliz { namespace milvus { @@ -62,7 +60,7 @@ class VecIndex { long *ids, const Config &cfg = Config()) = 0; - virtual VecIndexPtr CopyToGpu(const int64_t& device_id, + virtual VecIndexPtr CopyToGpu(const int64_t &device_id, const Config &cfg = Config()) = 0; virtual VecIndexPtr CopyToCpu(const Config &cfg = Config()) = 0; @@ -86,16 +84,16 @@ extern ErrorCode write_index(VecIndexPtr index, const std::string &location); extern VecIndexPtr read_index(const std::string &location); -extern VecIndexPtr GetVecIndexFactory(const IndexType &type, const Config& cfg = Config()); +extern VecIndexPtr GetVecIndexFactory(const IndexType &type, const Config &cfg = Config()); extern VecIndexPtr LoadVecIndex(const IndexType &index_type, const zilliz::knowhere::BinarySet &index_binary); -extern void AutoGenParams(const IndexType& type, const long& size, Config& cfg); +extern void AutoGenParams(const IndexType &type, const long &size, Config &cfg); -extern void ParameterValidation(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); +extern IndexType ConvertToCpuIndexType(const IndexType &type); +extern IndexType ConvertToGpuIndexType(const IndexType &type); } }