Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
4c3969e1
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4c3969e1
编写于
4月 15, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
4月 15, 2020
浏览文件
操作
浏览文件
下载
差异文件
!351 fix bug of TensorAddGrad single op run fail
Merge pull request !351 from caifubi/fix-bug-tensoradd-grad-op
上级
b2b3e24a
762bf9ac
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
4 deletion
+33
-4
mindspore/ccsrc/device/ascend/ascend_kernel_runtime.cc
mindspore/ccsrc/device/ascend/ascend_kernel_runtime.cc
+31
-4
mindspore/ccsrc/device/ascend/ascend_kernel_runtime.h
mindspore/ccsrc/device/ascend/ascend_kernel_runtime.h
+2
-0
未找到文件。
mindspore/ccsrc/device/ascend/ascend_kernel_runtime.cc
浏览文件 @
4c3969e1
...
...
@@ -260,6 +260,19 @@ bool AscendKernelRuntime::GenTask(const session::KernelGraph *graph) {
auto
anf_node_list
=
graph
->
execution_order
();
TaskGenerator
::
GenTasks
(
anf_node_list
,
&
task_info_list
,
graph
->
graph_id
());
// Store the task_info_list
auto
iter
=
task_map_
.
find
(
graph
);
if
(
iter
!=
task_map_
.
end
())
{
MS_LOG
(
EXCEPTION
)
<<
"graph TaskInfo list already exist"
;
}
task_map_
[
graph
]
=
task_info_list
;
// Graph may have no compute node, such TensorAddGrad.
if
(
task_info_list
.
empty
())
{
MS_LOG
(
WARNING
)
<<
"graph "
<<
graph
->
graph_id
()
<<
" have no compute node"
;
return
true
;
}
AscendStreamAssign
&
assign_instance
=
AscendStreamAssign
::
GetInstance
();
// the streams' flag not HEAD_STREAM
std
::
vector
<
uint32_t
>
wait_active_stream_list
=
assign_instance
.
GetWaitStreams
();
...
...
@@ -278,10 +291,6 @@ bool AscendKernelRuntime::GenTask(const session::KernelGraph *graph) {
graph_model_map_
[
graph
]
=
model
;
graph_model_id_map_
[
graph
]
=
graph
->
graph_id
();
MS_LOG
(
INFO
)
<<
"TaskGenerator GetTaskInfo end..."
;
// Store the task_info_list
task_map_
.
insert
(
std
::
make_pair
(
graph
,
task_info_list
));
return
true
;
}
...
...
@@ -305,6 +314,11 @@ bool AscendKernelRuntime::LoadTask(const session::KernelGraph *graph) {
return
true
;
}
if
(
GraphWithEmptyTaskList
(
graph
))
{
MS_LOG
(
WARNING
)
<<
"LoadTask end, task list is empty"
;
return
true
;
}
auto
task_iter
=
graph_model_map_
.
find
(
graph
);
if
(
task_iter
==
graph_model_map_
.
end
())
{
MS_LOG
(
ERROR
)
<<
"task not exist"
;
...
...
@@ -333,6 +347,11 @@ bool AscendKernelRuntime::RunTask(const session::KernelGraph *graph) {
MS_EXCEPTION_IF_NULL
(
context_ptr
);
ge
::
InputData
input_tensors
=
ge
::
InputData
();
ge
::
OutputData
*
output_tensors
=
nullptr
;
if
(
GraphWithEmptyTaskList
(
graph
))
{
MS_LOG
(
WARNING
)
<<
"RunTask end, no task info found"
;
return
true
;
}
auto
model_id
=
GetGraphModelId
(
graph
);
bool
status
=
ge
::
model_runner
::
ModelRunner
::
Instance
().
RunModel
(
model_id
,
input_tensors
,
output_tensors
);
if
(
!
status
)
{
...
...
@@ -468,6 +487,14 @@ bool AscendKernelRuntime::DestroyHccl() {
context_ptr
->
set_enable_hccl
(
false
);
return
true
;
}
bool
AscendKernelRuntime
::
GraphWithEmptyTaskList
(
const
session
::
KernelGraph
*
graph
)
const
{
auto
iter
=
task_map_
.
find
(
graph
);
if
(
iter
==
task_map_
.
end
())
{
MS_LOG
(
EXCEPTION
)
<<
"Unknown graph ptr"
;
}
return
iter
->
second
.
empty
();
}
}
// namespace ascend
}
// namespace device
}
// namespace mindspore
mindspore/ccsrc/device/ascend/ascend_kernel_runtime.h
浏览文件 @
4c3969e1
...
...
@@ -55,6 +55,8 @@ class AscendKernelRuntime : public KernelRuntime {
void
ClearGraphModelMap
();
void
ReleaseDeviceRes
()
override
;
uint32_t
GetGraphModelId
(
const
session
::
KernelGraph
*
kernel_graph
);
bool
GraphWithEmptyTaskList
(
const
session
::
KernelGraph
*
graph
)
const
;
rtContext_t
rt_context_
{
nullptr
};
bool
initialized_
{
false
};
unordered_map
<
const
session
::
KernelGraph
*
,
vector
<
std
::
shared_ptr
<
TaskInfo
>>>
task_map_
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录