Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
b6ff2724
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看板
提交
b6ff2724
编写于
6月 19, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
6月 19, 2020
浏览文件
操作
浏览文件
下载
差异文件
!1990 fix profiling stream id
Merge pull request !1990 from caifubi/fix-profiling-stream-id
上级
f17c822c
a49c6f0b
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
27 addition
and
6 deletion
+27
-6
graphengine
graphengine
+1
-1
mindspore/ccsrc/device/ascend/ascend_kernel_runtime.cc
mindspore/ccsrc/device/ascend/ascend_kernel_runtime.cc
+2
-1
mindspore/ccsrc/device/ascend/profiling/profiling_utils.cc
mindspore/ccsrc/device/ascend/profiling/profiling_utils.cc
+2
-1
mindspore/ccsrc/device/ascend/profiling/profiling_utils.h
mindspore/ccsrc/device/ascend/profiling/profiling_utils.h
+2
-1
mindspore/ccsrc/device/ascend/profiling/reporter/task_desc_reporter.cc
...rc/device/ascend/profiling/reporter/task_desc_reporter.cc
+12
-2
mindspore/ccsrc/device/ascend/profiling/reporter/task_desc_reporter.h
...src/device/ascend/profiling/reporter/task_desc_reporter.h
+3
-0
tests/ut/cpp/stub/ge/ge_task_launch_stub.cc
tests/ut/cpp/stub/ge/ge_task_launch_stub.cc
+5
-0
未找到文件。
graphengine
@
c54db434
Subproject commit
45ca7863ac6410c8e2f83168481ddc6b43bcea33
Subproject commit
c54db4343f83cb0c15cc3b5c9755926de27fa3af
mindspore/ccsrc/device/ascend/ascend_kernel_runtime.cc
浏览文件 @
b6ff2724
...
...
@@ -367,7 +367,8 @@ bool AscendKernelRuntime::LoadTask(const session::KernelGraph *graph) {
}
if
(
ProfilingManager
::
GetInstance
().
IsProfiling
())
{
auto
task_ids
=
ge
::
model_runner
::
ModelRunner
::
Instance
().
GetTaskIdList
(
model_iter
->
first
);
ProfilingUtils
::
ReportProfilingData
(
task_ids
,
NOT_NULL
(
graph
));
auto
stream_ids
=
ge
::
model_runner
::
ModelRunner
::
Instance
().
GetStreamIdList
(
model_iter
->
first
);
ProfilingUtils
::
ReportProfilingData
(
task_ids
,
stream_ids
,
NOT_NULL
(
graph
));
}
return
true
;
}
...
...
mindspore/ccsrc/device/ascend/profiling/profiling_utils.cc
浏览文件 @
b6ff2724
...
...
@@ -302,7 +302,7 @@ bool ProfilingUtils::ValidComputeGraph(NotNull<const session::KernelGraph *> gra
return
false
;
}
void
ProfilingUtils
::
ReportProfilingData
(
const
std
::
vector
<
uint32_t
>
&
task_ids
,
void
ProfilingUtils
::
ReportProfilingData
(
const
std
::
vector
<
uint32_t
>
&
task_ids
,
const
std
::
vector
<
uint32_t
>
&
stream_ids
,
NotNull
<
const
session
::
KernelGraph
*>
graph
)
{
if
(
!
ValidComputeGraph
(
graph
))
{
MS_LOG
(
WARNING
)
<<
"Not a valid compute graph:"
<<
graph
->
graph_id
();
...
...
@@ -319,6 +319,7 @@ void ProfilingUtils::ReportProfilingData(const std::vector<uint32_t> &task_ids,
MS_EXCEPTION_IF_NULL
(
context
);
TaskDescReporter
task_reporter
(
context
->
device_id
(),
"vm.task_desc_info"
,
ret
->
second
);
task_reporter
.
set_task_ids
(
task_ids
);
task_reporter
.
set_stream_ids
(
stream_ids
);
task_reporter
.
ReportData
();
GraphDescReporter
graph_reporter
(
context
->
device_id
(),
"vm.graph_desc_info"
,
ret
->
second
);
...
...
mindspore/ccsrc/device/ascend/profiling/profiling_utils.h
浏览文件 @
b6ff2724
...
...
@@ -87,7 +87,8 @@ class ProfilingUtils {
// Mapping task_id and kernel name for device to generate the time cost of specific kernel.
// Device calculate the time cost of the task which is marked by task id.
// But we need data of (kernel name , time cost)
static
void
ReportProfilingData
(
const
std
::
vector
<
uint32_t
>
&
task_ids
,
NotNull
<
const
session
::
KernelGraph
*>
graph
);
static
void
ReportProfilingData
(
const
std
::
vector
<
uint32_t
>
&
task_ids
,
const
std
::
vector
<
uint32_t
>
&
stream_ids
,
NotNull
<
const
session
::
KernelGraph
*>
graph
);
// Get profiling trace point from envs.
// export PROFILING_FP_START='full name of the first cnode to execute'
...
...
mindspore/ccsrc/device/ascend/profiling/reporter/task_desc_reporter.cc
浏览文件 @
b6ff2724
...
...
@@ -40,12 +40,22 @@ void TaskDescReporter::ReportData() {
auto
ascend_kernel_mod
=
dynamic_cast
<
kernel
::
AscendKernelMod
*>
(
kernel_mod
);
MS_EXCEPTION_IF_NULL
(
node
);
MS_EXCEPTION_IF_NULL
(
ascend_kernel_mod
);
auto
desc_ptr
=
std
::
make_shared
<
TaskDesc
>
(
node
->
fullname_with_scope
(),
task_ids_
[
task_index
++
],
ascend_kernel_mod
->
block_dim
(),
ascend_kernel_mod
->
stream_id
());
// Check task_id and stream_id valid
CheckStreamTaskValid
(
task_index
,
task_index
);
auto
desc_ptr
=
std
::
make_shared
<
TaskDesc
>
(
node
->
fullname_with_scope
(),
task_ids_
[
task_index
],
ascend_kernel_mod
->
block_dim
(),
stream_ids_
[
task_index
]);
prof_desc_
.
emplace_back
(
desc_ptr
);
++
task_index
;
}
DescReporter
::
ReportData
();
}
void
TaskDescReporter
::
CheckStreamTaskValid
(
uint32_t
task_id
,
uint32_t
stream_id
)
{
if
(
task_id
>=
task_ids_
.
size
()
||
stream_id
>=
stream_ids_
.
size
())
{
MS_LOG
(
EXCEPTION
)
<<
"Index invalid. task_id:"
<<
task_id
<<
", task_ids.size:"
<<
task_ids_
.
size
()
<<
", stream_id:"
<<
stream_id
<<
", stream_ids.size:"
<<
stream_ids_
.
size
();
}
}
}
// namespace ascend
}
// namespace device
}
// namespace mindspore
mindspore/ccsrc/device/ascend/profiling/reporter/task_desc_reporter.h
浏览文件 @
b6ff2724
...
...
@@ -32,9 +32,12 @@ class TaskDescReporter : public DescReporter {
~
TaskDescReporter
()
override
=
default
;
void
ReportData
()
override
;
void
set_task_ids
(
const
std
::
vector
<
uint32_t
>
&
task_ids
)
{
task_ids_
=
task_ids
;
}
void
set_stream_ids
(
const
std
::
vector
<
uint32_t
>
&
stream_ids
)
{
stream_ids_
=
stream_ids
;
}
private:
std
::
vector
<
uint32_t
>
task_ids_
;
std
::
vector
<
uint32_t
>
stream_ids_
;
void
CheckStreamTaskValid
(
uint32_t
task_id
,
uint32_t
stream_id
);
};
}
// namespace ascend
}
// namespace device
...
...
tests/ut/cpp/stub/ge/ge_task_launch_stub.cc
浏览文件 @
b6ff2724
...
...
@@ -40,6 +40,11 @@ const std::vector<uint32_t> &ModelRunner::GetTaskIdList(uint32_t model_id) const
static
std
::
vector
<
uint32_t
>
task_id_list
;
return
task_id_list
;
}
const
std
::
vector
<
uint32_t
>
&
ModelRunner
::
GetStreamIdList
(
uint32_t
model_id
)
const
{
static
std
::
vector
<
uint32_t
>
stream_id_list
;
return
stream_id_list
;
}
}
// namespace model_runner
}
// namespace ge
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录