Loading CHANGELOG.md +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,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 Loading core/conf/server_config.template +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading core/src/scheduler/optimizer/LargeSQ8HPass.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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<int32_t>::max(); } Loading core/src/server/Config.cpp +17 −17 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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; } Loading Loading @@ -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(); Loading Loading @@ -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); } Loading @@ -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); } Loading @@ -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); } Loading @@ -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<int32_t>(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); } Loading @@ -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(); Loading Loading @@ -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; } Loading Loading @@ -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(); } Loading core/src/server/Config.h +5 −5 Original line number Diff line number Diff line Loading @@ -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"; Loading Loading @@ -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 Loading Loading @@ -235,7 +235,7 @@ class Config { Status GetEngineConfigOmpThreadNum(int32_t& value); Status GetEngineConfigUseGpuThreshold(int32_t& value); GetEngineConfigGpuSearchThreshold(int32_t& value); /* resource config */ Status Loading Loading @@ -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 Loading Loading
CHANGELOG.md +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,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 Loading
core/conf/server_config.template +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
core/src/scheduler/optimizer/LargeSQ8HPass.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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<int32_t>::max(); } Loading
core/src/server/Config.cpp +17 −17 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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; } Loading Loading @@ -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(); Loading Loading @@ -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); } Loading @@ -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); } Loading @@ -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); } Loading @@ -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<int32_t>(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); } Loading @@ -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(); Loading Loading @@ -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; } Loading Loading @@ -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(); } Loading
core/src/server/Config.h +5 −5 Original line number Diff line number Diff line Loading @@ -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"; Loading Loading @@ -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 Loading Loading @@ -235,7 +235,7 @@ class Config { Status GetEngineConfigOmpThreadNum(int32_t& value); Status GetEngineConfigUseGpuThreshold(int32_t& value); GetEngineConfigGpuSearchThreshold(int32_t& value); /* resource config */ Status Loading Loading @@ -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 Loading