Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
mindspore
提交
2e6a5a90
M
mindspore
项目概览
MindSpore
/
mindspore
通知
35
Star
15
Fork
15
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2e6a5a90
编写于
9月 09, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
9月 09, 2020
浏览文件
操作
浏览文件
下载
差异文件
!5891 fix unnecessary data sync
Merge pull request !5891 from kisnwang/async-run-graph
上级
fc5a7bc9
b5e57956
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
3 addition
and
4 deletion
+3
-4
mindspore/ccsrc/backend/session/executor.cc
mindspore/ccsrc/backend/session/executor.cc
+1
-0
mindspore/ccsrc/runtime/device/cpu/cpu_kernel_runtime.cc
mindspore/ccsrc/runtime/device/cpu/cpu_kernel_runtime.cc
+0
-1
mindspore/core/ir/tensor.cc
mindspore/core/ir/tensor.cc
+0
-1
mindspore/core/ir/tensor.h
mindspore/core/ir/tensor.h
+2
-2
未找到文件。
mindspore/ccsrc/backend/session/executor.cc
浏览文件 @
2e6a5a90
...
...
@@ -42,6 +42,7 @@ void UpdateOutputTensors(const VectorRef *outputs,
if
(
tensor
->
NeedSyncDeviceToHostImmediately
())
{
tensor
->
data_sync
();
tensor
->
set_device_address
(
nullptr
);
tensor
->
set_sync_status
(
kNeedSyncHostToDevice
);
}
}
}
...
...
mindspore/ccsrc/runtime/device/cpu/cpu_kernel_runtime.cc
浏览文件 @
2e6a5a90
...
...
@@ -248,7 +248,6 @@ void CPUKernelRuntime::BindInputOutput(session::KernelGraph *kernel_graph, const
tensor
->
data_c
()))
{
MS_LOG
(
EXCEPTION
)
<<
"Parameter node sync host to device failed!"
;
}
tensor
->
set_sync_status
(
kNeedSyncHostToDevice
);
}
address
->
ref_count_
=
INIT_NODE_REF
;
tensor
->
set_device_address
(
address
);
...
...
mindspore/core/ir/tensor.cc
浏览文件 @
2e6a5a90
...
...
@@ -557,7 +557,6 @@ void Tensor::data_sync() const {
if
(
!
device_sync_
->
SyncDeviceToHost
(
shape
(),
static_cast
<
size_t
>
(
data
().
nbytes
()),
data_type
(),
data_c
()))
{
MS_LOG
(
EXCEPTION
)
<<
"SyncDeviceToHost failed."
;
}
sync_status_
=
kNeedSyncHostToDevice
;
}
TypeId
Tensor
::
set_data_type
(
const
TypeId
data_type
)
{
...
...
mindspore/core/ir/tensor.h
浏览文件 @
2e6a5a90
...
...
@@ -289,7 +289,7 @@ class Tensor : public MetaTensor {
if
(
event_
!=
nullptr
)
{
event_
->
Wait
();
}
event_
=
=
nullptr
;
event_
=
nullptr
;
}
void
set_sync_status
(
TensorSyncStatus
sync_status
)
{
sync_status_
=
sync_status
;
}
...
...
@@ -306,7 +306,7 @@ class Tensor : public MetaTensor {
bool
init_flag_
{
false
};
TensorDataPtr
data_
{
nullptr
};
std
::
string
id_
{
""
};
std
::
shared_ptr
<
WaitEvent
>
event_
{
nullptr
};
mutable
std
::
shared_ptr
<
WaitEvent
>
event_
{
nullptr
};
mutable
TensorSyncStatus
sync_status_
{
kNeedSyncHostToDevice
};
DeviceSyncPtr
device_sync_
{
nullptr
};
std
::
vector
<
Axis
>
padding_type_
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录