Support IVF_PQ on GPU with using metric_type IP (#2593)

* Support IVF_PQ on GPU with using metric_type IP

Signed-off-by: shengjun.li <shengjun.li@zilliz.com>

* remove useless code

Signed-off-by: shengjun.li <shengjun.li@zilliz.com>
pull/2598/head^2
shengjun.li 2020-06-18 16:56:34 +08:00 committed by GitHub
parent 0ac668e398
commit b6b56a0852
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 29 deletions

View File

@ -13,6 +13,7 @@ Please mark all changes in change log and use the issue from GitHub
- \#2319 Redo metadata to support MVCC
- \#2509 Count up query statistics for debug ease
- \#2572 Support structured data index
- \#2585 Support IVF_PQ on GPU with using metric_type IP
## Improvement
- \#2543 Remove secondary_path related code

View File

@ -138,16 +138,11 @@ IVFPQConfAdapter::CheckTrain(Config& oricfg, const IndexMode mode) {
static int64_t DEFAULT_NBITS = 8;
static int64_t MAX_NLIST = 999999;
static int64_t MIN_NLIST = 1;
static std::vector<std::string> CPU_METRICS{knowhere::Metric::L2, knowhere::Metric::IP};
static std::vector<std::string> GPU_METRICS{knowhere::Metric::L2};
static std::vector<std::string> METRICS{knowhere::Metric::L2, knowhere::Metric::IP};
oricfg[knowhere::IndexParams::nbits] = DEFAULT_NBITS;
if (mode == IndexMode::MODE_GPU) {
CheckStrByValues(knowhere::Metric::TYPE, GPU_METRICS);
} else {
CheckStrByValues(knowhere::Metric::TYPE, CPU_METRICS);
}
CheckStrByValues(knowhere::Metric::TYPE, METRICS);
CheckIntByRange(knowhere::meta::DIM, DEFAULT_MIN_DIM, DEFAULT_MAX_DIM);
CheckIntByRange(knowhere::meta::ROWS, DEFAULT_MIN_ROWS, DEFAULT_MAX_ROWS);
CheckIntByRange(knowhere::IndexParams::nlist, MIN_NLIST, MAX_NLIST);

View File

@ -96,20 +96,6 @@ CreateIndexRequest::OnExecute() {
}
}
#ifdef MILVUS_GPU_VERSION
Status s;
bool enable_gpu = false;
server::Config& config = server::Config::GetInstance();
s = config.GetGpuResourceConfigEnable(enable_gpu);
fiu_do_on("CreateIndexRequest.OnExecute.ip_meteric",
collection_info.metric_type_ = static_cast<int>(engine::MetricType::IP));
if (s.ok() && adapter_index_type == (int)engine::EngineType::FAISS_PQ &&
collection_info.metric_type_ == (int)engine::MetricType::IP) {
return Status(SERVER_UNEXPECTED_ERROR, "PQ not support IP in GPU version!");
}
#endif
rc.RecordSection("check validation");
// step 3: create index

View File

@ -245,14 +245,6 @@ TEST_F(RpcHandlerTest, INDEX_TEST) {
ASSERT_TRUE(grpc_status.ok());
fiu_disable("CreateIndexRequest.OnExecute.create_index_fail");
#ifdef MILVUS_GPU_VERSION
request.set_index_type(static_cast<int>(milvus::engine::EngineType::FAISS_PQ));
fiu_enable("CreateIndexRequest.OnExecute.ip_meteric", 1, NULL, 0);
grpc_status = handler->CreateIndex(&context, &request, &response);
ASSERT_TRUE(grpc_status.ok());
fiu_disable("CreateIndexRequest.OnExecute.ip_meteric");
#endif
::milvus::grpc::CollectionName collection_name;
::milvus::grpc::IndexParam index_param;
handler->DescribeIndex(&context, &collection_name, &index_param);