diff --git a/CHANGELOG.md b/CHANGELOG.md index f30f3af8e2ffac9f3a391d652330a46a745eac38..aac9a2eaf64c9f261fb99c5bec29ae993c304f0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ Please mark all change in change log and use the ticket from JIRA. - \#130 - Set task state MOVED after resource copy it completed - \#149 - Improve large query optimizer pass - \#156 - Not return error when search_resources and index_build_device set cpu +- \#159 - Change the configuration name from 'use_gpu_threshold' to 'gpu_search_threshold' ## Task diff --git a/core/conf/server_config.template b/core/conf/server_config.template index a23707be5d2245e5c9225e5ca62de2ce2d03ce43..8dfb30f53463250026eb9079be8b00dddc73f159 100644 --- a/core/conf/server_config.template +++ b/core/conf/server_config.template @@ -36,7 +36,7 @@ cache_config: engine_config: use_blas_threshold: 20 # if nq < use_blas_threshold, use SSE, faster with fluctuated response times # if nq >= use_blas_threshold, use OpenBlas, slower with stable response times - use_gpu_threshold: 1000 + gpu_search_threshold: 1000 # threshold beyond which the search computation is executed on GPUs only resource_config: search_resources: # define the GPUs used for search computation, must be in format: gpux diff --git a/core/src/scheduler/optimizer/LargeSQ8HPass.cpp b/core/src/scheduler/optimizer/LargeSQ8HPass.cpp index cacedd620888274bf4814339f05fb96b26b6b7a2..b9784e3c0a69b667d1e8d5068bb3ab6afa424a2d 100644 --- a/core/src/scheduler/optimizer/LargeSQ8HPass.cpp +++ b/core/src/scheduler/optimizer/LargeSQ8HPass.cpp @@ -29,7 +29,7 @@ namespace scheduler { LargeSQ8HPass::LargeSQ8HPass() { server::Config& config = server::Config::GetInstance(); - Status s = config.GetEngineConfigUseGpuThreshold(threshold_); + Status s = config.GetEngineConfigGpuSearchThreshold(threshold_); if (!s.ok()) { threshold_ = std::numeric_limits::max(); } diff --git a/core/src/server/Config.cpp b/core/src/server/Config.cpp index 2a041284113632fc348685f476220d0d18a516da..d651f5b3b3bce3bbffc1b7ae33bae21700525d7d 100644 --- a/core/src/server/Config.cpp +++ b/core/src/server/Config.cpp @@ -193,8 +193,8 @@ Config::ValidateConfig() { return s; } - int32_t engine_use_gpu_threshold; - s = GetEngineConfigUseGpuThreshold(engine_use_gpu_threshold); + int32_t engine_gpu_search_threshold; + s = GetEngineConfigGpuSearchThreshold(engine_gpu_search_threshold); if (!s.ok()) { return s; } @@ -330,7 +330,7 @@ Config::ResetDefaultConfig() { return s; } - s = SetEngineConfigUseGpuThreshold(CONFIG_ENGINE_USE_GPU_THRESHOLD_DEFAULT); + s = SetEngineConfigGpuSearchThreshold(CONFIG_ENGINE_GPU_SEARCH_THRESHOLD_DEFAULT); if (!s.ok()) { return s; } @@ -463,7 +463,7 @@ Status Config::CheckDBConfigArchiveDaysThreshold(const std::string& value) { if (!ValidationUtil::ValidateStringIsNumber(value).ok()) { std::string msg = "Invalid archive days threshold: " + value + - ". Possible reason: db_config.archive_disk_threshold is invalid."; + ". Possible reason: db_config.archive_days_threshold is invalid."; return Status(SERVER_INVALID_ARGUMENT, msg); } return Status::OK(); @@ -631,7 +631,7 @@ Config::CheckCacheConfigGpuCacheThreshold(const std::string& value) { Status Config::CheckCacheConfigCacheInsertData(const std::string& value) { if (!ValidationUtil::ValidateStringIsBool(value).ok()) { - std::string msg = "Invalid cache insert option: " + value + + std::string msg = "Invalid cache insert data option: " + value + ". Possible reason: cache_config.cache_insert_data is not a boolean."; return Status(SERVER_INVALID_ARGUMENT, msg); } @@ -641,7 +641,7 @@ Config::CheckCacheConfigCacheInsertData(const std::string& value) { Status Config::CheckEngineConfigUseBlasThreshold(const std::string& value) { if (!ValidationUtil::ValidateStringIsNumber(value).ok()) { - std::string msg = "Invalid blas threshold: " + value + + std::string msg = "Invalid use blas threshold: " + value + ". Possible reason: engine_config.use_blas_threshold is not a positive integer."; return Status(SERVER_INVALID_ARGUMENT, msg); } @@ -651,7 +651,7 @@ Config::CheckEngineConfigUseBlasThreshold(const std::string& value) { Status Config::CheckEngineConfigOmpThreadNum(const std::string& value) { if (!ValidationUtil::ValidateStringIsNumber(value).ok()) { - std::string msg = "Invalid omp thread number: " + value + + std::string msg = "Invalid omp thread num: " + value + ". Possible reason: engine_config.omp_thread_num is not a positive integer."; return Status(SERVER_INVALID_ARGUMENT, msg); } @@ -660,7 +660,7 @@ Config::CheckEngineConfigOmpThreadNum(const std::string& value) { uint32_t sys_thread_cnt = 8; CommonUtil::GetSystemAvailableThreads(sys_thread_cnt); if (omp_thread > static_cast(sys_thread_cnt)) { - std::string msg = "Invalid omp thread number: " + value + + std::string msg = "Invalid omp thread num: " + value + ". Possible reason: engine_config.omp_thread_num exceeds system cpu cores."; return Status(SERVER_INVALID_ARGUMENT, msg); } @@ -668,10 +668,10 @@ Config::CheckEngineConfigOmpThreadNum(const std::string& value) { } Status -Config::CheckEngineConfigUseGpuThreshold(const std::string& value) { +Config::CheckEngineConfigGpuSearchThreshold(const std::string& value) { if (!ValidationUtil::ValidateStringIsNumber(value).ok()) { - std::string msg = "Invalid gpu threshold: " + value + - ". Possible reason: engine_config.use_gpu_threshold is not a positive integer."; + std::string msg = "Invalid gpu search threshold: " + value + + ". Possible reason: engine_config.gpu_search_threshold is not a positive integer."; return Status(SERVER_INVALID_ARGUMENT, msg); } return Status::OK(); @@ -979,10 +979,10 @@ Config::GetEngineConfigOmpThreadNum(int32_t& value) { } Status -Config::GetEngineConfigUseGpuThreshold(int32_t& value) { +Config::GetEngineConfigGpuSearchThreshold(int32_t& value) { std::string str = - GetConfigStr(CONFIG_ENGINE, CONFIG_ENGINE_USE_GPU_THRESHOLD, CONFIG_ENGINE_USE_GPU_THRESHOLD_DEFAULT); - Status s = CheckEngineConfigUseGpuThreshold(str); + GetConfigStr(CONFIG_ENGINE, CONFIG_ENGINE_GPU_SEARCH_THRESHOLD, CONFIG_ENGINE_GPU_SEARCH_THRESHOLD_DEFAULT); + Status s = CheckEngineConfigGpuSearchThreshold(str); if (!s.ok()) { return s; } @@ -1244,13 +1244,13 @@ Config::SetEngineConfigOmpThreadNum(const std::string& value) { } Status -Config::SetEngineConfigUseGpuThreshold(const std::string& value) { - Status s = CheckEngineConfigUseGpuThreshold(value); +Config::SetEngineConfigGpuSearchThreshold(const std::string& value) { + Status s = CheckEngineConfigGpuSearchThreshold(value); if (!s.ok()) { return s; } - SetConfigValueInMem(CONFIG_DB, CONFIG_ENGINE_USE_GPU_THRESHOLD, value); + SetConfigValueInMem(CONFIG_DB, CONFIG_ENGINE_GPU_SEARCH_THRESHOLD, value); return Status::OK(); } diff --git a/core/src/server/Config.h b/core/src/server/Config.h index 3e7ae0c8187e1583b68116cac728b910abf93f7f..c93847b2164f3ccea3a232e09c3ce89a6f159b08 100644 --- a/core/src/server/Config.h +++ b/core/src/server/Config.h @@ -84,8 +84,8 @@ static const char* CONFIG_ENGINE_USE_BLAS_THRESHOLD = "use_blas_threshold"; static const char* CONFIG_ENGINE_USE_BLAS_THRESHOLD_DEFAULT = "20"; static const char* CONFIG_ENGINE_OMP_THREAD_NUM = "omp_thread_num"; static const char* CONFIG_ENGINE_OMP_THREAD_NUM_DEFAULT = "0"; -static const char* CONFIG_ENGINE_USE_GPU_THRESHOLD = "use_gpu_threshold"; -static const char* CONFIG_ENGINE_USE_GPU_THRESHOLD_DEFAULT = "1000"; +static const char* CONFIG_ENGINE_GPU_SEARCH_THRESHOLD = "gpu_search_threshold"; +static const char* CONFIG_ENGINE_GPU_SEARCH_THRESHOLD_DEFAULT = "1000"; /* resource config */ static const char* CONFIG_RESOURCE = "resource_config"; @@ -169,7 +169,7 @@ class Config { Status CheckEngineConfigOmpThreadNum(const std::string& value); Status - CheckEngineConfigUseGpuThreshold(const std::string& value); + CheckEngineConfigGpuSearchThreshold(const std::string& value); /* resource config */ Status @@ -235,7 +235,7 @@ class Config { Status GetEngineConfigOmpThreadNum(int32_t& value); Status - GetEngineConfigUseGpuThreshold(int32_t& value); + GetEngineConfigGpuSearchThreshold(int32_t& value); /* resource config */ Status @@ -296,7 +296,7 @@ class Config { Status SetEngineConfigOmpThreadNum(const std::string& value); Status - SetEngineConfigUseGpuThreshold(const std::string& value); + SetEngineConfigGpuSearchThreshold(const std::string& value); /* resource config */ Status