Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
mindinsight
提交
54758ce8
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看板
提交
54758ce8
编写于
6月 29, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
6月 29, 2020
浏览文件
操作
浏览文件
下载
差异文件
!394 revert "update the display column name in ui", fix the column name by UI
Merge pull request !394 from chenchao99/profiler_analyser
上级
ae1eb165
a0433c14
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
30 addition
and
52 deletion
+30
-52
mindinsight/profiler/analyser/analyser.py
mindinsight/profiler/analyser/analyser.py
+3
-20
tests/st/func/profiler/test_op_analyser.py
tests/st/func/profiler/test_op_analyser.py
+3
-4
tests/ut/profiler/analyser/test_analyser_aicore_detail.py
tests/ut/profiler/analyser/test_analyser_aicore_detail.py
+12
-14
tests/ut/profiler/analyser/test_analyser_aicore_type.py
tests/ut/profiler/analyser/test_analyser_aicore_type.py
+12
-14
未找到文件。
mindinsight/profiler/analyser/analyser.py
浏览文件 @
54758ce8
...
...
@@ -34,8 +34,6 @@ class AicoreTypeAnalyser(BaseAnalyser):
ProfilerPathErrorException: If the profiling dir is invalid.
"""
_col_names
=
[
'op_type'
,
'execution_time'
,
'execution_frequency'
,
'percent'
]
_col_names_in_result
=
[
'op_type'
,
'execution_time (ms)'
,
'execution_frequency'
,
'percent'
]
_file_name_aicore_type_time
=
'aicore_intermediate_{}_type.csv'
def
_load
(
self
):
...
...
@@ -74,7 +72,6 @@ class AicoreTypeAnalyser(BaseAnalyser):
"""
for
item
in
self
.
_result
:
item
[
1
]
=
float
(
format
(
item
[
1
],
'.6f'
))
self
.
_display_col_names
=
self
.
_col_names_in_result
[:]
return
super
().
_organize_query_result
()
def
_convert_field_type
(
self
,
row
):
...
...
@@ -104,8 +101,6 @@ class AicoreDetailAnalyser(BaseAnalyser):
"""
_col_names
=
[
'op_name'
,
'op_type'
,
'avg_execution_time'
,
'subgraph'
,
'full_op_name'
,
'op_info'
]
_col_names_in_result
=
[
'op_name'
,
'op_type'
,
'avg_execution_time (ms)'
,
'subgraph'
,
'full_op_name'
,
'op_info'
]
_file_name_aicore_detail_time
=
'aicore_intermediate_{}_detail.csv'
_file_name_framework_info
=
'framework_raw_{}.csv'
...
...
@@ -231,11 +226,11 @@ class AicoreDetailAnalyser(BaseAnalyser):
is_display_full_op_name (bool): Whether to display the operator full
name.
"""
self
.
_display_col_names
=
self
.
_col_names
_in_result
[
0
:
4
]
self
.
_display_col_names
=
self
.
_col_names
[
0
:
4
]
if
is_display_full_op_name
:
self
.
_display_col_names
.
append
(
self
.
_col_names
_in_result
[
4
])
self
.
_display_col_names
.
append
(
self
.
_col_names
[
4
])
if
is_display_detail
:
self
.
_display_col_names
.
append
(
self
.
_col_names
_in_result
[
5
])
self
.
_display_col_names
.
append
(
self
.
_col_names
[
5
])
def
_convert_framework_field_type
(
self
,
row
):
"""
...
...
@@ -280,8 +275,6 @@ class AicpuAnalyser(BaseAnalyser):
"""
_col_names
=
[
'serial_number'
,
'op_type'
,
'total_time'
,
'dispatch_time'
,
'run_start'
,
'run_end'
]
_col_names_in_result
=
[
'serial_number'
,
'op_type'
,
'total_time (ms)'
,
'dispatch_time (ms)'
,
'run_start'
,
'run_end'
]
_file_name_aicpu_time
=
'aicpu_intermediate_{}.csv'
def
_load
(
self
):
...
...
@@ -312,16 +305,6 @@ class AicpuAnalyser(BaseAnalyser):
return
self
.
_default_filter
(
item
,
filter_condition
)
self
.
_result
=
list
(
filter
(
_inner_filter
,
self
.
_data
))
def
_organize_query_result
(
self
):
"""
Organize the query result.
Returns:
dict, the query result.
"""
self
.
_display_col_names
=
self
.
_col_names_in_result
[:]
return
super
().
_organize_query_result
()
def
_convert_field_type
(
self
,
row
):
"""
Convert the field type to the specific type.
...
...
tests/st/func/profiler/test_op_analyser.py
浏览文件 @
54758ce8
...
...
@@ -32,8 +32,7 @@ from tests.ut.profiler import RAW_DATA_BASE
OP_GATHER_V2_INFO
=
{
'col_name'
:
[
'op_name'
,
'op_type'
,
'avg_execution_time (ms)'
,
'subgraph'
,
'full_op_name'
,
'op_info'
'op_name'
,
'op_type'
,
'avg_execution_time'
,
'subgraph'
,
'full_op_name'
,
'op_info'
],
'object'
:
[
[
...
...
@@ -125,7 +124,7 @@ class TestOpAnalyser:
def
test_query_aicore_type_1
(
self
):
"""Test the function of querying AICORE operator type infomation."""
expect_result
=
{
'col_name'
:
[
'op_type'
,
'execution_time
(ms)
'
,
'execution_frequency'
,
'percent'
],
'col_name'
:
[
'op_type'
,
'execution_time'
,
'execution_frequency'
,
'percent'
],
'object'
:
[
[
'UnsortedSegmentSum'
,
44.607826
,
2
,
35.28
],
[
'GatherV2'
,
43.155441
,
2
,
34.13
],
...
...
@@ -177,7 +176,7 @@ class TestOpAnalyser:
def
test_query_aicore_type_2
(
self
):
"""Test the function of querying AICORE operator type infomation."""
expect_result
=
{
'col_name'
:
[
'op_type'
,
'execution_time
(ms)
'
,
'execution_frequency'
,
'percent'
],
'col_name'
:
[
'op_type'
,
'execution_time'
,
'execution_frequency'
,
'percent'
],
'object'
:
[
[
'MatMul'
,
1.936681
,
15
,
1.53
],
[
'Mul'
,
1.902949
,
32
,
1.51
]
...
...
tests/ut/profiler/analyser/test_analyser_aicore_detail.py
浏览文件 @
54758ce8
...
...
@@ -23,8 +23,6 @@ from tests.ut.profiler import PROFILER_DIR
COL_NAMES
=
[
'op_name'
,
'op_type'
,
'avg_execution_time'
,
'subgraph'
,
'full_op_name'
,
'op_info'
]
COL_NAMES_IN_RESULT
=
[
'op_name'
,
'op_type'
,
'avg_execution_time (ms)'
,
'subgraph'
,
'full_op_name'
,
'op_info'
]
def
get_detail_infos
(
indexes
=
None
,
sort_name
=
None
,
sort_type
=
True
):
...
...
@@ -77,7 +75,7 @@ class TestAicoreDetailAnalyser(TestCase):
def
test_query_success_1
(
self
):
"""Test the success of the querying function."""
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
get_detail_infos
(),
'size'
:
10
}
...
...
@@ -90,7 +88,7 @@ class TestAicoreDetailAnalyser(TestCase):
def
test_query_success_2
(
self
):
"""Test the success of the querying function."""
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
get_detail_infos
(
indexes
=
[
9
]),
'size'
:
1
}
...
...
@@ -127,7 +125,7 @@ class TestAicoreDetailAnalyser(TestCase):
def
test_query_success_3
(
self
):
"""Test the success of the querying function."""
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
get_detail_infos
(
sort_name
=
'avg_execution_time'
,
sort_type
=
True
),
'size'
:
10
}
...
...
@@ -141,7 +139,7 @@ class TestAicoreDetailAnalyser(TestCase):
self
.
assertDictEqual
(
expect_result
,
result
)
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
get_detail_infos
(
sort_name
=
'op_name'
,
sort_type
=
False
),
'size'
:
10
}
...
...
@@ -157,7 +155,7 @@ class TestAicoreDetailAnalyser(TestCase):
def
test_query_success_4
(
self
):
"""Test the success of the querying function."""
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
get_detail_infos
(
indexes
=
[
2
,
3
]),
'size'
:
10
}
...
...
@@ -171,7 +169,7 @@ class TestAicoreDetailAnalyser(TestCase):
self
.
assertDictEqual
(
expect_result
,
result
)
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
[],
'size'
:
10
}
...
...
@@ -187,7 +185,7 @@ class TestAicoreDetailAnalyser(TestCase):
def
test_query_success_5
(
self
):
"""Test the success of the querying function."""
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
get_detail_infos
(
indexes
=
[
1
,
2
],
sort_name
=
'avg_execution_time'
,
sort_type
=
True
),
...
...
@@ -211,7 +209,7 @@ class TestAicoreDetailAnalyser(TestCase):
self
.
assertDictEqual
(
expect_result
,
result
)
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
get_detail_infos
(
indexes
=
[
0
,
1
,
2
,
8
],
sort_name
=
'avg_execution_time'
,
sort_type
=
True
),
...
...
@@ -238,7 +236,7 @@ class TestAicoreDetailAnalyser(TestCase):
detail_infos
=
get_detail_infos
(
indexes
=
[
9
])
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
[
0
:
5
],
'col_name'
:
COL_NAMES
[
0
:
5
],
'object'
:
[
item
[
0
:
5
]
for
item
in
detail_infos
],
'size'
:
1
}
...
...
@@ -254,7 +252,7 @@ class TestAicoreDetailAnalyser(TestCase):
self
.
assertDictEqual
(
expect_result
,
result
)
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
[
0
:
4
],
'col_name'
:
COL_NAMES
[
0
:
4
],
'object'
:
[
item
[
0
:
4
]
for
item
in
detail_infos
],
'size'
:
1
}
...
...
@@ -274,7 +272,7 @@ class TestAicoreDetailAnalyser(TestCase):
"""Test the success of the querying and sorting function by operator type."""
detail_infos
=
get_detail_infos
(
indexes
=
[
9
,
0
,
2
,
1
,
5
,
3
,
4
])
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
[
0
:
4
],
'col_name'
:
COL_NAMES
[
0
:
4
],
'object'
:
[
item
[
0
:
4
]
for
item
in
detail_infos
]
}
...
...
@@ -296,7 +294,7 @@ class TestAicoreDetailAnalyser(TestCase):
"""Test the success of the querying and sorting function by operator type."""
detail_infos
=
get_detail_infos
(
indexes
=
[
9
,
0
,
2
,
1
,
3
,
4
,
8
,
6
])
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
[
0
:
4
],
'col_name'
:
COL_NAMES
[
0
:
4
],
'object'
:
[
item
[
0
:
4
]
for
item
in
detail_infos
]
}
...
...
tests/ut/profiler/analyser/test_analyser_aicore_type.py
浏览文件 @
54758ce8
...
...
@@ -21,8 +21,6 @@ from mindinsight.profiler.analyser.analyser_factory import AnalyserFactory
from
tests.ut.profiler
import
PROFILER_DIR
COL_NAMES
=
[
'op_type'
,
'execution_time'
,
'execution_frequency'
,
'percent'
]
COL_NAMES_IN_RESULT
=
[
'op_type'
,
'execution_time (ms)'
,
'execution_frequency'
,
'percent'
]
def
get_type_infos
(
indexes
=
None
,
sort_name
=
None
,
sort_type
=
True
):
...
...
@@ -74,7 +72,7 @@ class TestAicoreTypeAnalyser(TestCase):
def
test_query_success_1
(
self
):
"""Test the success of the querying function."""
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
get_type_infos
(),
'size'
:
5
}
...
...
@@ -88,7 +86,7 @@ class TestAicoreTypeAnalyser(TestCase):
def
test_query_success_2
(
self
):
"""Test the success of the querying function."""
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
get_type_infos
(
indexes
=
[
1
]),
'size'
:
1
}
...
...
@@ -103,7 +101,7 @@ class TestAicoreTypeAnalyser(TestCase):
self
.
assertDictEqual
(
expect_result
,
result
)
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
get_type_infos
(
indexes
=
[
0
,
2
,
3
,
4
]),
'size'
:
4
}
...
...
@@ -118,7 +116,7 @@ class TestAicoreTypeAnalyser(TestCase):
self
.
assertDictEqual
(
expect_result
,
result
)
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
get_type_infos
(
indexes
=
[
0
,
1
,
3
]),
'size'
:
3
}
...
...
@@ -135,7 +133,7 @@ class TestAicoreTypeAnalyser(TestCase):
def
test_query_success_3
(
self
):
"""Test the success of the querying function."""
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
get_type_infos
(
indexes
=
[
1
,
3
]),
'size'
:
2
}
...
...
@@ -150,7 +148,7 @@ class TestAicoreTypeAnalyser(TestCase):
self
.
assertDictEqual
(
expect_result
,
result
)
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
get_type_infos
(
indexes
=
[
0
,
2
,
4
]),
'size'
:
3
}
...
...
@@ -165,7 +163,7 @@ class TestAicoreTypeAnalyser(TestCase):
self
.
assertDictEqual
(
expect_result
,
result
)
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
get_type_infos
(
indexes
=
[
2
,
3
]),
'size'
:
2
}
...
...
@@ -182,7 +180,7 @@ class TestAicoreTypeAnalyser(TestCase):
def
test_query_success_4
(
self
):
"""Test the success of the querying function."""
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
get_type_infos
(
sort_name
=
'op_type'
,
sort_type
=
True
),
'size'
:
5
}
condition
=
{
...
...
@@ -195,7 +193,7 @@ class TestAicoreTypeAnalyser(TestCase):
self
.
assertDictEqual
(
expect_result
,
result
)
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
get_type_infos
(
sort_name
=
'execution_time'
,
sort_type
=
False
),
'size'
:
5
}
...
...
@@ -211,7 +209,7 @@ class TestAicoreTypeAnalyser(TestCase):
def
test_query_success_5
(
self
):
"""Test the success of the querying function."""
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
get_type_infos
(
indexes
=
[
0
,
1
]),
'size'
:
5
}
...
...
@@ -225,7 +223,7 @@ class TestAicoreTypeAnalyser(TestCase):
self
.
assertDictEqual
(
expect_result
,
result
)
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
get_type_infos
(
indexes
=
[
3
,
4
]),
'size'
:
5
}
...
...
@@ -241,7 +239,7 @@ class TestAicoreTypeAnalyser(TestCase):
def
test_query_success_6
(
self
):
"""Test the success of the querying function."""
expect_result
=
{
'col_name'
:
COL_NAMES
_IN_RESULT
,
'col_name'
:
COL_NAMES
,
'object'
:
get_type_infos
(
indexes
=
[
1
,
3
],
sort_name
=
'execution_time'
,
sort_type
=
True
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录