Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
c7695cb4
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 2 年 前同步成功
通知
187
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看板
提交
c7695cb4
编写于
4月 25, 2021
作者:
B
bjjwwang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add imagenet cpu support
上级
317ac989
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
14 addition
and
4 deletion
+14
-4
python/examples/pipeline/imagenet/benchmark.py
python/examples/pipeline/imagenet/benchmark.py
+6
-1
python/examples/pipeline/imagenet/benchmark.sh
python/examples/pipeline/imagenet/benchmark.sh
+8
-3
未找到文件。
python/examples/pipeline/imagenet/benchmark.py
浏览文件 @
c7695cb4
...
@@ -32,6 +32,8 @@ def gen_yml(device, gpu_id):
...
@@ -32,6 +32,8 @@ def gen_yml(device, gpu_id):
if
device
==
"gpu"
:
if
device
==
"gpu"
:
config
[
"op"
][
"imagenet"
][
"local_service_conf"
][
"device_type"
]
=
1
config
[
"op"
][
"imagenet"
][
"local_service_conf"
][
"device_type"
]
=
1
config
[
"op"
][
"imagenet"
][
"local_service_conf"
][
"devices"
]
=
gpu_id
config
[
"op"
][
"imagenet"
][
"local_service_conf"
][
"devices"
]
=
gpu_id
else
:
config
[
"op"
][
"imagenet"
][
"local_service_conf"
][
"device_type"
]
=
0
with
open
(
"config2.yml"
,
"w"
)
as
fout
:
with
open
(
"config2.yml"
,
"w"
)
as
fout
:
yaml
.
dump
(
config
,
fout
,
default_flow_style
=
False
)
yaml
.
dump
(
config
,
fout
,
default_flow_style
=
False
)
...
@@ -91,7 +93,10 @@ if __name__ == "__main__":
...
@@ -91,7 +93,10 @@ if __name__ == "__main__":
mode
=
sys
.
argv
[
2
]
# brpc/ local predictor
mode
=
sys
.
argv
[
2
]
# brpc/ local predictor
thread
=
int
(
sys
.
argv
[
3
])
thread
=
int
(
sys
.
argv
[
3
])
device
=
sys
.
argv
[
4
]
device
=
sys
.
argv
[
4
]
if
device
==
"gpu"
:
gpu_id
=
sys
.
argv
[
5
]
gpu_id
=
sys
.
argv
[
5
]
else
:
gpu_id
=
None
gen_yml
(
device
,
gpu_id
)
gen_yml
(
device
,
gpu_id
)
elif
sys
.
argv
[
1
]
==
"run"
:
elif
sys
.
argv
[
1
]
==
"run"
:
mode
=
sys
.
argv
[
2
]
# http/ rpc
mode
=
sys
.
argv
[
2
]
# http/ rpc
...
...
python/examples/pipeline/imagenet/benchmark.sh
浏览文件 @
c7695cb4
export
FLAGS_profile_pipeline
=
1
export
FLAGS_profile_pipeline
=
1
alias
python3
=
"python3.7"
alias
python3
=
"python3.7"
modelname
=
"imagenet"
modelname
=
"imagenet"
use_gpu
=
0
gpu_id
=
"0"
gpu_id
=
"0"
benchmark_config_filename
=
"benchmark_config.yaml"
benchmark_config_filename
=
"benchmark_config.yaml"
# HTTP
# HTTP
ps
-ef
|
grep
web_service |
awk
'{print $2}'
| xargs
kill
-9
ps
-ef
|
grep
web_service |
awk
'{print $2}'
| xargs
kill
-9
sleep
3
sleep
3
python3 benchmark.py yaml local_predictor 1 gpu
$gpu_id
if
[
$use_gpu
-eq
1
]
;
then
python3 benchmark.py yaml local_predictor 1 gpu
$gpu_id
else
python3 benchmark.py yaml local_predictor 1 cpu
fi
rm
-rf
profile_log_
$modelname
rm
-rf
profile_log_
$modelname
for
thread_num
in
1
for
thread_num
in
1
do
do
for
batch_size
in
1
for
batch_size
in
1
do
do
echo
"#----imagenet thread num:
$thread_num
batch size:
$batch_size
mode:http ----"
>>
profile_log_
$modelname
echo
"#----imagenet thread num:
$thread_num
batch size:
$batch_size
mode:http
use_gpu:
$use_gpu
----"
>>
profile_log_
$modelname
rm
-rf
PipelineServingLogs
rm
-rf
PipelineServingLogs
rm
-rf
cpu_utilization.py
rm
-rf
cpu_utilization.py
python3 resnet50_web_service.py
>
web.log 2>&1 &
python3 resnet50_web_service.py
>
web.log 2>&1 &
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录