Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
91de80e8
S
Serving
项目概览
PaddlePaddle
/
Serving
1 年多 前同步成功
通知
186
Star
833
Fork
253
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
105
列表
看板
标记
里程碑
合并请求
10
Wiki
2
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Serving
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
105
Issue
105
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
2
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
91de80e8
编写于
2月 27, 2020
作者:
M
MRXLT
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add timeline tools
上级
3fc08321
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
48 addition
and
2 deletion
+48
-2
python/examples/bert/benchmark.sh
python/examples/bert/benchmark.sh
+1
-1
python/examples/bert/benchmark_batch.sh
python/examples/bert/benchmark_batch.sh
+1
-1
python/examples/util/show_profile.py
python/examples/util/show_profile.py
+0
-0
python/examples/util/timeline_trace.py
python/examples/util/timeline_trace.py
+46
-0
未找到文件。
python/examples/bert/benchmark.sh
浏览文件 @
91de80e8
...
...
@@ -2,6 +2,6 @@ rm profile_log
for
thread_num
in
1 4 8 12 16 20 24
do
$PYTHONROOT
/bin/python benchmark.py serving_client_conf/serving_client_conf.prototxt data.txt
$thread_num
$batch_size
>
profile 2>&1
$PYTHONROOT
/bin/python ../
imdb
/show_profile.py profile
$thread_num
>>
profile_log
$PYTHONROOT
/bin/python ../
util
/show_profile.py profile
$thread_num
>>
profile_log
tail
-n
1 profile
>>
profile_log
done
python/examples/bert/benchmark_batch.sh
浏览文件 @
91de80e8
...
...
@@ -3,6 +3,6 @@ thread_num=1
for
batch_size
in
1 4 8 16 32 64 128 256
do
$PYTHONROOT
/bin/python benchmark_batch.py serving_client_conf/serving_client_conf.prototxt data.txt
$thread_num
$batch_size
>
profile 2>&1
$PYTHONROOT
/bin/python ../
imdb
/show_profile.py profile
$thread_num
>>
profile_log
$PYTHONROOT
/bin/python ../
util
/show_profile.py profile
$thread_num
>>
profile_log
tail
-n
1 profile
>>
profile_log
done
python/examples/
imdb
/show_profile.py
→
python/examples/
util
/show_profile.py
浏览文件 @
91de80e8
文件已移动
python/examples/util/timeline_trace.py
0 → 100644
浏览文件 @
91de80e8
#coding=utf-8
import
json
import
sys
profile_file
=
sys
.
argv
[
1
]
def
prase
(
line
,
counter
):
event_list
=
line
.
split
(
" "
)
trace_list
=
[]
for
event
in
event_list
:
name
,
ts
=
event
.
split
(
":"
)
name_list
=
name
.
split
(
"_"
)
ph
=
"B"
if
(
name_list
[
-
1
]
==
"0"
)
else
"E"
if
len
(
name_list
)
==
2
:
name
=
name_list
[
0
]
else
:
name
=
name_list
[
0
]
+
"_"
+
name_list
[
1
]
event_dict
=
{}
event_dict
[
"name"
]
=
name
event_dict
[
"tid"
]
=
0
event_dict
[
"pid"
]
=
0
event_dict
[
"ts"
]
=
ts
event_dict
[
"ph"
]
=
ph
trace_list
.
append
(
event_dict
)
return
trace_list
if
__name__
==
"__main__"
:
profile_file
=
sys
.
argv
[
1
]
trace_file
=
sys
.
argv
[
2
]
all_list
=
[]
counter
=
0
with
open
(
profile_file
)
as
f
:
for
line
in
f
.
readlines
():
line
=
line
.
strip
().
split
(
"
\t
"
)
if
line
[
0
]
==
"PROFILE"
:
trace_list
=
prase
(
line
[
1
],
counter
)
counter
+=
1
for
trace
in
trace_list
:
all_list
.
append
(
trace
)
trace
=
json
.
dumps
(
all_list
,
indent
=
2
,
separators
=
(
','
,
':'
))
with
open
(
trace_file
,
"w"
)
as
f
:
f
.
write
(
trace
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录