Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
ee273d98
milvus
项目概览
BaiXuePrincess
/
milvus
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ee273d98
编写于
10月 30, 2019
作者:
J
jinhai
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'main/0.5.1' into 0.5.1
Former-commit-id: b827d5677dbd25441fb02cb28a08b46cdaa1ebe2
上级
bf3980e7
a008e336
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
70 addition
and
2 deletion
+70
-2
CHANGELOG.md
CHANGELOG.md
+1
-0
core/conf/server_config.template
core/conf/server_config.template
+1
-0
core/src/scheduler/optimizer/LargeSQ8HPass.cpp
core/src/scheduler/optimizer/LargeSQ8HPass.cpp
+11
-1
core/src/scheduler/optimizer/LargeSQ8HPass.h
core/src/scheduler/optimizer/LargeSQ8HPass.h
+4
-1
core/src/server/Config.cpp
core/src/server/Config.cpp
+45
-0
core/src/server/Config.h
core/src/server/Config.h
+8
-0
未找到文件。
CHANGELOG.md
浏览文件 @
ee273d98
...
@@ -10,6 +10,7 @@ Please mark all change in change log and use the ticket from JIRA.
...
@@ -10,6 +10,7 @@ Please mark all change in change log and use the ticket from JIRA.
-
\#
90 - The server start error messages could be improved to enhance user experience
-
\#
90 - The server start error messages could be improved to enhance user experience
-
\#
104 - test_scheduler core dump
-
\#
104 - test_scheduler core dump
-
\#
115 - Using new structure for tasktable
-
\#
115 - Using new structure for tasktable
-
\#
139 - New config opion use_gpu_threshold
## Improvement
## Improvement
-
\#
64 - Improvement dump function in scheduler
-
\#
64 - Improvement dump function in scheduler
...
...
core/conf/server_config.template
浏览文件 @
ee273d98
...
@@ -36,6 +36,7 @@ cache_config:
...
@@ -36,6 +36,7 @@ cache_config:
engine_config:
engine_config:
use_blas_threshold: 20 # if nq < use_blas_threshold, use SSE, faster with fluctuated response times
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
# if nq >= use_blas_threshold, use OpenBlas, slower with stable response times
use_gpu_threshold: 1000
resource_config:
resource_config:
search_resources: # define the GPUs used for search computation, must be in format: gpux
search_resources: # define the GPUs used for search computation, must be in format: gpux
...
...
core/src/scheduler/optimizer/LargeSQ8HPass.cpp
浏览文件 @
ee273d98
...
@@ -21,11 +21,20 @@
...
@@ -21,11 +21,20 @@
#include "scheduler/Utils.h"
#include "scheduler/Utils.h"
#include "scheduler/task/SearchTask.h"
#include "scheduler/task/SearchTask.h"
#include "scheduler/tasklabel/SpecResLabel.h"
#include "scheduler/tasklabel/SpecResLabel.h"
#include "server/Config.h"
#include "utils/Log.h"
#include "utils/Log.h"
namespace
milvus
{
namespace
milvus
{
namespace
scheduler
{
namespace
scheduler
{
LargeSQ8HPass
::
LargeSQ8HPass
()
{
server
::
Config
&
config
=
server
::
Config
::
GetInstance
();
Status
s
=
config
.
GetEngineConfigUseGpuThreshold
(
threshold_
);
if
(
!
s
.
ok
())
{
threshold_
=
std
::
numeric_limits
<
int32_t
>::
max
();
}
}
bool
bool
LargeSQ8HPass
::
Run
(
const
TaskPtr
&
task
)
{
LargeSQ8HPass
::
Run
(
const
TaskPtr
&
task
)
{
if
(
task
->
Type
()
!=
TaskType
::
SearchTask
)
{
if
(
task
->
Type
()
!=
TaskType
::
SearchTask
)
{
...
@@ -40,7 +49,8 @@ LargeSQ8HPass::Run(const TaskPtr& task) {
...
@@ -40,7 +49,8 @@ LargeSQ8HPass::Run(const TaskPtr& task) {
auto
search_job
=
std
::
static_pointer_cast
<
SearchJob
>
(
search_task
->
job_
.
lock
());
auto
search_job
=
std
::
static_pointer_cast
<
SearchJob
>
(
search_task
->
job_
.
lock
());
// TODO: future, Index::IVFSQ8H, if nq < threshold set cpu, else set gpu
// TODO: future, Index::IVFSQ8H, if nq < threshold set cpu, else set gpu
if
(
search_job
->
nq
()
<
100
)
{
if
(
search_job
->
nq
()
<
threshold_
)
{
return
false
;
return
false
;
}
}
...
...
core/src/scheduler/optimizer/LargeSQ8HPass.h
浏览文件 @
ee273d98
...
@@ -34,11 +34,14 @@ namespace scheduler {
...
@@ -34,11 +34,14 @@ namespace scheduler {
class
LargeSQ8HPass
:
public
Pass
{
class
LargeSQ8HPass
:
public
Pass
{
public:
public:
LargeSQ8HPass
()
=
default
;
LargeSQ8HPass
();
public:
public:
bool
bool
Run
(
const
TaskPtr
&
task
)
override
;
Run
(
const
TaskPtr
&
task
)
override
;
private:
int32_t
threshold_
=
std
::
numeric_limits
<
int32_t
>::
max
();
};
};
using
LargeSQ8HPassPtr
=
std
::
shared_ptr
<
LargeSQ8HPass
>
;
using
LargeSQ8HPassPtr
=
std
::
shared_ptr
<
LargeSQ8HPass
>
;
...
...
core/src/server/Config.cpp
浏览文件 @
ee273d98
...
@@ -193,6 +193,12 @@ Config::ValidateConfig() {
...
@@ -193,6 +193,12 @@ Config::ValidateConfig() {
return
s
;
return
s
;
}
}
int32_t
engine_use_gpu_threshold
;
s
=
GetEngineConfigUseGpuThreshold
(
engine_use_gpu_threshold
);
if
(
!
s
.
ok
())
{
return
s
;
}
/* resource config */
/* resource config */
std
::
string
resource_mode
;
std
::
string
resource_mode
;
s
=
GetResourceConfigMode
(
resource_mode
);
s
=
GetResourceConfigMode
(
resource_mode
);
...
@@ -324,6 +330,11 @@ Config::ResetDefaultConfig() {
...
@@ -324,6 +330,11 @@ Config::ResetDefaultConfig() {
return
s
;
return
s
;
}
}
s
=
SetEngineConfigUseGpuThreshold
(
CONFIG_ENGINE_USE_GPU_THRESHOLD_DEFAULT
);
if
(
!
s
.
ok
())
{
return
s
;
}
/* resource config */
/* resource config */
s
=
SetResourceConfigMode
(
CONFIG_RESOURCE_MODE_DEFAULT
);
s
=
SetResourceConfigMode
(
CONFIG_RESOURCE_MODE_DEFAULT
);
if
(
!
s
.
ok
())
{
if
(
!
s
.
ok
())
{
...
@@ -656,6 +667,16 @@ Config::CheckEngineConfigOmpThreadNum(const std::string& value) {
...
@@ -656,6 +667,16 @@ Config::CheckEngineConfigOmpThreadNum(const std::string& value) {
return
Status
::
OK
();
return
Status
::
OK
();
}
}
Status
Config
::
CheckEngineConfigUseGpuThreshold
(
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."
;
return
Status
(
SERVER_INVALID_ARGUMENT
,
msg
);
}
return
Status
::
OK
();
}
Status
Status
Config
::
CheckResourceConfigMode
(
const
std
::
string
&
value
)
{
Config
::
CheckResourceConfigMode
(
const
std
::
string
&
value
)
{
if
(
value
!=
"simple"
)
{
if
(
value
!=
"simple"
)
{
...
@@ -951,6 +972,19 @@ Config::GetEngineConfigOmpThreadNum(int32_t& value) {
...
@@ -951,6 +972,19 @@ Config::GetEngineConfigOmpThreadNum(int32_t& value) {
return
Status
::
OK
();
return
Status
::
OK
();
}
}
Status
Config
::
GetEngineConfigUseGpuThreshold
(
int32_t
&
value
)
{
std
::
string
str
=
GetConfigStr
(
CONFIG_ENGINE
,
CONFIG_ENGINE_USE_GPU_THRESHOLD
,
CONFIG_ENGINE_USE_GPU_THRESHOLD_DEFAULT
);
Status
s
=
CheckEngineConfigUseGpuThreshold
(
str
);
if
(
!
s
.
ok
())
{
return
s
;
}
value
=
std
::
stoi
(
str
);
return
Status
::
OK
();
}
Status
Status
Config
::
GetResourceConfigMode
(
std
::
string
&
value
)
{
Config
::
GetResourceConfigMode
(
std
::
string
&
value
)
{
value
=
GetConfigStr
(
CONFIG_RESOURCE
,
CONFIG_RESOURCE_MODE
,
CONFIG_RESOURCE_MODE_DEFAULT
);
value
=
GetConfigStr
(
CONFIG_RESOURCE
,
CONFIG_RESOURCE_MODE
,
CONFIG_RESOURCE_MODE_DEFAULT
);
...
@@ -1203,6 +1237,17 @@ Config::SetEngineConfigOmpThreadNum(const std::string& value) {
...
@@ -1203,6 +1237,17 @@ Config::SetEngineConfigOmpThreadNum(const std::string& value) {
return
Status
::
OK
();
return
Status
::
OK
();
}
}
Status
Config
::
SetEngineConfigUseGpuThreshold
(
const
std
::
string
&
value
)
{
Status
s
=
CheckEngineConfigUseGpuThreshold
(
value
);
if
(
!
s
.
ok
())
{
return
s
;
}
SetConfigValueInMem
(
CONFIG_DB
,
CONFIG_ENGINE_USE_GPU_THRESHOLD
,
value
);
return
Status
::
OK
();
}
/* resource config */
/* resource config */
Status
Status
Config
::
SetResourceConfigMode
(
const
std
::
string
&
value
)
{
Config
::
SetResourceConfigMode
(
const
std
::
string
&
value
)
{
...
...
core/src/server/Config.h
浏览文件 @
ee273d98
...
@@ -84,6 +84,8 @@ static const char* CONFIG_ENGINE_USE_BLAS_THRESHOLD = "use_blas_threshold";
...
@@ -84,6 +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_USE_BLAS_THRESHOLD_DEFAULT
=
"20"
;
static
const
char
*
CONFIG_ENGINE_OMP_THREAD_NUM
=
"omp_thread_num"
;
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_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"
;
/* resource config */
/* resource config */
static
const
char
*
CONFIG_RESOURCE
=
"resource_config"
;
static
const
char
*
CONFIG_RESOURCE
=
"resource_config"
;
...
@@ -166,6 +168,8 @@ class Config {
...
@@ -166,6 +168,8 @@ class Config {
CheckEngineConfigUseBlasThreshold
(
const
std
::
string
&
value
);
CheckEngineConfigUseBlasThreshold
(
const
std
::
string
&
value
);
Status
Status
CheckEngineConfigOmpThreadNum
(
const
std
::
string
&
value
);
CheckEngineConfigOmpThreadNum
(
const
std
::
string
&
value
);
Status
CheckEngineConfigUseGpuThreshold
(
const
std
::
string
&
value
);
/* resource config */
/* resource config */
Status
Status
...
@@ -230,6 +234,8 @@ class Config {
...
@@ -230,6 +234,8 @@ class Config {
GetEngineConfigUseBlasThreshold
(
int32_t
&
value
);
GetEngineConfigUseBlasThreshold
(
int32_t
&
value
);
Status
Status
GetEngineConfigOmpThreadNum
(
int32_t
&
value
);
GetEngineConfigOmpThreadNum
(
int32_t
&
value
);
Status
GetEngineConfigUseGpuThreshold
(
int32_t
&
value
);
/* resource config */
/* resource config */
Status
Status
...
@@ -289,6 +295,8 @@ class Config {
...
@@ -289,6 +295,8 @@ class Config {
SetEngineConfigUseBlasThreshold
(
const
std
::
string
&
value
);
SetEngineConfigUseBlasThreshold
(
const
std
::
string
&
value
);
Status
Status
SetEngineConfigOmpThreadNum
(
const
std
::
string
&
value
);
SetEngineConfigOmpThreadNum
(
const
std
::
string
&
value
);
Status
SetEngineConfigUseGpuThreshold
(
const
std
::
string
&
value
);
/* resource config */
/* resource config */
Status
Status
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录