diff --git a/CHANGELOG.md b/CHANGELOG.md index 51409451b9..f8830194ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,7 +44,9 @@ Please mark all change in change log and use the ticket from JIRA. - \#599 - Build index log is incorrect - \#602 - Optimizer specify wrong gpu_id - \#606 - No log generated during building index with CPU +- \#616 - IP search metric_type is not supported by IVF_PQ index - \#631 - FAISS isn't compiled with O3 option +- \#636 - [CPU] Create index PQ should be failed if table metric type set Inner Product - \#649 - Typo "partiton" should be "partition" - \#654 - Random crash when frequently insert vector one by one - \#658 - Milvus error out when building SQ8H index without GPU resources diff --git a/core/src/server/grpc_impl/request/CreateIndexRequest.cpp b/core/src/server/grpc_impl/request/CreateIndexRequest.cpp index 9cb7a4c9e7..c48331bf44 100644 --- a/core/src/server/grpc_impl/request/CreateIndexRequest.cpp +++ b/core/src/server/grpc_impl/request/CreateIndexRequest.cpp @@ -16,6 +16,7 @@ // under the License. #include "server/grpc_impl/request/CreateIndexRequest.h" +#include "server/Config.h" #include "server/DBWrapper.h" #include "utils/Log.h" #include "utils/TimeRecorder.h" @@ -75,6 +76,20 @@ CreateIndexRequest::OnExecute() { return status; } +#ifdef MILVUS_GPU_VERSION + Status s; + bool enable_gpu = false; + server::Config& config = server::Config::GetInstance(); + s = config.GetGpuResourceConfigEnable(enable_gpu); + engine::meta::TableSchema table_info; + table_info.table_id_ = table_name_; + status = DBWrapper::DB()->DescribeTable(table_info); + if (s.ok() && grpc_index.index_type() == (int)engine::EngineType::FAISS_PQ && + table_info.metric_type_ == (int)engine::MetricType::IP) { + return Status(SERVER_UNEXPECTED_ERROR, "PQ not support IP in GPU version!"); + } +#endif + // step 2: check table existence engine::TableIndex index; index.engine_type_ = grpc_index.index_type(); diff --git a/core/src/wrapper/ConfAdapter.cpp b/core/src/wrapper/ConfAdapter.cpp index 6b1667f9d7..0214025ed7 100644 --- a/core/src/wrapper/ConfAdapter.cpp +++ b/core/src/wrapper/ConfAdapter.cpp @@ -18,6 +18,7 @@ #include "wrapper/ConfAdapter.h" #include "WrapperException.h" #include "knowhere/index/vector_index/helpers/IndexParameter.h" +#include "server/Config.h" #include "utils/Log.h" #include @@ -130,6 +131,17 @@ IVFPQConfAdapter::Match(const TempMetaConf& metaconf) { conf->nbits = 8; MatchBase(conf); +#ifdef MILVUS_GPU_VERSION + Status s; + bool enable_gpu = false; + server::Config& config = server::Config::GetInstance(); + s = config.GetGpuResourceConfigEnable(enable_gpu); + if (s.ok() && conf->metric_type == knowhere::METRICTYPE::IP) { + WRAPPER_LOG_ERROR << "PQ not support IP in GPU version!"; + throw WrapperException("PQ not support IP in GPU version!"); + } +#endif + /* * Faiss 1.6 * Only 1, 2, 3, 4, 6, 8, 10, 12, 16, 20, 24, 28, 32 dims per sub-quantizer are currently supported with