Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
7b949861
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,发现更多精彩内容 >>
未验证
提交
7b949861
编写于
11月 30, 2019
作者:
J
Jin Hai
提交者:
GitHub
11月 30, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #614 from cydrain/caiyd_remove_cpu_version_macro
#611 remove MILVUS_CPU_VERSION
上级
8e4c5833
a023511f
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
43 addition
and
50 deletion
+43
-50
CHANGELOG.md
CHANGELOG.md
+1
-0
core/CMakeLists.txt
core/CMakeLists.txt
+0
-3
core/src/db/DBImpl.cpp
core/src/db/DBImpl.cpp
+3
-3
core/src/db/engine/ExecutionEngineImpl.cpp
core/src/db/engine/ExecutionEngineImpl.cpp
+9
-9
core/src/main.cpp
core/src/main.cpp
+3
-3
core/src/server/Server.cpp
core/src/server/Server.cpp
+3
-3
core/unittest/db/utils.cpp
core/unittest/db/utils.cpp
+8
-9
core/unittest/server/utils.cpp
core/unittest/server/utils.cpp
+8
-11
core/unittest/wrapper/utils.cpp
core/unittest/wrapper/utils.cpp
+8
-9
未找到文件。
CHANGELOG.md
浏览文件 @
7b949861
...
...
@@ -72,6 +72,7 @@ Please mark all change in change log and use the ticket from JIRA.
-
\#
449 - Add ShowPartitions example for C++ SDK
-
\#
470 - Small raw files should not be build index
-
\#
584 - Intergrate internal FAISS
-
\#
611 - Remove MILVUS_CPU_VERSION
## Task
...
...
core/CMakeLists.txt
浏览文件 @
7b949861
...
...
@@ -146,7 +146,6 @@ if (CUSTOMIZATION)
add_compile_definitions
(
CUSTOMIZATION
)
endif
()
set
(
MILVUS_CPU_VERSION false
)
if
(
MILVUS_GPU_VERSION
)
message
(
STATUS
"Building Milvus GPU version"
)
add_compile_definitions
(
"MILVUS_GPU_VERSION"
)
...
...
@@ -155,8 +154,6 @@ if (MILVUS_GPU_VERSION)
set
(
CUDA_NVCC_FLAGS
"
${
CUDA_NVCC_FLAGS
}
-Xcompiler -fPIC -std=c++11 -D_FORCE_INLINES --expt-extended-lambda"
)
else
()
message
(
STATUS
"Building Milvus CPU version"
)
set
(
MILVUS_CPU_VERSION true
)
add_compile_definitions
(
"MILVUS_CPU_VERSION"
)
endif
()
if
(
MILVUS_WITH_PROMETHEUS
)
...
...
core/src/db/DBImpl.cpp
浏览文件 @
7b949861
...
...
@@ -1033,10 +1033,10 @@ DBImpl::BuildTableIndexRecursively(const std::string& table_id, const TableIndex
if
(
!
failed_files
.
empty
())
{
std
::
string
msg
=
"Failed to build index for "
+
std
::
to_string
(
failed_files
.
size
())
+
((
failed_files
.
size
()
==
1
)
?
" file"
:
" files"
);
#ifdef MILVUS_CPU_VERSION
msg
+=
", please double check index parameters."
;
#else
#ifdef MILVUS_GPU_VERSION
msg
+=
", file size is too large or gpu memory is not enough."
;
#else
msg
+=
", please double check index parameters."
;
#endif
return
Status
(
DB_ERROR
,
msg
);
}
...
...
core/src/db/engine/ExecutionEngineImpl.cpp
浏览文件 @
7b949861
...
...
@@ -93,18 +93,18 @@ ExecutionEngineImpl::CreatetVecIndex(EngineType type) {
break
;
}
case
EngineType
::
FAISS_IVFFLAT
:
{
#ifdef MILVUS_CPU_VERSION
index
=
GetVecIndexFactory
(
IndexType
::
FAISS_IVFFLAT_CPU
);
#else
#ifdef MILVUS_GPU_VERSION
index
=
GetVecIndexFactory
(
IndexType
::
FAISS_IVFFLAT_MIX
);
#else
index
=
GetVecIndexFactory
(
IndexType
::
FAISS_IVFFLAT_CPU
);
#endif
break
;
}
case
EngineType
::
FAISS_IVFSQ8
:
{
#ifdef MILVUS_CPU_VERSION
index
=
GetVecIndexFactory
(
IndexType
::
FAISS_IVFSQ8_CPU
);
#else
#ifdef MILVUS_GPU_VERSION
index
=
GetVecIndexFactory
(
IndexType
::
FAISS_IVFSQ8_MIX
);
#else
index
=
GetVecIndexFactory
(
IndexType
::
FAISS_IVFSQ8_CPU
);
#endif
break
;
}
...
...
@@ -119,10 +119,10 @@ ExecutionEngineImpl::CreatetVecIndex(EngineType type) {
}
#endif
case
EngineType
::
FAISS_PQ
:
{
#ifdef MILVUS_CPU_VERSION
index
=
GetVecIndexFactory
(
IndexType
::
FAISS_IVFPQ_CPU
);
#else
#ifdef MILVUS_GPU_VERSION
index
=
GetVecIndexFactory
(
IndexType
::
FAISS_IVFPQ_MIX
);
#else
index
=
GetVecIndexFactory
(
IndexType
::
FAISS_IVFPQ_CPU
);
#endif
break
;
}
...
...
core/src/main.cpp
浏览文件 @
7b949861
...
...
@@ -58,10 +58,10 @@ print_banner() {
<<
"OpenBLAS"
#endif
<<
" library."
<<
std
::
endl
;
#ifdef MILVUS_CPU_VERSION
std
::
cout
<<
"You are using Milvus CPU edition"
<<
std
::
endl
;
#else
#ifdef MILVUS_GPU_VERSION
std
::
cout
<<
"You are using Milvus GPU edition"
<<
std
::
endl
;
#else
std
::
cout
<<
"You are using Milvus CPU edition"
<<
std
::
endl
;
#endif
std
::
cout
<<
std
::
endl
;
}
...
...
core/src/server/Server.cpp
浏览文件 @
7b949861
...
...
@@ -183,10 +183,10 @@ Server::Start() {
// print version information
SERVER_LOG_INFO
<<
"Milvus "
<<
BUILD_TYPE
<<
" version: v"
<<
MILVUS_VERSION
<<
", built at "
<<
BUILD_TIME
;
#ifdef MILVUS_CPU_VERSION
SERVER_LOG_INFO
<<
"CPU edition"
;
#else
#ifdef MILVUS_GPU_VERSION
SERVER_LOG_INFO
<<
"GPU edition"
;
#else
SERVER_LOG_INFO
<<
"CPU edition"
;
#endif
server
::
Metrics
::
GetInstance
().
Init
();
server
::
SystemInfo
::
GetInstance
().
Init
();
...
...
core/unittest/db/utils.cpp
浏览文件 @
7b949861
...
...
@@ -68,17 +68,16 @@ static const char* CONFIG_STR =
"engine_config:
\n
"
" use_blas_threshold: 20
\n
"
"
\n
"
"resource_config:
\n
"
#ifdef MILVUS_CPU_VERSION
" search_resources:
\n
"
" - cpu
\n
"
" index_build_device: cpu # CPU used for building index"
;
#else
" search_resources:
\n
"
" - cpu
\n
"
#ifdef MILVUS_GPU_VERSION
"gpu_resource_config:
\n
"
" enable: true # whether to enable GPU resources
\n
"
" cache_capacity: 4 # GB, size of GPU memory per card used for cache, must be a positive integer
\n
"
" search_resources: # define the GPU devices used for search computation, must be in format gpux
\n
"
" - gpu0
\n
"
" build_index_resources: # define the GPU devices used for index building, must be in format gpux
\n
"
" - gpu0
\n
"
" index_build_device: gpu0 # GPU used for building index"
;
#endif
"
\n
"
;
void
WriteToFile
(
const
std
::
string
&
file_path
,
const
char
*
content
)
{
...
...
core/unittest/server/utils.cpp
浏览文件 @
7b949861
...
...
@@ -54,24 +54,21 @@ static const char* VALID_CONFIG_STR =
"cache_config:
\n
"
" cpu_cache_capacity: 16 # GB, CPU memory used for cache
\n
"
" cpu_cache_threshold: 0.85
\n
"
" gpu_cache_capacity: 4 # GB, GPU memory used for cache
\n
"
" gpu_cache_threshold: 0.85
\n
"
" cache_insert_data: false # whether to load inserted data into cache
\n
"
"
\n
"
"engine_config:
\n
"
" use_blas_threshold: 20
\n
"
"
\n
"
"resource_config:
\n
"
#ifdef MILVUS_CPU_VERSION
" search_resources:
\n
"
" - cpu
\n
"
" index_build_device: cpu # CPU used for building index"
;
#else
" search_resources:
\n
"
" - cpu
\n
"
#ifdef MILVUS_GPU_VERSION
"gpu_resource_config:
\n
"
" enable: true # whether to enable GPU resources
\n
"
" cache_capacity: 4 # GB, size of GPU memory per card used for cache, must be a positive integer
\n
"
" search_resources: # define the GPU devices used for search computation, must be in format gpux
\n
"
" - gpu0
\n
"
" build_index_resources: # define the GPU devices used for index building, must be in format gpux
\n
"
" - gpu0
\n
"
" index_build_device: gpu0 # GPU used for building index"
;
#endif
"
\n
"
;
static
const
char
*
INVALID_CONFIG_STR
=
"*INVALID*"
;
...
...
core/unittest/wrapper/utils.cpp
浏览文件 @
7b949861
...
...
@@ -56,17 +56,16 @@ static const char* CONFIG_STR =
"engine_config:
\n
"
" blas_threshold: 20
\n
"
"
\n
"
"resource_config:
\n
"
#ifdef MILVUS_CPU_VERSION
" search_resources:
\n
"
" - cpu
\n
"
" index_build_device: cpu # CPU used for building index"
;
#else
" search_resources:
\n
"
" - cpu
\n
"
#ifdef MILVUS_GPU_VERSION
"gpu_resource_config:
\n
"
" enable: true # whether to enable GPU resources
\n
"
" cache_capacity: 4 # GB, size of GPU memory per card used for cache, must be a positive integer
\n
"
" search_resources: # define the GPU devices used for search computation, must be in format gpux
\n
"
" - gpu0
\n
"
" build_index_resources: # define the GPU devices used for index building, must be in format gpux
\n
"
" - gpu0
\n
"
" index_build_device: gpu0 # GPU used for building index"
;
#endif
"
\n
"
;
void
WriteToFile
(
const
std
::
string
&
file_path
,
const
char
*
content
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录