未验证 提交 7b949861 编写于 作者: J Jin Hai 提交者: GitHub

Merge pull request #614 from cydrain/caiyd_remove_cpu_version_macro

#611 remove MILVUS_CPU_VERSION
......@@ -72,6 +72,7 @@ Please mark all change in change log and use the ticket from JIRA.
- \#449 - Add ShowPartitions example for C++ SDK
- \#470 - Small raw files should not be build index
- \#584 - Intergrate internal FAISS
- \#611 - Remove MILVUS_CPU_VERSION
## Task
......
......@@ -146,7 +146,6 @@ if (CUSTOMIZATION)
add_compile_definitions(CUSTOMIZATION)
endif ()
set(MILVUS_CPU_VERSION false)
if (MILVUS_GPU_VERSION)
message(STATUS "Building Milvus GPU version")
add_compile_definitions("MILVUS_GPU_VERSION")
......@@ -155,8 +154,6 @@ if (MILVUS_GPU_VERSION)
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -Xcompiler -fPIC -std=c++11 -D_FORCE_INLINES --expt-extended-lambda")
else ()
message(STATUS "Building Milvus CPU version")
set(MILVUS_CPU_VERSION true)
add_compile_definitions("MILVUS_CPU_VERSION")
endif ()
if (MILVUS_WITH_PROMETHEUS)
......
......@@ -1033,10 +1033,10 @@ DBImpl::BuildTableIndexRecursively(const std::string& table_id, const TableIndex
if (!failed_files.empty()) {
std::string msg = "Failed to build index for " + std::to_string(failed_files.size()) +
((failed_files.size() == 1) ? " file" : " files");
#ifdef MILVUS_CPU_VERSION
msg += ", please double check index parameters.";
#else
#ifdef MILVUS_GPU_VERSION
msg += ", file size is too large or gpu memory is not enough.";
#else
msg += ", please double check index parameters.";
#endif
return Status(DB_ERROR, msg);
}
......
......@@ -93,18 +93,18 @@ ExecutionEngineImpl::CreatetVecIndex(EngineType type) {
break;
}
case EngineType::FAISS_IVFFLAT: {
#ifdef MILVUS_CPU_VERSION
index = GetVecIndexFactory(IndexType::FAISS_IVFFLAT_CPU);
#else
#ifdef MILVUS_GPU_VERSION
index = GetVecIndexFactory(IndexType::FAISS_IVFFLAT_MIX);
#else
index = GetVecIndexFactory(IndexType::FAISS_IVFFLAT_CPU);
#endif
break;
}
case EngineType::FAISS_IVFSQ8: {
#ifdef MILVUS_CPU_VERSION
index = GetVecIndexFactory(IndexType::FAISS_IVFSQ8_CPU);
#else
#ifdef MILVUS_GPU_VERSION
index = GetVecIndexFactory(IndexType::FAISS_IVFSQ8_MIX);
#else
index = GetVecIndexFactory(IndexType::FAISS_IVFSQ8_CPU);
#endif
break;
}
......@@ -119,10 +119,10 @@ ExecutionEngineImpl::CreatetVecIndex(EngineType type) {
}
#endif
case EngineType::FAISS_PQ: {
#ifdef MILVUS_CPU_VERSION
index = GetVecIndexFactory(IndexType::FAISS_IVFPQ_CPU);
#else
#ifdef MILVUS_GPU_VERSION
index = GetVecIndexFactory(IndexType::FAISS_IVFPQ_MIX);
#else
index = GetVecIndexFactory(IndexType::FAISS_IVFPQ_CPU);
#endif
break;
}
......
......@@ -58,10 +58,10 @@ print_banner() {
<< "OpenBLAS"
#endif
<< " library." << std::endl;
#ifdef MILVUS_CPU_VERSION
std::cout << "You are using Milvus CPU edition" << std::endl;
#else
#ifdef MILVUS_GPU_VERSION
std::cout << "You are using Milvus GPU edition" << std::endl;
#else
std::cout << "You are using Milvus CPU edition" << std::endl;
#endif
std::cout << std::endl;
}
......
......@@ -183,10 +183,10 @@ Server::Start() {
// print version information
SERVER_LOG_INFO << "Milvus " << BUILD_TYPE << " version: v" << MILVUS_VERSION << ", built at " << BUILD_TIME;
#ifdef MILVUS_CPU_VERSION
SERVER_LOG_INFO << "CPU edition";
#else
#ifdef MILVUS_GPU_VERSION
SERVER_LOG_INFO << "GPU edition";
#else
SERVER_LOG_INFO << "CPU edition";
#endif
server::Metrics::GetInstance().Init();
server::SystemInfo::GetInstance().Init();
......
......@@ -68,17 +68,16 @@ static const char* CONFIG_STR =
"engine_config:\n"
" use_blas_threshold: 20\n"
"\n"
"resource_config:\n"
#ifdef MILVUS_CPU_VERSION
" search_resources:\n"
" - cpu\n"
" index_build_device: cpu # CPU used for building index";
#else
" search_resources:\n"
" - cpu\n"
#ifdef MILVUS_GPU_VERSION
"gpu_resource_config:\n"
" enable: true # whether to enable GPU resources\n"
" cache_capacity: 4 # GB, size of GPU memory per card used for cache, must be a positive integer\n"
" search_resources: # define the GPU devices used for search computation, must be in format gpux\n"
" - gpu0\n"
" build_index_resources: # define the GPU devices used for index building, must be in format gpux\n"
" - gpu0\n"
" index_build_device: gpu0 # GPU used for building index";
#endif
"\n";
void
WriteToFile(const std::string& file_path, const char* content) {
......
......@@ -54,24 +54,21 @@ static const char* VALID_CONFIG_STR =
"cache_config:\n"
" cpu_cache_capacity: 16 # GB, CPU memory used for cache\n"
" cpu_cache_threshold: 0.85 \n"
" gpu_cache_capacity: 4 # GB, GPU memory used for cache\n"
" gpu_cache_threshold: 0.85 \n"
" cache_insert_data: false # whether to load inserted data into cache\n"
"\n"
"engine_config:\n"
" use_blas_threshold: 20 \n"
"\n"
"resource_config:\n"
#ifdef MILVUS_CPU_VERSION
" search_resources:\n"
" - cpu\n"
" index_build_device: cpu # CPU used for building index";
#else
" search_resources:\n"
" - cpu\n"
#ifdef MILVUS_GPU_VERSION
"gpu_resource_config:\n"
" enable: true # whether to enable GPU resources\n"
" cache_capacity: 4 # GB, size of GPU memory per card used for cache, must be a positive integer\n"
" search_resources: # define the GPU devices used for search computation, must be in format gpux\n"
" - gpu0\n"
" build_index_resources: # define the GPU devices used for index building, must be in format gpux\n"
" - gpu0\n"
" index_build_device: gpu0 # GPU used for building index";
#endif
"\n";
static const char* INVALID_CONFIG_STR = "*INVALID*";
......
......@@ -56,17 +56,16 @@ static const char* CONFIG_STR =
"engine_config:\n"
" blas_threshold: 20\n"
"\n"
"resource_config:\n"
#ifdef MILVUS_CPU_VERSION
" search_resources:\n"
" - cpu\n"
" index_build_device: cpu # CPU used for building index";
#else
" search_resources:\n"
" - cpu\n"
#ifdef MILVUS_GPU_VERSION
"gpu_resource_config:\n"
" enable: true # whether to enable GPU resources\n"
" cache_capacity: 4 # GB, size of GPU memory per card used for cache, must be a positive integer\n"
" search_resources: # define the GPU devices used for search computation, must be in format gpux\n"
" - gpu0\n"
" build_index_resources: # define the GPU devices used for index building, must be in format gpux\n"
" - gpu0\n"
" index_build_device: gpu0 # GPU used for building index";
#endif
"\n";
void
WriteToFile(const std::string& file_path, const char* content) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册