From d332dadf9b3b5b807eb810e591b264f8cf338bbd Mon Sep 17 00:00:00 2001 From: "xj.lin" Date: Tue, 16 Jul 2019 15:25:33 +0800 Subject: [PATCH] add some log Former-commit-id: c5432276b5ade9bb1dce687ea1cfe04840078cbb --- cpp/src/db/ExecutionEngineImpl.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cpp/src/db/ExecutionEngineImpl.cpp b/cpp/src/db/ExecutionEngineImpl.cpp index 64aabb3777..ead97dfe38 100644 --- a/cpp/src/db/ExecutionEngineImpl.cpp +++ b/cpp/src/db/ExecutionEngineImpl.cpp @@ -37,14 +37,17 @@ VecIndexPtr ExecutionEngineImpl::CreatetVecIndex(EngineType type) { std::shared_ptr index; switch (type) { case EngineType::FAISS_IDMAP: { + ENGINE_LOG_DEBUG << "Build Index: IDMAP"; index = GetVecIndexFactory(IndexType::FAISS_IDMAP); break; } case EngineType::FAISS_IVFFLAT_GPU: { + ENGINE_LOG_DEBUG << "Build Index: IVFMIX"; index = GetVecIndexFactory(IndexType::FAISS_IVFFLAT_MIX); break; } case EngineType::FAISS_IVFFLAT_CPU: { + ENGINE_LOG_DEBUG << "Build Index: IVFCPU"; index = GetVecIndexFactory(IndexType::FAISS_IVFFLAT_CPU); break; } @@ -135,6 +138,7 @@ ExecutionEngineImpl::BuildIndex(const std::string &location) { auto from_index = std::dynamic_pointer_cast(index_); auto to_index = CreatetVecIndex(build_type); + ENGINE_LOG_DEBUG << "Build Params: [gpu_id] " << gpu_num; to_index->BuildAll(Count(), from_index->GetRawVectors(), from_index->GetRawIds(), @@ -148,6 +152,7 @@ Status ExecutionEngineImpl::Search(long n, long k, float *distances, long *labels) const { + ENGINE_LOG_DEBUG << "Search Params: [k] " << k << " [nprobe] " << nprobe_; index_->Search(n, data, distances, labels, Config::object{{"k", k}, {"nprobe", nprobe_}}); return Status::OK(); } @@ -169,7 +174,7 @@ Status ExecutionEngineImpl::Init() { } case EngineType::FAISS_IVFFLAT_CPU: { ConfigNode engine_config = config.GetConfig(CONFIG_ENGINE); - nprobe_ = engine_config.GetInt32Value(CONFIG_NPROBE, 1000); + nprobe_ = engine_config.GetInt32Value(CONFIG_NPROBE, 1); break; } }