Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
mindinsight
提交
c363a866
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看板
提交
c363a866
编写于
6月 30, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
6月 30, 2020
浏览文件
操作
浏览文件
下载
差异文件
!404 Change the summary watcher for not calling analyse in user scripts.
Merge pull request !404 from yuximiao/master
上级
27195031
c66be92e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
12 deletion
+20
-12
mindinsight/datavisual/data_transform/summary_watcher.py
mindinsight/datavisual/data_transform/summary_watcher.py
+8
-8
mindinsight/profiler/common/util.py
mindinsight/profiler/common/util.py
+12
-4
未找到文件。
mindinsight/datavisual/data_transform/summary_watcher.py
浏览文件 @
c363a866
...
...
@@ -226,7 +226,7 @@ class SummaryWatcher:
elif
entry
.
is_dir
():
profiler_pattern
=
re
.
search
(
self
.
PROFILER_DIRECTORY_REGEX
,
entry
.
name
)
full_dir_path
=
os
.
path
.
join
(
summary_base_dir
,
relative_path
,
entry
.
name
)
if
profiler_pattern
is
None
or
self
.
_is_empty
_directory
(
full_dir_path
):
if
profiler_pattern
is
None
or
not
self
.
_is_valid_profiler
_directory
(
full_dir_path
):
return
profiler
=
{
...
...
@@ -286,19 +286,19 @@ class SummaryWatcher:
profiler_pattern
=
re
.
search
(
self
.
PROFILER_DIRECTORY_REGEX
,
entry
.
name
)
if
profiler_pattern
is
not
None
and
entry
.
is_dir
():
full_path
=
os
.
path
.
realpath
(
os
.
path
.
join
(
summary_directory
,
entry
.
name
))
if
not
self
.
_is_empty
_directory
(
full_path
):
if
self
.
_is_valid_profiler
_directory
(
full_path
):
return
True
return
False
def
_is_
empty
_directory
(
self
,
directory
):
def
_is_
valid_profiler
_directory
(
self
,
directory
):
try
:
count
=
len
(
os
.
listdir
(
directory
))
except
FileNotFoundError
:
logger
.
warning
(
'Directory %s not found.'
,
directory
)
count
=
0
from
mindinsight.profiler.common.util
import
analyse_device_list_from_profiler_dir
device_list
=
analyse_device_list_from_profiler_dir
(
directory
)
except
ImportError
:
device_list
=
[]
return
not
bool
(
coun
t
)
return
bool
(
device_lis
t
)
def
list_summary_directories_by_pagination
(
self
,
summary_base_dir
,
offset
=
0
,
limit
=
10
):
"""
...
...
mindinsight/profiler/common/util.py
浏览文件 @
c363a866
...
...
@@ -35,16 +35,24 @@ def analyse_device_list_from_profiler_dir(profiler_dir):
Returns:
list, the device_id list.
"""
profiler_file_prefix
=
[
"timeline_display"
,
"output_op_compute_time"
]
device_id_list
=
set
()
for
_
,
_
,
filenames
in
os
.
walk
(
profiler_dir
):
for
filename
in
filenames
:
profiler_file_prefix
=
[
"output_op_compute_time"
,
"output_data_preprocess_aicpu"
]
items
=
filename
.
split
(
"_"
)
device_num
=
items
[
-
1
].
split
(
"."
)[
0
]
if
items
[
-
1
].
split
(
"."
)
else
""
if
filename
.
startswith
(
"step_trace_raw"
):
items
=
filename
.
split
(
"_"
)
device_num
=
""
if
len
(
items
)
>
3
:
device_num
=
items
[
3
]
else
:
items
=
filename
.
split
(
"_"
)
device_num
=
items
[
-
1
].
split
(
"."
)[
0
]
if
items
[
-
1
].
split
(
"."
)
else
""
if
device_num
.
isdigit
()
and
'_'
.
join
(
items
[:
-
1
])
in
profiler_file_prefix
:
device_id_list
.
add
(
device_num
)
return
list
(
device_id_list
)
return
sorted
(
list
(
device_id_list
)
)
def
query_latest_trace_time_file
(
profiler_dir
,
device_id
=
0
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录