未验证 提交 0032c134 编写于 作者: C Cai Yudong 提交者: GitHub

Error out when index SQ8H run in CPU mode (#2204)

* Error out when index SQ8H run in CPU mode
Signed-off-by: Nyudong.cai <yudong.cai@zilliz.com>

* fix error
Signed-off-by: Nyudong.cai <yudong.cai@zilliz.com>

* update cmake
Signed-off-by: Nyudong.cai <yudong.cai@zilliz.com>

* code opt
Signed-off-by: Nyudong.cai <yudong.cai@zilliz.com>
上级 b458034a
......@@ -6,6 +6,7 @@ Please mark all change in change log and use the issue from GitHub
## Bug
- \#1705 Limit the insert data batch size
- \#1776 Error out when index SQ8H run in CPU mode
- \#1929 Skip MySQL meta schema field width check
- \#1946 Fix load index file CPU2GPU fail during searching
- \#1997 Index file missed after compact
......
......@@ -167,9 +167,9 @@ if (MILVUS_WITH_PROMETHEUS)
add_compile_definitions("MILVUS_WITH_PROMETHEUS")
endif ()
message("MILVUS_ENABLE_PROFILING = ${MILVUS_ENABLE_PROFILING}")
if (MILVUS_ENABLE_PROFILING STREQUAL "ON")
ADD_DEFINITIONS(-DMILVUS_ENABLE_PROFILING)
message("ENABLE_CPU_PROFILING = ${ENABLE_CPU_PROFILING}")
if (ENABLE_CPU_PROFILING STREQUAL "ON")
ADD_DEFINITIONS(-DENABLE_CPU_PROFILING)
endif()
if (MILVUS_WITH_FIU)
......
......@@ -115,7 +115,7 @@ CMAKE_CMD="cmake \
-DCMAKE_CUDA_COMPILER=${CUDA_COMPILER} \
-DBUILD_COVERAGE=${BUILD_COVERAGE} \
-DMILVUS_DB_PATH=${DB_PATH} \
-DMILVUS_ENABLE_PROFILING=${PROFILING} \
-DENABLE_CPU_PROFILING=${PROFILING} \
-DMILVUS_GPU_VERSION=${GPU_VERSION} \
-DFAISS_WITH_MKL=${WITH_MKL} \
-DMILVUS_WITH_PROMETHEUS=${WITH_PROMETHEUS} \
......
......@@ -74,7 +74,7 @@ define_option(MILVUS_WITH_MYSQLPP "Build with MySQL++" ON)
define_option(MILVUS_WITH_YAMLCPP "Build with yaml-cpp library" ON)
if (MILVUS_ENABLE_PROFILING STREQUAL "ON")
if (ENABLE_CPU_PROFILING STREQUAL "ON")
define_option(MILVUS_WITH_LIBUNWIND "Build with libunwind" ON)
define_option(MILVUS_WITH_GPERFTOOLS "Build with gperftools" ON)
endif ()
......
......@@ -212,10 +212,16 @@ if (MILVUS_GPU_VERSION)
)
endif ()
if (ENABLE_CPU_PROFILING OR ENABLE_MEM_PROFILING)
# cannot be enabled together with ENABLE_CPU_PROFILING
if (ENABLE_MEM_PROFILING)
set(third_party_libs ${third_party_libs}
gperftools
tcmalloc
)
endif ()
if (ENABLE_CPU_PROFILING)
set(third_party_libs ${third_party_libs}
gperftools
libunwind
)
endif ()
......
......@@ -451,7 +451,10 @@ DBImpl::PreloadCollection(const std::string& collection_id) {
fiu_do_on("DBImpl.PreloadCollection.engine_throw_exception", throw std::exception());
std::string msg = "Pre-loaded file: " + file.file_id_ + " size: " + std::to_string(file.file_size_);
TimeRecorderAuto rc_1(msg);
engine->Load(true);
status = engine->Load(true);
if (!status.ok()) {
return status;
}
size += engine->Size();
if (size > available_size) {
......
......@@ -458,6 +458,16 @@ ExecutionEngineImpl::Load(bool to_cache) {
LOG_ENGINE_ERROR_ << msg;
return Status(DB_ERROR, msg);
} else {
bool gpu_enable = false;
#ifdef MILVUS_GPU_VERSION
server::Config& config = server::Config::GetInstance();
CONFIG_CHECK(config.GetGpuResourceConfigEnable(gpu_enable));
#endif
if (!gpu_enable && index_->index_mode() == knowhere::IndexMode::MODE_GPU) {
std::string err_msg = "Index with type " + index_->index_type() + " must be used in GPU mode";
LOG_ENGINE_ERROR_ << err_msg;
return Status(DB_ERROR, err_msg);
}
segment::DeletedDocsPtr deleted_docs_ptr;
auto status = segment_reader_ptr->LoadDeletedDocs(deleted_docs_ptr);
if (!status.ok()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册