diff --git a/cpp/CHANGELOG.md b/cpp/CHANGELOG.md index 13543eccc2be5e37ff3e2bbe0ff1780db16707a0..14cdfaaf81027fde85335fd4e7ca05ad8c442a3b 100644 --- a/cpp/CHANGELOG.md +++ b/cpp/CHANGELOG.md @@ -13,6 +13,8 @@ Please mark all change in change log and use the ticket from JIRA. - MS-82 - Update server startup welcome message - MS-83 - Update vecwise to Milvus - MS-77 - Performance issue of post-search action +- MS-22 - Enhancement for MemVector size control +- MS-92 - Unify behavior of debug and release build ## New Feature diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 7973225ceec2aea6bc7daedcac8e6dea89ca1e90..ce854fe527f6c1529aeea34715b7b085cb9562bf 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -71,9 +71,7 @@ set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -O0 -g") message("CUDA_TOOLKIT_ROOT_DIR=${CUDA_TOOLKIT_ROOT_DIR}") message("CUDA_NVCC_FLAGS=${CUDA_NVCC_FLAGS}") -if (GPU_VERSION STREQUAL "ON") - add_definitions("-DGPU_VERSION") -endif () +add_definitions("-DGPU_VERSION") set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED on) @@ -92,7 +90,7 @@ endif() if(CMAKE_BUILD_TYPE STREQUAL "Release") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fPIC -DELPP_THREAD_SAFE -fopenmp") - if (GPU_VERSION STREQUAL "ON") + if (CMAKE_LICENSE_CHECK STREQUAL "ON") set(ENABLE_LICENSE "ON") add_definitions("-DENABLE_LICENSE") endif () diff --git a/cpp/README.md b/cpp/README.md index 7e739badcca2bc2d84b77108713e80aa7f68d88b..0c7706df2366fb95e751d976900e604b662eba1a 100644 --- a/cpp/README.md +++ b/cpp/README.md @@ -15,7 +15,7 @@ cmake_build/src/libmilvus_engine.a is the static library cd [sourcecode path]/cpp ./build.sh -t Debug ./build.sh -t Release - ./build.sh -g # Build GPU version + ./build.sh -l -t Release # Build license version(only available for Release) If you encounter the following error when building: `protocol https not supported or disabled in libcurl` diff --git a/cpp/build.sh b/cpp/build.sh index 79a128e45eadfab356600bf0cf1a4b30bc593067..3af7b31bfb82d8237d03ea73497069f364950b0b 100755 --- a/cpp/build.sh +++ b/cpp/build.sh @@ -2,11 +2,11 @@ BUILD_TYPE="Debug" BUILD_UNITTEST="off" -BUILD_GPU="OFF" +LICENSE_CHECK="OFF" INSTALL_PREFIX=$(pwd)/milvus MAKE_CLEAN="OFF" -while getopts "p:t:uhgr" arg +while getopts "p:t:uhlr" arg do case $arg in t) @@ -19,8 +19,8 @@ do p) INSTALL_PREFIX=$OPTARG ;; - g) - BUILD_GPU="ON" + l) + LICENSE_CHECK="ON" ;; r) if [[ -d cmake_build ]]; then @@ -35,7 +35,7 @@ parameter: -t: build type -u: building unit test options -p: install prefix --g: build GPU version +-l: build license version -r: remove previous build directory usage: @@ -64,7 +64,7 @@ if [[ ${MAKE_CLEAN} = "ON" ]]; then -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ -DCMAKE_CUDA_COMPILER=${CUDA_COMPILER} \ - -DGPU_VERSION=${BUILD_GPU} \ + -DCMAKE_LICENSE_CHECK=${LICENSE_CHECK} \ $@ ../" echo ${CMAKE_CMD} diff --git a/cpp/src/db/DBMetaImpl.cpp b/cpp/src/db/DBMetaImpl.cpp index ceaf0f8c689da544b6f482f1ad13192b799e7699..7305060c0a48a701bb2d7696158549a454f96233 100644 --- a/cpp/src/db/DBMetaImpl.cpp +++ b/cpp/src/db/DBMetaImpl.cpp @@ -318,7 +318,7 @@ Status DBMetaImpl::CreateTableFile(TableFileSchema &file_schema) { file_schema.updated_time_ = file_schema.created_on_; file_schema.engine_type_ = table_schema.engine_type_; GetTableFilePath(file_schema); - + ENGINE_LOG_DEBUG << "CreateTableFile " << file_schema.file_id_; { try { server::Metrics::GetInstance().MetaAccessTotalIncrement(); diff --git a/cpp/src/wrapper/IndexBuilder.cpp b/cpp/src/wrapper/IndexBuilder.cpp index 43cbb7323524e8cdac4d3ce8d1888402126aab5d..d4429c381aa4b9cb8d12974265f7dcf603477458 100644 --- a/cpp/src/wrapper/IndexBuilder.cpp +++ b/cpp/src/wrapper/IndexBuilder.cpp @@ -69,6 +69,7 @@ Index_ptr IndexBuilder::build_all(const long &nb, std::shared_ptr host_index = nullptr; #ifdef GPU_VERSION { + LOG(DEBUG) << "Build index by GPU"; // TODO: list support index-type. faiss::Index *ori_index = faiss::index_factory(opd_->d, opd_->get_index_type(nb).c_str()); @@ -88,6 +89,7 @@ Index_ptr IndexBuilder::build_all(const long &nb, } #else { + LOG(DEBUG) << "Build index by CPU"; faiss::Index *index = faiss::index_factory(opd_->d, opd_->get_index_type(nb).c_str()); if (!index->is_trained) { nt == 0 || xt == nullptr ? index->train(nb, xb) @@ -113,6 +115,7 @@ Index_ptr BgCpuBuilder::build_all(const long &nb, const float *xb, const long *i std::shared_ptr index = nullptr; index.reset(faiss::index_factory(opd_->d, opd_->get_index_type(nb).c_str())); + LOG(DEBUG) << "Build index by CPU"; { std::lock_guard lk(cpu_resource); if (!index->is_trained) { diff --git a/cpp/unittest/db/CMakeLists.txt b/cpp/unittest/db/CMakeLists.txt index ecfeb1e92c4da27e51b2cb49c0f216879ad4c09b..b8985067e9f23eea2848610e7f833a74ad6333fc 100644 --- a/cpp/unittest/db/CMakeLists.txt +++ b/cpp/unittest/db/CMakeLists.txt @@ -35,6 +35,7 @@ set(db_test_src cuda_add_executable(db_test ${db_test_src}) set(db_libs + gpufaiss faiss cudart cublas diff --git a/cpp/unittest/db/db_tests.cpp b/cpp/unittest/db/db_tests.cpp index 1538dd486ad83b3f63f6ef3c9c5533c00ce9d3f0..00b6c7a9c19abcc1c7b2c27929eedf10941712b6 100644 --- a/cpp/unittest/db/db_tests.cpp +++ b/cpp/unittest/db/db_tests.cpp @@ -69,6 +69,7 @@ TEST_F(DBTest2, ARHIVE_DISK_CHECK) { engine::meta::TableSchema group_info; group_info.dimension_ = group_dim; group_info.table_id_ = group_name; + group_info.engine_type_ = (int)engine::EngineType::FAISS_IVFFLAT; engine::Status stat = db_->CreateTable(group_info); engine::meta::TableSchema group_info_get; @@ -116,6 +117,7 @@ TEST_F(DBTest, DB_TEST) { engine::meta::TableSchema group_info; group_info.dimension_ = group_dim; group_info.table_id_ = group_name; + group_info.engine_type_ = (int)engine::EngineType::FAISS_IVFFLAT; engine::Status stat = db_->CreateTable(group_info); engine::meta::TableSchema group_info_get; @@ -202,6 +204,7 @@ TEST_F(DBTest, SEARCH_TEST) { engine::meta::TableSchema group_info; group_info.dimension_ = group_dim; group_info.table_id_ = group_name; + group_info.engine_type_ = (int)engine::EngineType::FAISS_IVFFLAT; engine::Status stat = db_->CreateTable(group_info); engine::meta::TableSchema group_info_get; diff --git a/cpp/unittest/faiss_wrapper/CMakeLists.txt b/cpp/unittest/faiss_wrapper/CMakeLists.txt index 49fdd7d6059266c69646f0ee9e0bb1808c3c2e95..76c8ca9777394a511b221f5c2cf11d05e3580b0c 100644 --- a/cpp/unittest/faiss_wrapper/CMakeLists.txt +++ b/cpp/unittest/faiss_wrapper/CMakeLists.txt @@ -32,6 +32,7 @@ set(wrapper_libs stdc++ boost_system boost_filesystem + gpufaiss faiss cudart cublas diff --git a/cpp/unittest/metrics/CMakeLists.txt b/cpp/unittest/metrics/CMakeLists.txt index f24538fad446685861d85bb22b62aff15cf9b0b2..8a34d9c4d70762ddd0690cbe1f680a974d38e5cb 100644 --- a/cpp/unittest/metrics/CMakeLists.txt +++ b/cpp/unittest/metrics/CMakeLists.txt @@ -60,7 +60,7 @@ set(count_test_src add_executable(metrics_test ${count_test_src} ${require_files} ) target_link_libraries(metrics_test - + gpufaiss faiss cudart cublas diff --git a/cpp/unittest/server/CMakeLists.txt b/cpp/unittest/server/CMakeLists.txt index 8bc2e41bee55d84b1d35e3f47f151922916cd56e..3257804abf5e46d727a82182e29dca06d6cf8fea 100644 --- a/cpp/unittest/server/CMakeLists.txt +++ b/cpp/unittest/server/CMakeLists.txt @@ -33,6 +33,7 @@ cuda_add_executable(server_test set(require_libs stdc++ + gpufaiss faiss cudart cublas