Skip to content

Commit 399d3a2

Browse files
authored
Merge pull request #6022 from qingqing01/nvprof
Small fix in profiler.py of fluid.
2 parents 0066bbb + a1bf4c2 commit 399d3a2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

python/paddle/v2/fluid/profiler.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ def cuda_profiler(output_file, output_mode=None, config=None):
2222
`output_file` with Key-Value pair format or Comma separated values format.
2323
The user can set the output mode by `output_mode` argument and set the
2424
counters/options for profiling by `config` argument. The default config
25-
caontains 'gpustarttimestamp', 'gpustarttimestamp', 'gridsize3d',
26-
'threadblocksize', 'streamid', 'enableonstart 0', 'conckerneltrace'.
25+
is ['gpustarttimestamp', 'gpustarttimestamp', 'gridsize3d',
26+
'threadblocksize', 'streamid', 'enableonstart 0', 'conckerneltrace'].
2727
2828
Args:
2929
output_file (string) : The output file name, the result will be
3030
written into this file.
3131
output_mode (string) : The output mode has Key-Value pair format and
32-
Comma separated values format. It should be 'kv' or 'csv'.
32+
Comma separated values format. It should be 'kvp' or 'csv'.
3333
config (string) : The profiler options and counters can refer to
3434
"Compute Command Line Profiler User Guide".
3535
"""
3636
if output_mode is None:
3737
output_mode = 'csv'
38-
if output_mode not in ['kv', 'csv']:
39-
raise ValueError("The output mode must be 'key-value' or 'csv'.")
38+
if output_mode not in ['kvp', 'csv']:
39+
raise ValueError("The output mode must be 'kvp' or 'csv'.")
4040
config = NVPROF_CONFIG if config is None else config
4141
core.nvprof_init(output_file, output_mode, config)
4242
# Enables profiler collection by the active CUDA profiling tool.

python/paddle/v2/fluid/tests/test_profiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_nvprof(self):
2020

2121
with profiler.cuda_profiler("cuda_profiler.txt", 'csv') as nvprof:
2222
for i in range(epoc):
23-
input = np.random.random(dshape).astype("float32")
23+
input = np.random.random(dshape).astype('float32')
2424
exe.run(fluid.default_main_program(), feed={'data': input})
2525

2626

0 commit comments

Comments
 (0)