Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
a381bc5b
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看板
提交
a381bc5b
编写于
9月 07, 2020
作者:
A
anzhengqi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix profiling
上级
77dd91a6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
0 deletion
+22
-0
mindspore/ccsrc/minddata/dataset/engine/dataset_iterator.cc
mindspore/ccsrc/minddata/dataset/engine/dataset_iterator.cc
+6
-0
mindspore/ccsrc/minddata/dataset/engine/datasetops/device_queue_op.cc
...src/minddata/dataset/engine/datasetops/device_queue_op.cc
+1
-0
mindspore/ccsrc/minddata/dataset/engine/execution_tree.h
mindspore/ccsrc/minddata/dataset/engine/execution_tree.h
+11
-0
mindspore/ccsrc/minddata/dataset/engine/perf/monitor.cc
mindspore/ccsrc/minddata/dataset/engine/perf/monitor.cc
+4
-0
未找到文件。
mindspore/ccsrc/minddata/dataset/engine/dataset_iterator.cc
浏览文件 @
a381bc5b
...
...
@@ -104,6 +104,8 @@ Status DatasetIterator::FetchNextTensorRow(TensorRow *out_row) {
// Common code init and error checking in the base class.
RETURN_IF_NOT_OK
(
IteratorBase
::
FetchNextTensorRow
(
out_row
));
bool
isProfilingEnable
=
root_
->
Tree
()
->
GetProfilingManager
()
->
IsProfilingEnable
();
// Once eof is handled, always return empty row. Class must be destroyed and recreated if you
// want to iterate again.
if
(
eof_handled_
)
{
...
...
@@ -127,6 +129,9 @@ Status DatasetIterator::FetchNextTensorRow(TensorRow *out_row) {
if
(
curr_buffer_
->
eoe
())
{
MS_LOG
(
INFO
)
<<
"End of data iteration."
;
curr_buffer_
.
reset
();
// explicitly free the eoe buffer
if
(
isProfilingEnable
)
{
root_
->
Tree
()
->
SetEpochEnd
();
}
return
Status
::
OK
();
}
...
...
@@ -136,6 +141,7 @@ Status DatasetIterator::FetchNextTensorRow(TensorRow *out_row) {
if
(
curr_buffer_
->
eof
())
{
eof_handled_
=
true
;
curr_buffer_
.
reset
();
// explicitly free the eof buffer
root_
->
Tree
()
->
SetFinished
();
std
::
string
err
=
"EOF buffer encountered. Users try to fetch data beyond the specified number of epochs."
;
RETURN_STATUS_UNEXPECTED
(
err
);
}
...
...
mindspore/ccsrc/minddata/dataset/engine/datasetops/device_queue_op.cc
浏览文件 @
a381bc5b
...
...
@@ -170,6 +170,7 @@ Status DeviceQueueOp::SendDataToAscend() {
if
(
isProfilingEnable
)
{
connector_size
=
ChildOpConnectorSize
();
connector_capacity
=
ChildOpConnectorCapacity
();
tree_
->
SetEpochEnd
();
}
RETURN_IF_NOT_OK
(
GetNextInput
(
&
current_buffer
));
}
...
...
mindspore/ccsrc/minddata/dataset/engine/execution_tree.h
浏览文件 @
a381bc5b
...
...
@@ -48,6 +48,7 @@ class ExecutionTree {
kDeTStatePrepare
,
// The tree has been assigned a root node and is pending prepare
kDeTStateReady
,
// The tree has been prepared and is ready to be launched
kDeTStateExecuting
,
// The tree has been launched and is executing
kDeTStateEpochEnd
,
// The tree has been received end of epoch signal, just for profiling
kDeTStateFinished
// The tree has been drained, dataset iterator received EOF
};
...
...
@@ -207,6 +208,16 @@ class ExecutionTree {
// @return raw pointer to the TaskGroup
TaskGroup
*
AllTasks
()
const
{
return
tg_
.
get
();
}
// Return if the ExecutionTree is at end of epoch status
// @return bool - true is ExecutionTree is end of epoch status
bool
IsEpochEnd
()
const
{
return
tree_state_
==
TreeState
::
kDeTStateEpochEnd
;
}
// Set the ExecutionTree to EOE state
void
SetEpochEnd
()
{
tree_state_
=
TreeState
::
kDeTStateEpochEnd
;
}
// Set the ExecutionTree to executing state
void
SetExecuting
()
{
tree_state_
=
TreeState
::
kDeTStateExecuting
;
}
// Return if the ExecutionTree is finished (iterator receives EOF).
// @return Bool - true is ExecutionTree is finished
bool
isFinished
()
const
{
return
tree_state_
==
TreeState
::
kDeTStateFinished
;
}
...
...
mindspore/ccsrc/minddata/dataset/engine/perf/monitor.cc
浏览文件 @
a381bc5b
...
...
@@ -36,6 +36,10 @@ Status Monitor::operator()() {
// 1) Monitor Task is not interrupted by TaskManager AND
// 2) Iterator has not received EOF
while
(
!
this_thread
::
is_interrupted
()
&&
!
(
tree_
->
isFinished
()))
{
if
(
tree_
->
IsEpochEnd
())
{
tree_
->
GetProfilingManager
()
->
SaveProfilingData
();
tree_
->
SetExecuting
();
}
for
(
auto
&
node
:
tree_
->
GetProfilingManager
()
->
GetSamplingNodes
())
{
RETURN_IF_NOT_OK
(
node
.
second
->
Sample
());
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录