Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
399d3a2d
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
399d3a2d
编写于
11月 29, 2017
作者:
Q
qingqing01
提交者:
GitHub
11月 29, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6022 from qingqing01/nvprof
Small fix in profiler.py of fluid.
上级
0066bbba
a1bf4c28
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
6 addition
and
6 deletion
+6
-6
python/paddle/v2/fluid/profiler.py
python/paddle/v2/fluid/profiler.py
+5
-5
python/paddle/v2/fluid/tests/test_profiler.py
python/paddle/v2/fluid/tests/test_profiler.py
+1
-1
未找到文件。
python/paddle/v2/fluid/profiler.py
浏览文件 @
399d3a2d
...
@@ -22,21 +22,21 @@ def cuda_profiler(output_file, output_mode=None, config=None):
...
@@ -22,21 +22,21 @@ def cuda_profiler(output_file, output_mode=None, config=None):
`output_file` with Key-Value pair format or Comma separated values format.
`output_file` with Key-Value pair format or Comma separated values format.
The user can set the output mode by `output_mode` argument and set the
The user can set the output mode by `output_mode` argument and set the
counters/options for profiling by `config` argument. The default config
counters/options for profiling by `config` argument. The default config
caontains
'gpustarttimestamp', 'gpustarttimestamp', 'gridsize3d',
is [
'gpustarttimestamp', 'gpustarttimestamp', 'gridsize3d',
'threadblocksize', 'streamid', 'enableonstart 0', 'conckerneltrace'.
'threadblocksize', 'streamid', 'enableonstart 0', 'conckerneltrace'
]
.
Args:
Args:
output_file (string) : The output file name, the result will be
output_file (string) : The output file name, the result will be
written into this file.
written into this file.
output_mode (string) : The output mode has Key-Value pair format and
output_mode (string) : The output mode has Key-Value pair format and
Comma separated values format. It should be 'kv' or 'csv'.
Comma separated values format. It should be 'kv
p
' or 'csv'.
config (string) : The profiler options and counters can refer to
config (string) : The profiler options and counters can refer to
"Compute Command Line Profiler User Guide".
"Compute Command Line Profiler User Guide".
"""
"""
if
output_mode
is
None
:
if
output_mode
is
None
:
output_mode
=
'csv'
output_mode
=
'csv'
if
output_mode
not
in
[
'kv'
,
'csv'
]:
if
output_mode
not
in
[
'kv
p
'
,
'csv'
]:
raise
ValueError
(
"The output mode must be 'k
ey-value
' or 'csv'."
)
raise
ValueError
(
"The output mode must be 'k
vp
' or 'csv'."
)
config
=
NVPROF_CONFIG
if
config
is
None
else
config
config
=
NVPROF_CONFIG
if
config
is
None
else
config
core
.
nvprof_init
(
output_file
,
output_mode
,
config
)
core
.
nvprof_init
(
output_file
,
output_mode
,
config
)
# Enables profiler collection by the active CUDA profiling tool.
# Enables profiler collection by the active CUDA profiling tool.
...
...
python/paddle/v2/fluid/tests/test_profiler.py
浏览文件 @
399d3a2d
...
@@ -20,7 +20,7 @@ class TestProfiler(unittest.TestCase):
...
@@ -20,7 +20,7 @@ class TestProfiler(unittest.TestCase):
with
profiler
.
cuda_profiler
(
"cuda_profiler.txt"
,
'csv'
)
as
nvprof
:
with
profiler
.
cuda_profiler
(
"cuda_profiler.txt"
,
'csv'
)
as
nvprof
:
for
i
in
range
(
epoc
):
for
i
in
range
(
epoc
):
input
=
np
.
random
.
random
(
dshape
).
astype
(
"float32"
)
input
=
np
.
random
.
random
(
dshape
).
astype
(
'float32'
)
exe
.
run
(
fluid
.
default_main_program
(),
feed
=
{
'data'
:
input
})
exe
.
run
(
fluid
.
default_main_program
(),
feed
=
{
'data'
:
input
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录