Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
194d16c1
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
194d16c1
编写于
8月 19, 2022
作者:
K
kuizhiqing
提交者:
GitHub
8月 19, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Profiler] add views in summary API (#45225)
* add views in summary api * add args in the last position
上级
1aa6adb1
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
829 addition
and
764 deletion
+829
-764
python/paddle/profiler/__init__.py
python/paddle/profiler/__init__.py
+2
-1
python/paddle/profiler/profiler.py
python/paddle/profiler/profiler.py
+21
-2
python/paddle/profiler/profiler_statistic.py
python/paddle/profiler/profiler_statistic.py
+806
-761
未找到文件。
python/paddle/profiler/__init__.py
浏览文件 @
194d16c1
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
from
.profiler
import
ProfilerState
,
ProfilerTarget
from
.profiler
import
ProfilerState
,
ProfilerTarget
from
.profiler
import
make_scheduler
,
export_chrome_tracing
,
export_protobuf
from
.profiler
import
make_scheduler
,
export_chrome_tracing
,
export_protobuf
from
.profiler
import
Profiler
from
.profiler
import
Profiler
from
.profiler
import
SummaryView
from
.profiler
import
TracerEventType
from
.profiler
import
TracerEventType
from
.utils
import
RecordEvent
,
load_profiler_result
from
.utils
import
RecordEvent
,
load_profiler_result
from
.profiler_statistic
import
SortedKeys
from
.profiler_statistic
import
SortedKeys
...
@@ -22,5 +23,5 @@ from .profiler_statistic import SortedKeys
...
@@ -22,5 +23,5 @@ from .profiler_statistic import SortedKeys
__all__
=
[
__all__
=
[
'ProfilerState'
,
'ProfilerTarget'
,
'make_scheduler'
,
'ProfilerState'
,
'ProfilerTarget'
,
'make_scheduler'
,
'export_chrome_tracing'
,
'export_protobuf'
,
'Profiler'
,
'RecordEvent'
,
'export_chrome_tracing'
,
'export_protobuf'
,
'Profiler'
,
'RecordEvent'
,
'load_profiler_result'
,
'SortedKeys'
'load_profiler_result'
,
'SortedKeys'
,
'SummaryView'
]
]
python/paddle/profiler/profiler.py
浏览文件 @
194d16c1
...
@@ -34,6 +34,22 @@ from paddle.profiler import utils
...
@@ -34,6 +34,22 @@ from paddle.profiler import utils
from
.timer
import
benchmark
from
.timer
import
benchmark
class
SummaryView
(
Enum
):
r
"""
SummaryView define the summary view of different contents.
"""
DeviceView
=
0
OverView
=
1
ModelView
=
2
DistributedView
=
3
KernelView
=
4
OperatorView
=
5
MemoryView
=
6
MemoryManipulationView
=
7
UDFView
=
8
class
ProfilerState
(
Enum
):
class
ProfilerState
(
Enum
):
r
"""
r
"""
ProfilerState is used to present the state of :ref:`Profiler <api_paddle_profiler_Profiler>` .
ProfilerState is used to present the state of :ref:`Profiler <api_paddle_profiler_Profiler>` .
...
@@ -734,7 +750,8 @@ class Profiler:
...
@@ -734,7 +750,8 @@ class Profiler:
sorted_by
=
SortedKeys
.
CPUTotal
,
sorted_by
=
SortedKeys
.
CPUTotal
,
op_detail
=
True
,
op_detail
=
True
,
thread_sep
=
False
,
thread_sep
=
False
,
time_unit
=
'ms'
):
time_unit
=
'ms'
,
views
=
None
):
r
"""
r
"""
Print the Summary table. Currently support overview, model, distributed, operator, memory manipulation and userdefined summary.
Print the Summary table. Currently support overview, model, distributed, operator, memory manipulation and userdefined summary.
...
@@ -743,6 +760,7 @@ class Profiler:
...
@@ -743,6 +760,7 @@ class Profiler:
op_detail(bool, optional): expand each operator detail information, default value is True.
op_detail(bool, optional): expand each operator detail information, default value is True.
thread_sep(bool, optional): print op table each thread, default value is False.
thread_sep(bool, optional): print op table each thread, default value is False.
time_unit(str, optional): time unit for display, can be chosen form ['s', 'ms', 'us', 'ns'], default value is 'ms'.
time_unit(str, optional): time unit for display, can be chosen form ['s', 'ms', 'us', 'ns'], default value is 'ms'.
views(list[SummaryView], optional): summary tables to print, default to None means all views to be printed.
Examples:
Examples:
.. code-block:: python
.. code-block:: python
...
@@ -770,7 +788,8 @@ class Profiler:
...
@@ -770,7 +788,8 @@ class Profiler:
sorted_by
=
sorted_by
,
sorted_by
=
sorted_by
,
op_detail
=
op_detail
,
op_detail
=
op_detail
,
thread_sep
=
thread_sep
,
thread_sep
=
thread_sep
,
time_unit
=
time_unit
))
time_unit
=
time_unit
,
views
=
views
))
def
get_profiler
(
config_path
):
def
get_profiler
(
config_path
):
...
...
python/paddle/profiler/profiler_statistic.py
浏览文件 @
194d16c1
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录