Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
mindinsight
提交
494ad295
M
mindinsight
项目概览
MindSpore
/
mindinsight
通知
7
Star
3
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindinsight
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
494ad295
编写于
6月 28, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
6月 28, 2020
浏览文件
操作
浏览文件
下载
差异文件
!371 update the display name of aicore detail execution time
Merge pull request !371 from chenchao99/r0.5
上级
e1faf65f
65040c32
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
19 addition
and
12 deletion
+19
-12
mindinsight/backend/profiler/profile_api.py
mindinsight/backend/profiler/profile_api.py
+7
-0
mindinsight/profiler/analyser/analyser.py
mindinsight/profiler/analyser/analyser.py
+1
-1
mindinsight/profiler/common/validator/validate.py
mindinsight/profiler/common/validator/validate.py
+1
-1
tests/st/func/profiler/test_op_analyser.py
tests/st/func/profiler/test_op_analyser.py
+2
-2
tests/ut/profiler/analyser/test_analyser_aicore_detail.py
tests/ut/profiler/analyser/test_analyser_aicore_detail.py
+8
-8
未找到文件。
mindinsight/backend/profiler/profile_api.py
浏览文件 @
494ad295
...
...
@@ -72,6 +72,7 @@ def get_profile_op_info():
validate_condition
(
search_condition
)
device_id
=
search_condition
.
get
(
"device_id"
,
"0"
)
to_int
(
device_id
,
'device_id'
)
profiler_dir_abs
=
os
.
path
.
join
(
settings
.
SUMMARY_BASE_DIR
,
train_id
,
profiler_dir
)
try
:
profiler_dir_abs
=
validate_and_normalize_path
(
profiler_dir_abs
,
"profiler"
)
...
...
@@ -194,6 +195,7 @@ def get_queue_info():
profile_dir
=
get_profiler_abs_dir
(
request
)
device_id
=
unquote_args
(
request
,
"device_id"
)
to_int
(
device_id
,
'device_id'
)
queue_type
=
unquote_args
(
request
,
"type"
)
queue_info
=
{}
...
...
@@ -220,6 +222,7 @@ def get_time_info():
"""
profile_dir
=
get_profiler_abs_dir
(
request
)
device_id
=
unquote_args
(
request
,
"device_id"
)
to_int
(
device_id
,
'device_id'
)
op_type
=
unquote_args
(
request
,
"type"
)
time_info
=
{
...
...
@@ -251,6 +254,7 @@ def get_process_summary():
"""
profile_dir
=
get_profiler_abs_dir
(
request
)
device_id
=
unquote_args
(
request
,
"device_id"
)
to_int
(
device_id
,
'device_id'
)
minddata_analyser
=
AnalyserFactory
.
instance
().
get_analyser
(
'minddata'
,
profile_dir
,
device_id
)
...
...
@@ -305,6 +309,7 @@ def get_profile_summary_proposal():
device_id
=
get_device_id
(
request
)
if
not
profiler_dir
or
not
train_id
:
raise
ParamValueError
(
"No profiler_dir or train_id."
)
to_int
(
device_id
,
'device_id'
)
profiler_dir_abs
=
os
.
path
.
join
(
settings
.
SUMMARY_BASE_DIR
,
train_id
,
profiler_dir
)
try
:
...
...
@@ -361,6 +366,7 @@ def get_minddata_pipeline_op_queue_info():
validate_minddata_pipeline_condition
(
condition
)
device_id
=
condition
.
get
(
"device_id"
,
"0"
)
to_int
(
device_id
,
'device_id'
)
analyser
=
AnalyserFactory
.
instance
().
get_analyser
(
'minddata_pipeline'
,
profiler_dir_abs
,
device_id
)
...
...
@@ -398,6 +404,7 @@ def get_minddata_pipeline_queue_info():
raise
ParamValueError
(
"Invalid profiler dir."
)
device_id
=
request
.
args
.
get
(
'device_id'
,
default
=
'0'
)
to_int
(
device_id
,
'device_id'
)
op_id
=
request
.
args
.
get
(
'op_id'
,
type
=
int
)
if
op_id
is
None
:
raise
ParamValueError
(
"Invalid operator id or operator id does not exist."
)
...
...
mindinsight/profiler/analyser/analyser.py
浏览文件 @
494ad295
...
...
@@ -99,7 +99,7 @@ class AicoreDetailAnalyser(BaseAnalyser):
Raises:
ProfilerPathErrorException: If the profiling dir is invalid.
"""
_col_names
=
[
'op_name'
,
'op_type'
,
'execution_time'
,
'subgraph'
,
_col_names
=
[
'op_name'
,
'op_type'
,
'
avg_
execution_time'
,
'subgraph'
,
'full_op_name'
,
'op_info'
]
_file_name_aicore_detail_time
=
'aicore_intermediate_{}_detail.csv'
_file_name_framework_info
=
'framework_raw_{}.csv'
...
...
mindinsight/profiler/common/validator/validate.py
浏览文件 @
494ad295
...
...
@@ -24,7 +24,7 @@ from mindinsight.profiler.common.exceptions.exceptions import ProfilerParamTypeE
from
mindinsight.profiler.common.log
import
logger
as
log
AICORE_TYPE_COL
=
[
"op_type"
,
"execution_time"
,
"execution_frequency"
,
"precent"
]
AICORE_DETAIL_COL
=
[
"op_name"
,
"op_type"
,
"execution_time"
,
"subgraph"
,
"full_op_name"
]
AICORE_DETAIL_COL
=
[
"op_name"
,
"op_type"
,
"
avg_
execution_time"
,
"subgraph"
,
"full_op_name"
]
AICPU_COL
=
[
"serial_number"
,
"op_type"
,
"total_time"
,
"dispatch_time"
,
"run_start"
,
"run_end"
]
MINDDATA_PIPELINE_COL
=
[
...
...
tests/st/func/profiler/test_op_analyser.py
浏览文件 @
494ad295
...
...
@@ -32,7 +32,7 @@ from tests.ut.profiler import RAW_DATA_BASE
OP_GATHER_V2_INFO
=
{
'col_name'
:
[
'op_name'
,
'op_type'
,
'execution_time'
,
'subgraph'
,
'full_op_name'
,
'op_info'
'op_name'
,
'op_type'
,
'
avg_
execution_time'
,
'subgraph'
,
'full_op_name'
,
'op_info'
],
'object'
:
[
[
...
...
@@ -213,7 +213,7 @@ class TestOpAnalyser:
}
},
'sort_condition'
:
{
'name'
:
'execution_time'
,
'name'
:
'
avg_
execution_time'
,
'type'
:
'descending'
},
'group_condition'
:
{
...
...
tests/ut/profiler/analyser/test_analyser_aicore_detail.py
浏览文件 @
494ad295
...
...
@@ -21,8 +21,8 @@ from unittest import TestCase
from
mindinsight.profiler.analyser.analyser_factory
import
AnalyserFactory
from
tests.ut.profiler
import
PROFILER_DIR
COL_NAMES
=
[
'op_name'
,
'op_type'
,
'
execution_time'
,
'subgraph'
,
'full_op_name
'
,
'op_info'
]
COL_NAMES
=
[
'op_name'
,
'op_type'
,
'
avg_execution_time'
,
'subgraph
'
,
'
full_op_name'
,
'
op_info'
]
def
get_detail_infos
(
indexes
=
None
,
sort_name
=
None
,
sort_type
=
True
):
...
...
@@ -126,12 +126,12 @@ class TestAicoreDetailAnalyser(TestCase):
"""Test the success of the querying function."""
expect_result
=
{
'col_name'
:
COL_NAMES
,
'object'
:
get_detail_infos
(
sort_name
=
'execution_time'
,
sort_type
=
True
),
'object'
:
get_detail_infos
(
sort_name
=
'
avg_
execution_time'
,
sort_type
=
True
),
'size'
:
10
}
condition
=
{
'sort_condition'
:
{
'name'
:
'execution_time'
,
'name'
:
'
avg_
execution_time'
,
'type'
:
'descending'
}
}
...
...
@@ -187,7 +187,7 @@ class TestAicoreDetailAnalyser(TestCase):
expect_result
=
{
'col_name'
:
COL_NAMES
,
'object'
:
get_detail_infos
(
indexes
=
[
1
,
2
],
sort_name
=
'execution_time'
,
sort_type
=
True
indexes
=
[
1
,
2
],
sort_name
=
'
avg_
execution_time'
,
sort_type
=
True
),
'size'
:
4
}
...
...
@@ -198,7 +198,7 @@ class TestAicoreDetailAnalyser(TestCase):
}
},
'sort_condition'
:
{
'name'
:
'execution_time'
'name'
:
'
avg_
execution_time'
},
'group_condition'
:
{
'limit'
:
2
,
...
...
@@ -211,7 +211,7 @@ class TestAicoreDetailAnalyser(TestCase):
expect_result
=
{
'col_name'
:
COL_NAMES
,
'object'
:
get_detail_infos
(
indexes
=
[
0
,
1
,
2
,
8
],
sort_name
=
'execution_time'
,
sort_type
=
True
indexes
=
[
0
,
1
,
2
,
8
],
sort_name
=
'
avg_
execution_time'
,
sort_type
=
True
),
'size'
:
4
}
...
...
@@ -225,7 +225,7 @@ class TestAicoreDetailAnalyser(TestCase):
}
},
'sort_condition'
:
{
'name'
:
'execution_time'
'name'
:
'
avg_
execution_time'
}
}
result
=
self
.
_analyser
.
query
(
condition
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录