Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
6c0853ca
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,发现更多精彩内容 >>
提交
6c0853ca
编写于
7月 09, 2019
作者:
Y
yu yunfeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add nlist and use blas conf
Former-commit-id: f6afd9d94391bd4e0681ab92c11096d4e0d19c9b
上级
06002a84
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
23 addition
and
4 deletion
+23
-4
cpp/CHANGELOG.md
cpp/CHANGELOG.md
+1
-0
cpp/conf/server_config.template
cpp/conf/server_config.template
+3
-1
cpp/src/db/FaissExecutionEngine.cpp
cpp/src/db/FaissExecutionEngine.cpp
+1
-0
cpp/src/db/FaissExecutionEngine.h
cpp/src/db/FaissExecutionEngine.h
+1
-0
cpp/src/server/MilvusServer.cpp
cpp/src/server/MilvusServer.cpp
+6
-2
cpp/src/server/ServerConfig.h
cpp/src/server/ServerConfig.h
+2
-0
cpp/src/wrapper/Operand.cpp
cpp/src/wrapper/Operand.cpp
+9
-1
未找到文件。
cpp/CHANGELOG.md
浏览文件 @
6c0853ca
...
...
@@ -18,6 +18,7 @@ Please mark all change in change log and use the ticket from JIRA.
-
MS-152 - Delete assert in MySQLMetaImpl and change MySQLConnectionPool impl
## New Feature
-
MS-195 - Add nlist and use_blas_threshold conf
## Task
...
...
cpp/conf/server_config.template
浏览文件 @
6c0853ca
...
...
@@ -33,4 +33,6 @@ cache_config: # cache configure
cpu_cache_capacity: 16 # how many memory are used as cache, unit: GB, range: 0 ~ less than total memory
engine_config:
nprobe: 10
\ No newline at end of file
nprobe: 10
nlist: 16381
use_blas_threshold: 10
\ No newline at end of file
cpp/src/db/FaissExecutionEngine.cpp
浏览文件 @
6c0853ca
...
...
@@ -167,6 +167,7 @@ Status FaissExecutionEngine::Init() {
ServerConfig
&
config
=
ServerConfig
::
GetInstance
();
ConfigNode
engine_config
=
config
.
GetConfig
(
CONFIG_ENGINE
);
nprobe_
=
engine_config
.
GetInt32Value
(
CONFIG_NPROBE
,
1000
);
nlist_
=
engine_config
.
GetInt32Value
(
CONFIG_NLIST
,
16384
);
}
else
if
(
build_index_type_
==
"IDMap"
)
{
;
...
...
cpp/src/db/FaissExecutionEngine.h
浏览文件 @
6c0853ca
...
...
@@ -65,6 +65,7 @@ protected:
std
::
string
raw_index_type_
;
size_t
nprobe_
=
0
;
size_t
nlist_
=
0
;
};
...
...
cpp/src/server/MilvusServer.cpp
浏览文件 @
6c0853ca
...
...
@@ -11,6 +11,7 @@
#include "milvus_types.h"
#include "milvus_constants.h"
#include "faiss/utils.h"
#include <thrift/protocol/TBinaryProtocol.h>
#include <thrift/protocol/TJSONProtocol.h>
...
...
@@ -25,6 +26,8 @@
#include <thread>
#include <iostream>
//extern int distance_compute_blas_threshold;
namespace
zilliz
{
namespace
milvus
{
namespace
server
{
...
...
@@ -46,11 +49,12 @@ MilvusServer::StartService() {
ServerConfig
&
config
=
ServerConfig
::
GetInstance
();
ConfigNode
server_config
=
config
.
GetConfig
(
CONFIG_SERVER
);
ConfigNode
engine_config
=
config
.
GetConfig
(
CONFIG_ENGINE
);
std
::
string
address
=
server_config
.
GetValue
(
CONFIG_SERVER_ADDRESS
,
"127.0.0.1"
);
int32_t
port
=
server_config
.
GetInt32Value
(
CONFIG_SERVER_PORT
,
19530
);
std
::
string
protocol
=
server_config
.
GetValue
(
CONFIG_SERVER_PROTOCOL
,
"binary"
);
faiss
::
distance_compute_blas_threshold
=
engine_config
.
GetInt32Value
(
CONFIG_DCBT
,
20
);
// std::cout<<"distance_compute_blas_threshold = "<< faiss::distance_compute_blas_threshold << std::endl;
try
{
DBWrapper
::
DB
();
//initialize db
...
...
cpp/src/server/ServerConfig.h
浏览文件 @
6c0853ca
...
...
@@ -44,6 +44,8 @@ static const std::string CONFIG_METRIC_PROMETHEUS_PORT = "port";
static
const
std
::
string
CONFIG_ENGINE
=
"engine_config"
;
static
const
std
::
string
CONFIG_NPROBE
=
"nprobe"
;
static
const
std
::
string
CONFIG_NLIST
=
"nlist"
;
static
const
std
::
string
CONFIG_DCBT
=
"use_blas_threshold"
;
class
ServerConfig
{
public:
...
...
cpp/src/wrapper/Operand.cpp
浏览文件 @
6c0853ca
...
...
@@ -4,6 +4,7 @@
// Proprietary and confidential.
////////////////////////////////////////////////////////////////////////////////
#include <src/server/ServerConfig.h>
#include "Operand.h"
...
...
@@ -38,8 +39,15 @@ string Operand::get_index_type(const int &nb) {
break
;
}
case
IVF
:
{
using
namespace
zilliz
::
milvus
::
server
;
ServerConfig
&
config
=
ServerConfig
::
GetInstance
();
ConfigNode
engine_config
=
config
.
GetConfig
(
CONFIG_ENGINE
);
size_t
nlist
=
engine_config
.
GetInt32Value
(
CONFIG_NLIST
,
16384
);
index_str
+=
(
ncent
!=
0
?
index_type
+
std
::
to_string
(
ncent
)
:
index_type
+
std
::
to_string
(
int
(
nb
/
1000000.0
*
16384
)));
index_type
+
std
::
to_string
(
int
(
nb
/
1000000.0
*
nlist
)));
// std::cout<<"nlist = "<<nlist<<std::endl;
break
;
}
case
IDMAP
:
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录