Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
27a5429a
P
Paddle
项目概览
Crayon鑫
/
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看板
未验证
提交
27a5429a
编写于
8月 22, 2022
作者:
K
kuizhiqing
提交者:
GitHub
8月 22, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support profiler summaryview instance (#45279)
上级
25d58db6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
19 deletion
+21
-19
python/paddle/distributed/launch/context/node.py
python/paddle/distributed/launch/context/node.py
+0
-18
python/paddle/profiler/profiler.py
python/paddle/profiler/profiler.py
+21
-1
未找到文件。
python/paddle/distributed/launch/context/node.py
浏览文件 @
27a5429a
...
...
@@ -78,19 +78,6 @@ class Node(object):
return
self
.
_port_cur
'''
def get_free_port2(self):
# for loop to avoid port conflict
for _ in range(100):
port = self._get_free_port()
if port in self._allocated_ports:
continue
else:
self._allocated_ports.append(port)
return port
return port
'''
@
classmethod
def
is_server_ready
(
self
,
ip
,
port
):
with
closing
(
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
))
as
sock
:
...
...
@@ -103,8 +90,3 @@ class Node(object):
return
True
else
:
return
False
if
__name__
==
'__main__'
:
n
=
Node
()
print
(
n
.
get_free_ports
(
10
))
python/paddle/profiler/profiler.py
浏览文件 @
27a5429a
...
...
@@ -38,6 +38,23 @@ class SummaryView(Enum):
r
"""
SummaryView define the summary view of different contents.
- **SummaryView.DeviceView** : The device summary view.
- **SummaryView.OverView** : The overview summary view.
- **SummaryView.ModelView** : The model summary view.
- **SummaryView.DistributedView** : The distributed summary view.
- **SummaryView.KernelView** : The kernel summary view.
- **SummaryView.OperatorView** : The operator summary view.
- **SummaryView.MemoryView** : The memory summary view.
- **SummaryView.MemoryManipulationView** : The meomory manipulation summary view.
- **SummaryView.UDFView** : The user defined summary view.
"""
DeviceView
=
0
OverView
=
1
...
...
@@ -760,7 +777,7 @@ class Profiler:
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.
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.
views(
SummaryView|
list[SummaryView], optional): summary tables to print, default to None means all views to be printed.
Examples:
.. code-block:: python
...
...
@@ -779,6 +796,9 @@ class Profiler:
prof.stop()
prof.summary(sorted_by=profiler.SortedKeys.CPUTotal, op_detail=True, thread_sep=False, time_unit='ms')
"""
if
isinstance
(
views
,
SummaryView
):
views
=
[
views
]
if
self
.
profiler_result
:
statistic_data
=
StatisticData
(
self
.
profiler_result
.
get_data
(),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录