Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
662320c0
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,发现更多精彩内容 >>
提交
662320c0
编写于
8月 24, 2019
作者:
W
wxyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
MS-412 Fix gpu cache logical error
Former-commit-id: 6bd2a056feee54393fa4bc16b1b233f54dac0500
上级
4023e110
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
42 addition
and
17 deletion
+42
-17
cpp/CHANGELOG.md
cpp/CHANGELOG.md
+2
-1
cpp/conf/server_config.template
cpp/conf/server_config.template
+5
-5
cpp/src/db/engine/ExecutionEngineImpl.cpp
cpp/src/db/engine/ExecutionEngineImpl.cpp
+12
-8
cpp/src/scheduler/action/PushTaskToNeighbour.cpp
cpp/src/scheduler/action/PushTaskToNeighbour.cpp
+23
-3
未找到文件。
cpp/CHANGELOG.md
浏览文件 @
662320c0
...
@@ -5,6 +5,8 @@ Please mark all change in change log and use the ticket from JIRA.
...
@@ -5,6 +5,8 @@ Please mark all change in change log and use the ticket from JIRA.
# Milvus 0.4.0 (2019-07-28)
# Milvus 0.4.0 (2019-07-28)
## Bug
## Bug
-
MS-411 - Fix metric unittest linking error
-
MS-412 - Fix gpu cache logical error
## Improvement
## Improvement
-
MS-327 - Clean code for milvus
-
MS-327 - Clean code for milvus
...
@@ -80,7 +82,6 @@ Please mark all change in change log and use the ticket from JIRA.
...
@@ -80,7 +82,6 @@ Please mark all change in change log and use the ticket from JIRA.
-
MS-330 - Stability test failed caused by server core dumped
-
MS-330 - Stability test failed caused by server core dumped
-
MS-347 - Build index hangs again
-
MS-347 - Build index hangs again
-
MS-382 - fix MySQLMetaImpl::CleanUpFilesWithTTL unknown column bug
-
MS-382 - fix MySQLMetaImpl::CleanUpFilesWithTTL unknown column bug
-
MS-411 - Fix metric unittest linking error
## Improvement
## Improvement
-
MS-156 - Add unittest for merge result functions
-
MS-156 - Add unittest for merge result functions
...
...
cpp/conf/server_config.template
浏览文件 @
662320c0
...
@@ -65,21 +65,21 @@ resource_config:
...
@@ -65,21 +65,21 @@ resource_config:
memory: 64
memory: 64
device_id: 0
device_id: 0
enable_loader: true
enable_loader: true
enable_executor:
tru
e
enable_executor:
fals
e
gtx1060:
gtx1060:
type: GPU
type: GPU
memory: 6
memory: 6
device_id: 0
device_id: 0
enable_loader:
fals
e
enable_loader:
tru
e
enable_executor:
fals
e
enable_executor:
tru
e
gtx1660:
gtx1660:
type: GPU
type: GPU
memory: 6
memory: 6
device_id: 1
device_id: 1
enable_loader:
fals
e
enable_loader:
tru
e
enable_executor:
fals
e
enable_executor:
tru
e
# connection list, length: 0~N
# connection list, length: 0~N
# format: -${resource_name}===${resource_name}
# format: -${resource_name}===${resource_name}
...
...
cpp/src/db/engine/ExecutionEngineImpl.cpp
浏览文件 @
662320c0
...
@@ -139,9 +139,11 @@ Status ExecutionEngineImpl::Load(bool to_cache) {
...
@@ -139,9 +139,11 @@ Status ExecutionEngineImpl::Load(bool to_cache) {
}
}
Status
ExecutionEngineImpl
::
CopyToGpu
(
uint64_t
device_id
)
{
Status
ExecutionEngineImpl
::
CopyToGpu
(
uint64_t
device_id
)
{
index_
=
zilliz
::
milvus
::
cache
::
GpuCacheMgr
::
GetInstance
(
device_id
)
->
GetIndex
(
location_
);
auto
index
=
zilliz
::
milvus
::
cache
::
GpuCacheMgr
::
GetInstance
(
device_id
)
->
GetIndex
(
location_
);
bool
already_in_cache
=
(
index_
!=
nullptr
);
bool
already_in_cache
=
(
index
!=
nullptr
);
if
(
!
index_
)
{
if
(
already_in_cache
)
{
index_
=
index
;
}
else
{
try
{
try
{
index_
=
index_
->
CopyToGpu
(
device_id
);
index_
=
index_
->
CopyToGpu
(
device_id
);
ENGINE_LOG_DEBUG
<<
"CPU to GPU"
<<
device_id
;
ENGINE_LOG_DEBUG
<<
"CPU to GPU"
<<
device_id
;
...
@@ -161,9 +163,11 @@ Status ExecutionEngineImpl::CopyToGpu(uint64_t device_id) {
...
@@ -161,9 +163,11 @@ Status ExecutionEngineImpl::CopyToGpu(uint64_t device_id) {
}
}
Status
ExecutionEngineImpl
::
CopyToCpu
()
{
Status
ExecutionEngineImpl
::
CopyToCpu
()
{
index_
=
zilliz
::
milvus
::
cache
::
CpuCacheMgr
::
GetInstance
()
->
GetIndex
(
location_
);
auto
index
=
zilliz
::
milvus
::
cache
::
CpuCacheMgr
::
GetInstance
()
->
GetIndex
(
location_
);
bool
already_in_cache
=
(
index_
!=
nullptr
);
bool
already_in_cache
=
(
index
!=
nullptr
);
if
(
!
index_
)
{
if
(
already_in_cache
)
{
index_
=
index
;
}
else
{
try
{
try
{
index_
=
index_
->
CopyToCpu
();
index_
=
index_
->
CopyToCpu
();
ENGINE_LOG_DEBUG
<<
"GPU to CPU"
;
ENGINE_LOG_DEBUG
<<
"GPU to CPU"
;
...
@@ -175,7 +179,7 @@ Status ExecutionEngineImpl::CopyToCpu() {
...
@@ -175,7 +179,7 @@ Status ExecutionEngineImpl::CopyToCpu() {
}
}
}
}
if
(
!
already_in_cache
)
{
if
(
!
already_in_cache
)
{
Cache
();
Cache
();
}
}
return
Status
::
OK
();
return
Status
::
OK
();
...
@@ -276,7 +280,7 @@ Status ExecutionEngineImpl::Init() {
...
@@ -276,7 +280,7 @@ Status ExecutionEngineImpl::Init() {
using
namespace
zilliz
::
milvus
::
server
;
using
namespace
zilliz
::
milvus
::
server
;
ServerConfig
&
config
=
ServerConfig
::
GetInstance
();
ServerConfig
&
config
=
ServerConfig
::
GetInstance
();
ConfigNode
server_config
=
config
.
GetConfig
(
CONFIG_SERVER
);
ConfigNode
server_config
=
config
.
GetConfig
(
CONFIG_SERVER
);
gpu_num_
=
server_config
.
GetInt32Value
(
"gpu_index"
,
0
);
gpu_num_
=
server_config
.
GetInt32Value
(
"gpu_index"
,
0
);
return
Status
::
OK
();
return
Status
::
OK
();
}
}
...
...
cpp/src/scheduler/action/PushTaskToNeighbour.cpp
浏览文件 @
662320c0
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
******************************************************************************/
******************************************************************************/
#include <list>
#include <list>
#include <random>
#include "Action.h"
#include "Action.h"
...
@@ -38,6 +39,22 @@ push_task_round_robin(TaskTable &self_task_table, std::list<ResourcePtr> &neighb
...
@@ -38,6 +39,22 @@ push_task_round_robin(TaskTable &self_task_table, std::list<ResourcePtr> &neighb
}
}
}
}
void
push_task_randomly
(
TaskTable
&
self_task_table
,
std
::
vector
<
ResourcePtr
>
&
neighbours
)
{
std
::
random_device
rd
;
std
::
mt19937
mt
(
rd
());
std
::
uniform_int_distribution
<
uint64_t
>
dist
(
0
,
neighbours
.
size
()
-
1
);
CacheMgr
cache
;
auto
indexes
=
PickToMove
(
self_task_table
,
cache
,
self_task_table
.
Size
());
for
(
auto
index
:
indexes
)
{
if
(
self_task_table
.
Move
(
index
))
{
auto
task
=
self_task_table
.
Get
(
index
)
->
task
;
neighbours
[
dist
(
mt
)]
->
task_table
().
Put
(
task
);
}
}
}
void
void
Action
::
PushTaskToNeighbour
(
const
ResourceWPtr
&
res
)
{
Action
::
PushTaskToNeighbour
(
const
ResourceWPtr
&
res
)
{
auto
self
=
res
.
lock
();
auto
self
=
res
.
lock
();
...
@@ -60,18 +77,21 @@ Action::PushTaskToNeighbourHasExecutor(const ResourceWPtr &res) {
...
@@ -60,18 +77,21 @@ Action::PushTaskToNeighbourHasExecutor(const ResourceWPtr &res) {
auto
self
=
res
.
lock
();
auto
self
=
res
.
lock
();
if
(
not
self
)
return
;
if
(
not
self
)
return
;
std
::
list
<
ResourcePtr
>
neighbours
;
std
::
list
<
ResourcePtr
>
l_neighbours
;
std
::
vector
<
ResourcePtr
>
v_neighbours
;
for
(
auto
&
neighbour_node
:
self
->
GetNeighbours
())
{
for
(
auto
&
neighbour_node
:
self
->
GetNeighbours
())
{
auto
node
=
neighbour_node
.
neighbour_node
.
lock
();
auto
node
=
neighbour_node
.
neighbour_node
.
lock
();
if
(
not
node
)
continue
;
if
(
not
node
)
continue
;
auto
resource
=
std
::
static_pointer_cast
<
Resource
>
(
node
);
auto
resource
=
std
::
static_pointer_cast
<
Resource
>
(
node
);
if
(
resource
->
HasExecutor
())
{
if
(
resource
->
HasExecutor
())
{
neighbours
.
emplace_back
(
resource
);
l_neighbours
.
push_back
(
resource
);
v_neighbours
.
push_back
(
resource
);
}
}
}
}
push_task_round_robin
(
self
->
task_table
(),
neighbours
);
// push_task_round_robin(self->task_table(), l_neighbours);
push_task_randomly
(
self
->
task_table
(),
v_neighbours
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录