Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_35024513
milvus
提交
0d1923c6
milvus
项目概览
qq_35024513
/
milvus
与 Fork 源项目一致
Fork自
milvus / milvus
通知
14
Star
0
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,发现更多精彩内容 >>
提交
0d1923c6
编写于
11月 19, 2019
作者:
Y
yudong.cai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#346 update gpu resource config APIs
上级
00a21da4
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
346 addition
and
339 deletion
+346
-339
core/conf/server_cpu_config.template
core/conf/server_cpu_config.template
+8
-7
core/conf/server_gpu_config.template
core/conf/server_gpu_config.template
+7
-8
core/src/cache/GpuCacheMgr.cpp
core/src/cache/GpuCacheMgr.cpp
+2
-2
core/src/server/Config.cpp
core/src/server/Config.cpp
+232
-212
core/src/server/Config.h
core/src/server/Config.h
+40
-47
core/src/utils/ValidationUtil.cpp
core/src/utils/ValidationUtil.cpp
+2
-2
core/src/utils/ValidationUtil.h
core/src/utils/ValidationUtil.h
+2
-2
core/unittest/server/test_config.cpp
core/unittest/server/test_config.cpp
+53
-59
未找到文件。
core/conf/server_cpu_config.template
浏览文件 @
0d1923c6
...
...
@@ -27,9 +27,7 @@ metric_config:
port: 8080 # port prometheus uses to fetch metrics, must in range [1025, 65534]
cache_config:
cpu_cache_capacity: 16 # GB, CPU memory used for cache, must be a positive integer
cpu_cache_threshold: 0.85 # percentage of data that will be kept when cache cleanup is triggered, must be in range (0.0, 1.0]
cpu_cache_capacity: 16 # GB, size of CPU memory used for cache, must be a positive integer
cache_insert_data: false # whether to load inserted data into cache, must be a boolean
engine_config:
...
...
@@ -37,7 +35,10 @@ engine_config:
# if nq >= use_blas_threshold, use OpenBlas, slower with stable response times
gpu_search_threshold: 1000 # threshold beyond which the search computation is executed on GPUs only
resource_config:
search_resources: # define the device used for search computation
- cpu
index_build_device: cpu # CPU used for building index
gpu_resource_config:
enable_gpu: true # whether to enable GPU resources
cache_capacity: 4 # GB, size of GPU memory per card used for cache, must be a positive integer
search_resources: # define the GPU devices used for search computation, must be in format gpux
- gpu0
build_index_resources: # define the GPU devices used for index building, must be in format gpux
- gpu0
\ No newline at end of file
core/conf/server_gpu_config.template
浏览文件 @
0d1923c6
...
...
@@ -27,10 +27,7 @@ metric_config:
port: 8080 # port prometheus uses to fetch metrics, must in range [1025, 65534]
cache_config:
cpu_cache_capacity: 16 # GB, CPU memory used for cache, must be a positive integer
cpu_cache_threshold: 0.85 # percentage of data that will be kept when cache cleanup is triggered, must be in range (0.0, 1.0]
gpu_cache_capacity: 4 # GB, GPU memory used for cache, must be a positive integer
gpu_cache_threshold: 0.85 # percentage of data that will be kept when cache cleanup is triggered, must be in range (0.0, 1.0]
cpu_cache_capacity: 16 # GB, size of CPU memory used for cache, must be a positive integer
cache_insert_data: false # whether to load inserted data into cache, must be a boolean
engine_config:
...
...
@@ -38,8 +35,10 @@ engine_config:
# if nq >= use_blas_threshold, use OpenBlas, slower with stable response times
gpu_search_threshold: 1000 # threshold beyond which the search computation is executed on GPUs only
resource_config:
search_resources: # define the devices used for search computation, must be in format: cpu or gpux
- cpu
gpu_resource_config:
enable_gpu: false # whether to enable GPU resources
cache_capacity: 4 # GB, size of GPU memory per card used for cache, must be a positive integer
search_resources: # define the GPU devices used for search computation, must be in format gpux
- gpu0
index_build_device: gpu0 # CPU / GPU used for building index, must be in format: cpu or gpux
build_index_resources: # define the GPU devices used for index building, must be in format gpux
- gpu0
\ No newline at end of file
core/src/cache/GpuCacheMgr.cpp
浏览文件 @
0d1923c6
...
...
@@ -37,7 +37,7 @@ GpuCacheMgr::GpuCacheMgr() {
Status
s
;
int64_t
gpu_cache_cap
;
s
=
config
.
Get
CacheConfigGpu
CacheCapacity
(
gpu_cache_cap
);
s
=
config
.
Get
GpuResourceConfig
CacheCapacity
(
gpu_cache_cap
);
if
(
!
s
.
ok
())
{
SERVER_LOG_ERROR
<<
s
.
message
();
}
...
...
@@ -45,7 +45,7 @@ GpuCacheMgr::GpuCacheMgr() {
cache_
=
std
::
make_shared
<
Cache
<
DataObjPtr
>>
(
cap
,
1UL
<<
32
);
float
gpu_mem_threshold
;
s
=
config
.
Get
CacheConfigGpu
CacheThreshold
(
gpu_mem_threshold
);
s
=
config
.
Get
GpuResourceConfig
CacheThreshold
(
gpu_mem_threshold
);
if
(
!
s
.
ok
())
{
SERVER_LOG_ERROR
<<
s
.
message
();
}
...
...
core/src/server/Config.cpp
浏览文件 @
0d1923c6
此差异已折叠。
点击以展开。
core/src/server/Config.h
浏览文件 @
0d1923c6
...
...
@@ -59,12 +59,8 @@ static const char* CONFIG_DB_PRELOAD_TABLE = "preload_table";
static
const
char
*
CONFIG_CACHE
=
"cache_config"
;
static
const
char
*
CONFIG_CACHE_CPU_CACHE_CAPACITY
=
"cpu_cache_capacity"
;
static
const
char
*
CONFIG_CACHE_CPU_CACHE_CAPACITY_DEFAULT
=
"16"
;
static
const
char
*
CONFIG_CACHE_GPU_CACHE_CAPACITY
=
"gpu_cache_capacity"
;
static
const
char
*
CONFIG_CACHE_GPU_CACHE_CAPACITY_DEFAULT
=
"4"
;
static
const
char
*
CONFIG_CACHE_CPU_CACHE_THRESHOLD
=
"cpu_mem_threshold"
;
static
const
char
*
CONFIG_CACHE_CPU_CACHE_THRESHOLD
=
"cpu_cache_threshold"
;
static
const
char
*
CONFIG_CACHE_CPU_CACHE_THRESHOLD_DEFAULT
=
"0.85"
;
static
const
char
*
CONFIG_CACHE_GPU_CACHE_THRESHOLD
=
"gpu_mem_threshold"
;
static
const
char
*
CONFIG_CACHE_GPU_CACHE_THRESHOLD_DEFAULT
=
"0.85"
;
static
const
char
*
CONFIG_CACHE_CACHE_INSERT_DATA
=
"cache_insert_data"
;
static
const
char
*
CONFIG_CACHE_CACHE_INSERT_DATA_DEFAULT
=
"false"
;
...
...
@@ -87,26 +83,23 @@ static const char* CONFIG_ENGINE_OMP_THREAD_NUM_DEFAULT = "0";
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"
;
static
const
char
*
CONFIG_RESOURCE_MODE
=
"mode"
;
static
const
char
*
CONFIG_RESOURCE_MODE_DEFAULT
=
"simple"
;
static
const
char
*
CONFIG_RESOURCE_SEARCH_RESOURCES
=
"search_resources"
;
static
const
char
*
CONFIG_RESOURCE_SEARCH_RESOURCES_DELIMITER
=
","
;
#ifdef MILVUS_CPU_VERSION
static
const
char
*
CONFIG_RESOURCE_SEARCH_RESOURCES_DEFAULT
=
"cpu"
;
#else
static
const
char
*
CONFIG_RESOURCE_SEARCH_RESOURCES_DEFAULT
=
"cpu,gpu0"
;
#endif
static
const
char
*
CONFIG_RESOURCE_INDEX_BUILD_DEVICE
=
"index_build_device"
;
#ifdef MILVUS_CPU_VERSION
static
const
char
*
CONFIG_RESOURCE_INDEX_BUILD_DEVICE_DEFAULT
=
"cpu"
;
/* gpu resource config */
static
const
char
*
CONFIG_GPU_RESOURCE
=
"gpu_resource_config"
;
static
const
char
*
CONFIG_GPU_RESOURCE_ENABLE_GPU
=
"enable_gpu"
;
#ifdef MILVUS_GPU_VERSION
static
const
char
*
CONFIG_GPU_RESOURCE_ENABLE_GPU_DEFAULT
=
"true"
;
#else
static
const
char
*
CONFIG_
RESOURCE_INDEX_BUILD_DEVICE_DEFAULT
=
"gpu0
"
;
static
const
char
*
CONFIG_
GPU_RESOURCE_ENABLE_GPU_DEFAULT
=
"false
"
;
#endif
const
int32_t
CPU_DEVICE_ID
=
-
1
;
static
const
char
*
CONFIG_GPU_RESOURCE_CACHE_CAPACITY
=
"cache_capacity"
;
static
const
char
*
CONFIG_GPU_RESOURCE_CACHE_CAPACITY_DEFAULT
=
"4"
;
static
const
char
*
CONFIG_GPU_RESOURCE_CACHE_THRESHOLD
=
"cache_threshold"
;
static
const
char
*
CONFIG_GPU_RESOURCE_CACHE_THRESHOLD_DEFAULT
=
"0.85"
;
static
const
char
*
CONFIG_GPU_RESOURCE_DELIMITER
=
","
;
static
const
char
*
CONFIG_GPU_RESOURCE_SEARCH_RESOURCES
=
"search_resources"
;
static
const
char
*
CONFIG_GPU_RESOURCE_SEARCH_RESOURCES_DEFAULT
=
"gpu0"
;
static
const
char
*
CONFIG_GPU_RESOURCE_BUILD_INDEX_RESOURCES
=
"build_index_resources"
;
static
const
char
*
CONFIG_GPU_RESOURCE_BUILD_INDEX_RESOURCES_DEFAULT
=
"gpu0"
;
class
Config
{
public:
...
...
@@ -170,10 +163,6 @@ class Config {
Status
CheckCacheConfigCpuCacheThreshold
(
const
std
::
string
&
value
);
Status
CheckCacheConfigGpuCacheCapacity
(
const
std
::
string
&
value
);
Status
CheckCacheConfigGpuCacheThreshold
(
const
std
::
string
&
value
);
Status
CheckCacheConfigCacheInsertData
(
const
std
::
string
&
value
);
/* engine config */
...
...
@@ -184,13 +173,17 @@ class Config {
Status
CheckEngineConfigGpuSearchThreshold
(
const
std
::
string
&
value
);
/* resource config */
/* gpu resource config */
Status
CheckGpuResourceConfigEnableGpu
(
const
std
::
string
&
value
);
Status
CheckGpuResourceConfigCacheCapacity
(
const
std
::
string
&
value
);
Status
Check
ResourceConfigMode
(
const
std
::
string
&
value
);
Check
GpuResourceConfigCacheThreshold
(
const
std
::
string
&
value
);
Status
CheckResourceConfigSearchResources
(
const
std
::
vector
<
std
::
string
>&
value
);
Check
Gpu
ResourceConfigSearchResources
(
const
std
::
vector
<
std
::
string
>&
value
);
Status
Check
ResourceConfigIndexBuildDevice
(
const
std
::
string
&
value
);
Check
GpuResourceConfigBuildIndexResources
(
const
std
::
vector
<
std
::
string
>
&
value
);
std
::
string
GetConfigStr
(
const
std
::
string
&
parent_key
,
const
std
::
string
&
child_key
,
const
std
::
string
&
default_value
=
""
);
...
...
@@ -239,10 +232,6 @@ class Config {
Status
GetCacheConfigCpuCacheThreshold
(
float
&
value
);
Status
GetCacheConfigGpuCacheCapacity
(
int64_t
&
value
);
Status
GetCacheConfigGpuCacheThreshold
(
float
&
value
);
Status
GetCacheConfigCacheInsertData
(
bool
&
value
);
/* engine config */
...
...
@@ -253,13 +242,17 @@ class Config {
Status
GetEngineConfigGpuSearchThreshold
(
int32_t
&
value
);
/* resource config */
/* gpu resource config */
Status
GetGpuResourceConfigEnableGpu
(
bool
&
value
);
Status
GetGpuResourceConfigCacheCapacity
(
int64_t
&
value
);
Status
Get
ResourceConfigMode
(
std
::
string
&
value
);
Get
GpuResourceConfigCacheThreshold
(
float
&
value
);
Status
Get
ResourceConfigSearchResources
(
std
::
vector
<
std
::
string
>&
value
);
Get
GpuResourceConfigSearchResources
(
std
::
vector
<
int32_t
>&
value
);
Status
Get
ResourceConfigIndexBuildDevice
(
int32_t
&
value
);
Get
GpuResourceConfigBuildIndexResources
(
std
::
vector
<
int32_t
>
&
value
);
public:
/* server config */
...
...
@@ -300,10 +293,6 @@ class Config {
Status
SetCacheConfigCpuCacheThreshold
(
const
std
::
string
&
value
);
Status
SetCacheConfigGpuCacheCapacity
(
const
std
::
string
&
value
);
Status
SetCacheConfigGpuCacheThreshold
(
const
std
::
string
&
value
);
Status
SetCacheConfigCacheInsertData
(
const
std
::
string
&
value
);
/* engine config */
...
...
@@ -314,13 +303,17 @@ class Config {
Status
SetEngineConfigGpuSearchThreshold
(
const
std
::
string
&
value
);
/* resource config */
/* gpu resource config */
Status
SetGpuResourceConfigEnableGpu
(
const
std
::
string
&
value
);
Status
SetGpuResourceConfigCacheCapacity
(
const
std
::
string
&
value
);
Status
Set
ResourceConfigMode
(
const
std
::
string
&
value
);
Set
GpuResourceConfigCacheThreshold
(
const
std
::
string
&
value
);
Status
SetResourceConfigSearchResources
(
const
std
::
string
&
value
);
Set
Gpu
ResourceConfigSearchResources
(
const
std
::
string
&
value
);
Status
Set
ResourceConfigIndexBuildDevice
(
const
std
::
string
&
value
);
Set
GpuResourceConfigBuildIndexResources
(
const
std
::
string
&
value
);
private:
std
::
unordered_map
<
std
::
string
,
std
::
unordered_map
<
std
::
string
,
std
::
string
>>
config_map_
;
...
...
core/src/utils/ValidationUtil.cpp
浏览文件 @
0d1923c6
...
...
@@ -182,7 +182,7 @@ ValidationUtil::ValidatePartitionTags(const std::vector<std::string>& partition_
}
Status
ValidationUtil
::
ValidateGpuIndex
(
u
int32_t
gpu_index
)
{
ValidationUtil
::
ValidateGpuIndex
(
int32_t
gpu_index
)
{
#ifdef MILVUS_GPU_VERSION
int
num_devices
=
0
;
auto
cuda_err
=
cudaGetDeviceCount
(
&
num_devices
);
...
...
@@ -203,7 +203,7 @@ ValidationUtil::ValidateGpuIndex(uint32_t gpu_index) {
}
Status
ValidationUtil
::
GetGpuMemory
(
u
int32_t
gpu_index
,
size_t
&
memory
)
{
ValidationUtil
::
GetGpuMemory
(
int32_t
gpu_index
,
size_t
&
memory
)
{
#ifdef MILVUS_GPU_VERSION
cudaDeviceProp
deviceProp
;
...
...
core/src/utils/ValidationUtil.h
浏览文件 @
0d1923c6
...
...
@@ -59,10 +59,10 @@ class ValidationUtil {
ValidatePartitionTags
(
const
std
::
vector
<
std
::
string
>&
partition_tags
);
static
Status
ValidateGpuIndex
(
u
int32_t
gpu_index
);
ValidateGpuIndex
(
int32_t
gpu_index
);
static
Status
GetGpuMemory
(
u
int32_t
gpu_index
,
size_t
&
memory
);
GetGpuMemory
(
int32_t
gpu_index
,
size_t
&
memory
);
static
Status
ValidateIpAddress
(
const
std
::
string
&
ip_address
);
...
...
core/unittest/server/test_config.cpp
浏览文件 @
0d1923c6
...
...
@@ -216,21 +216,6 @@ TEST_F(ConfigTest, SERVER_CONFIG_VALID_TEST) {
s
=
config
.
GetCacheConfigCpuCacheThreshold
(
float_val
);
ASSERT_TRUE
(
float_val
==
cache_cpu_cache_threshold
);
#ifdef MILVUS_GPU_VERSION
int64_t
cache_gpu_cache_capacity
=
1
;
s
=
config
.
SetCacheConfigGpuCacheCapacity
(
std
::
to_string
(
cache_gpu_cache_capacity
));
ASSERT_TRUE
(
s
.
ok
());
s
=
config
.
GetCacheConfigGpuCacheCapacity
(
int64_val
);
ASSERT_TRUE
(
s
.
ok
());
ASSERT_TRUE
(
int64_val
==
cache_gpu_cache_capacity
);
float
cache_gpu_cache_threshold
=
0.2
;
s
=
config
.
SetCacheConfigGpuCacheThreshold
(
std
::
to_string
(
cache_gpu_cache_threshold
));
ASSERT_TRUE
(
s
.
ok
());
s
=
config
.
GetCacheConfigGpuCacheThreshold
(
float_val
);
ASSERT_TRUE
(
float_val
==
cache_gpu_cache_threshold
);
#endif
bool
cache_insert_data
=
true
;
s
=
config
.
SetCacheConfigCacheInsertData
(
std
::
to_string
(
cache_insert_data
));
ASSERT_TRUE
(
s
.
ok
());
...
...
@@ -259,42 +244,54 @@ TEST_F(ConfigTest, SERVER_CONFIG_VALID_TEST) {
ASSERT_TRUE
(
s
.
ok
());
ASSERT_TRUE
(
int32_val
==
engine_gpu_search_threshold
);
/* resource config */
std
::
string
resource_mode
=
"simple"
;
s
=
config
.
Set
ResourceConfigMode
(
resource_mode
);
/*
gpu
resource config */
bool
resource_enable_gpu
=
true
;
s
=
config
.
Set
GpuResourceConfigEnableGpu
(
std
::
to_string
(
resource_enable_gpu
)
);
ASSERT_TRUE
(
s
.
ok
());
s
=
config
.
Get
ResourceConfigMode
(
str
_val
);
s
=
config
.
Get
GpuResourceConfigEnableGpu
(
bool
_val
);
ASSERT_TRUE
(
s
.
ok
());
ASSERT_TRUE
(
str_val
==
resource_mode
);
ASSERT_TRUE
(
bool_val
==
resource_enable_gpu
);
#ifdef MILVUS_CPU_VERSION
std
::
vector
<
std
::
string
>
search_resources
=
{
"cpu"
};
#else
std
::
vector
<
std
::
string
>
search_resources
=
{
"cpu"
,
"gpu0"
};
#endif
std
::
vector
<
std
::
string
>
res_vec
;
std
::
string
res_str
;
#ifdef MILVUS_GPU_VERSION
int64_t
gpu_cache_capacity
=
1
;
s
=
config
.
SetGpuResourceConfigCacheCapacity
(
std
::
to_string
(
gpu_cache_capacity
));
ASSERT_TRUE
(
s
.
ok
());
s
=
config
.
GetGpuResourceConfigCacheCapacity
(
int64_val
);
ASSERT_TRUE
(
s
.
ok
());
ASSERT_TRUE
(
int64_val
==
gpu_cache_capacity
);
float
gpu_cache_threshold
=
0.2
;
s
=
config
.
SetGpuResourceConfigCacheThreshold
(
std
::
to_string
(
gpu_cache_threshold
));
ASSERT_TRUE
(
s
.
ok
());
s
=
config
.
GetGpuResourceConfigCacheThreshold
(
float_val
);
ASSERT_TRUE
(
float_val
==
gpu_cache_threshold
);
std
::
vector
<
std
::
string
>
search_resources
=
{
"gpu0"
};
std
::
vector
<
int32_t
>
search_res_vec
;
std
::
string
search_res_str
;
milvus
::
server
::
StringHelpFunctions
::
MergeStringWithDelimeter
(
search_resources
,
milvus
::
server
::
CONFIG_
RESOURCE_SEARCH_RESOURCES_DELIMITER
,
res_str
);
s
=
config
.
Set
ResourceConfigSearchResources
(
res_str
);
search_resources
,
milvus
::
server
::
CONFIG_
GPU_RESOURCE_DELIMITER
,
search_
res_str
);
s
=
config
.
Set
GpuResourceConfigSearchResources
(
search_
res_str
);
ASSERT_TRUE
(
s
.
ok
());
s
=
config
.
Get
ResourceConfigSearchResources
(
res_vec
);
s
=
config
.
Get
GpuResourceConfigSearchResources
(
search_
res_vec
);
ASSERT_TRUE
(
s
.
ok
());
for
(
size_t
i
=
0
;
i
<
search_resources
.
size
();
i
++
)
{
ASSERT_TRUE
(
s
earch_resources
[
i
]
==
res_vec
[
i
]);
ASSERT_TRUE
(
s
td
::
stoi
(
search_resources
[
i
].
substr
(
3
))
==
search_
res_vec
[
i
]);
}
#ifdef MILVUS_CPU_VERSION
int32_t
resource_index_build_device
=
milvus
::
server
::
CPU_DEVICE_ID
;
s
=
config
.
SetResourceConfigIndexBuildDevice
(
"cpu"
);
#else
int32_t
resource_index_build_device
=
0
;
s
=
config
.
SetResourceConfigIndexBuildDevice
(
"gpu"
+
std
::
to_string
(
resource_index_build_device
));
#endif
std
::
vector
<
std
::
string
>
build_index_resources
=
{
"gpu0"
};
std
::
vector
<
int32_t
>
build_index_res_vec
;
std
::
string
build_index_res_str
;
milvus
::
server
::
StringHelpFunctions
::
MergeStringWithDelimeter
(
build_index_resources
,
milvus
::
server
::
CONFIG_GPU_RESOURCE_DELIMITER
,
build_index_res_str
);
s
=
config
.
SetGpuResourceConfigBuildIndexResources
(
build_index_res_str
);
ASSERT_TRUE
(
s
.
ok
());
s
=
config
.
Get
ResourceConfigIndexBuildDevice
(
int32_val
);
s
=
config
.
Get
GpuResourceConfigBuildIndexResources
(
build_index_res_vec
);
ASSERT_TRUE
(
s
.
ok
());
ASSERT_TRUE
(
int32_val
==
resource_index_build_device
);
for
(
size_t
i
=
0
;
i
<
build_index_resources
.
size
();
i
++
)
{
ASSERT_TRUE
(
std
::
stoi
(
build_index_resources
[
i
].
substr
(
3
))
==
build_index_res_vec
[
i
]);
}
#endif
}
TEST_F
(
ConfigTest
,
SERVER_CONFIG_INVALID_TEST
)
{
...
...
@@ -381,18 +378,6 @@ TEST_F(ConfigTest, SERVER_CONFIG_INVALID_TEST) {
s
=
config
.
SetCacheConfigCpuCacheThreshold
(
"1.0"
);
ASSERT_FALSE
(
s
.
ok
());
#ifdef MILVUS_GPU_VERSION
s
=
config
.
SetCacheConfigGpuCacheCapacity
(
"a"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetCacheConfigGpuCacheCapacity
(
"128"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetCacheConfigGpuCacheThreshold
(
"a"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetCacheConfigGpuCacheThreshold
(
"1.0"
);
ASSERT_FALSE
(
s
.
ok
());
#endif
s
=
config
.
SetCacheConfigCacheInsertData
(
"N"
);
ASSERT_FALSE
(
s
.
ok
());
...
...
@@ -408,20 +393,29 @@ TEST_F(ConfigTest, SERVER_CONFIG_INVALID_TEST) {
s
=
config
.
SetEngineConfigGpuSearchThreshold
(
"-1"
);
ASSERT_FALSE
(
s
.
ok
());
/* resource config */
s
=
config
.
Set
ResourceConfigMode
(
"default
"
);
/*
gpu
resource config */
s
=
config
.
Set
GpuResourceConfigEnableGpu
(
"ok
"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetResourceConfigSearchResources
(
"gpu10"
);
#ifdef MILVUS_GPU_VERSION
s
=
config
.
SetGpuResourceConfigCacheCapacity
(
"a"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetGpuResourceConfigCacheCapacity
(
"128"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetResourceConfigSearchResources
(
"cpu"
);
ASSERT_TRUE
(
s
.
ok
());
s
=
config
.
SetGpuResourceConfigCacheThreshold
(
"a"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetGpuResourceConfigCacheThreshold
(
"1.0"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
SetGpuResourceConfigSearchResources
(
"gpu10"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
Set
ResourceConfigIndexBuildDevice
(
"gup2"
);
s
=
config
.
Set
GpuResourceConfigBuildIndexResources
(
"gup2"
);
ASSERT_FALSE
(
s
.
ok
());
s
=
config
.
Set
ResourceConfigIndexBuildDevice
(
"gpu16"
);
s
=
config
.
Set
GpuResourceConfigBuildIndexResources
(
"gpu16"
);
ASSERT_FALSE
(
s
.
ok
());
#endif
}
TEST_F
(
ConfigTest
,
SERVER_CONFIG_TEST
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录