Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
40fc1d5f
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看板
提交
40fc1d5f
编写于
7月 12, 2020
作者:
D
Dong Daxiang
提交者:
GitHub
7月 12, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into image-reader
上级
e2dec30d
c32adbca
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
71 addition
and
30 deletion
+71
-30
python/examples/bert/benchmark.sh
python/examples/bert/benchmark.sh
+27
-16
python/examples/imagenet/benchmark.sh
python/examples/imagenet/benchmark.sh
+24
-2
python/examples/imdb/benchmark.sh
python/examples/imdb/benchmark.sh
+19
-11
python/paddle_serving_app/reader/image_reader.py
python/paddle_serving_app/reader/image_reader.py
+1
-1
未找到文件。
python/examples/bert/benchmark.sh
浏览文件 @
40fc1d5f
rm
profile_log
rm
profile_log
*
export
CUDA_VISIBLE_DEVICES
=
0,1,2,3
export
FLAGS_profile_server
=
1
export
FLAGS_profile_client
=
1
export
FLAGS_serving_latency
=
1
python3
-m
paddle_serving_server_gpu.serve
--model
$1
--port
9292
--thread
4
--gpu_ids
0,1,2,3
--mem_optim
--ir_optim
2> elog
>
stdlog &
hostname
=
`
echo
$(
hostname
)
|awk
-F
'.baidu.com'
'{print $1}'
`
sleep
5
gpu_id
=
0
#save cpu and gpu utilization log
if
[
-d
utilization
]
;
then
rm
-rf
utilization
else
mkdir
utilization
fi
#start server
$PYTHONROOT
/bin/python3
-m
paddle_serving_server_gpu.serve
--model
$1
--port
9292
--thread
4
--gpu_ids
0,1,2,3
--mem_optim
--ir_optim
>
elog 2>&1 &
sleep
5
#warm up
python3 benchmark.py
--thread
8
--batch_size
1
--model
$2
/serving_client_conf.prototxt
--request
rpc
>
profile 2>&1
for
thread_num
in
4 8 16
$PYTHONROOT
/bin/python3 benchmark.py
--thread
4
--batch_size
1
--model
$2
/serving_client_conf.prototxt
--request
rpc
>
profile 2>&1
echo
-e
"import psutil
\n
cpu_utilization=psutil.cpu_percent(1,False)
\n
print('CPU_UTILIZATION:', cpu_utilization)
\n
"
>
cpu_utilization.py
for
thread_num
in
1
4 8 16
do
for
batch_size
in
1 4 16 64
256
for
batch_size
in
1 4 16 64
do
job_bt
=
`
date
'+%Y%m%d%H%M%S'
`
nvidia-smi
--id
=
$gpu_id
--query-compute-apps
=
used_memory
--format
=
csv
-lms
100
>
gpu_use.log 2>&1 &
nvidia-smi
--id
=
0
--query-compute-apps
=
used_memory
--format
=
csv
-lms
100
>
gpu_use.log 2>&1 &
nvidia-smi
--id
=
0
--query-gpu
=
utilization.gpu
--format
=
csv
-lms
100
>
gpu_utilization.log 2>&1 &
gpu_memory_pid
=
$!
python3 benchmark.py
--thread
$thread_num
--batch_size
$batch_size
--model
$2
/serving_client_conf.prototxt
--request
rpc
>
profile 2>&1
$PYTHONROOT
/bin/
python3 benchmark.py
--thread
$thread_num
--batch_size
$batch_size
--model
$2
/serving_client_conf.prototxt
--request
rpc
>
profile 2>&1
kill
${
gpu_memory_pid
}
kill
`
ps
-ef
|grep used_memory|awk
'{print $2}'
`
echo
"model_name:"
$1
echo
"thread_num:"
$thread_num
echo
"batch_size:"
$batch_size
echo
"=================Done===================="
echo
"model_name:
$1
"
>>
profile_log_
$1
echo
"batch_size:
$batch_size
"
>>
profile_log_
$1
$PYTHONROOT
/bin/python3 cpu_utilization.py
>>
profile_log_
$1
job_et
=
`
date
'+%Y%m%d%H%M%S'
`
awk
'BEGIN {max = 0} {if(NR>1){if ($1 > max) max=$1}} END {print "MAX_GPU_MEMORY_USE:", max}'
gpu_use.log
>>
profile_log_
$1
monquery
-n
${
hostname
}
-i
GPU_AVERAGE_UTILIZATION
-s
$job_bt
-e
$job_et
-d
10
>
gpu_log_file_
${
job_bt
}
monquery
-n
${
hostname
}
-i
CPU_USER
-s
$job_bt
-e
$job_et
-d
10
>
cpu_log_file_
${
job_bt
}
cpu_num
=
$(
cat
/proc/cpuinfo |
grep
processor |
wc
-l
)
gpu_num
=
$(
nvidia-smi
-L
|wc
-l
)
python ../util/show_profile.py profile
$thread_num
>>
profile_log_
$1
awk
'BEGIN {max = 0} {if(NR>1){if ($1 > max) max=$1}} END {print "MAX_GPU_MEMORY:", max}'
gpu_use.log
>>
profile_log_
$1
awk
'BEGIN {max = 0} {if(NR>1){if ($1 > max) max=$1}} END {print "GPU_UTILIZATION:", max}'
gpu_utilization.log
>>
profile_log_
$1
rm
-rf
gpu_use.log gpu_utilization.log
$PYTHONROOT
/bin/python3 ../util/show_profile.py profile
$thread_num
>>
profile_log_
$1
tail
-n
8 profile
>>
profile_log_
$1
echo
""
>>
profile_log_
$1
done
done
#Divided log
awk
'BEGIN{RS="\n\n"}{i++}{print > "bert_log_"i}'
profile_log_
$1
mkdir
bert_log
&&
mv
bert_log_
*
bert_log
ps
-ef
|grep
'serving'
|grep
-v
grep
|cut
-c
9-15 | xargs
kill
-9
python/examples/imagenet/benchmark.sh
浏览文件 @
40fc1d5f
rm
profile_log
rm
profile_log
*
export
CUDA_VISIBLE_DEVICES
=
0,1,2,3
export
FLAGS_profile_server
=
1
export
FLAGS_profile_client
=
1
python
-m
paddle_serving_server_gpu.serve
--model
$1
--port
9292
--thread
4
--gpu_ids
0,1,2,3
--mem_optim
--ir_optim
2> elog
>
stdlog &
sleep
5
gpu_id
=
0
#save cpu and gpu utilization log
if
[
-d
utilization
]
;
then
rm
-rf
utilization
else
mkdir
utilization
fi
#warm up
$PYTHONROOT
/bin/python benchmark.py
--thread
8
--batch_size
1
--model
$2
/serving_client_conf.prototxt
--request
rpc
>
profile 2>&1
$PYTHONROOT
/bin/python3 benchmark.py
--thread
4
--batch_size
1
--model
$2
/serving_client_conf.prototxt
--request
rpc
>
profile 2>&1
echo
-e
"import psutil
\n
cpu_utilization=psutil.cpu_percent(1,False)
\n
print('CPU_UTILIZATION:', cpu_utilization)
\n
"
>
cpu_utilization.py
for
thread_num
in
1 4 8 16
do
for
batch_size
in
1 4 16 64
do
job_bt
=
`
date
'+%Y%m%d%H%M%S'
`
nvidia-smi
--id
=
0
--query-compute-apps
=
used_memory
--format
=
csv
-lms
100
>
gpu_use.log 2>&1 &
nvidia-smi
--id
=
0
--query-gpu
=
utilization.gpu
--format
=
csv
-lms
100
>
gpu_utilization.log 2>&1 &
gpu_memory_pid
=
$!
$PYTHONROOT
/bin/python benchmark.py
--thread
$thread_num
--batch_size
$batch_size
--model
$2
/serving_client_conf.prototxt
--request
rpc
>
profile 2>&1
kill
${
gpu_memory_pid
}
kill
`
ps
-ef
|grep used_memory|awk
'{print $2}'
`
echo
"model name :"
$1
echo
"thread num :"
$thread_num
echo
"batch size :"
$batch_size
echo
"=================Done===================="
echo
"model name :
$1
"
>>
profile_log
echo
"batch size :
$batch_size
"
>>
profile_log
job_et
=
`
date
'+%Y%m%d%H%M%S'
`
awk
'BEGIN {max = 0} {if(NR>1){if ($1 > max) max=$1}} END {print "MAX_GPU_MEMORY:", max}'
gpu_use.log
>>
profile_log_
$1
awk
'BEGIN {max = 0} {if(NR>1){if ($1 > max) max=$1}} END {print "GPU_UTILIZATION:", max}'
gpu_utilization.log
>>
profile_log_
$1
rm
-rf
gpu_use.log gpu_utilization.log
$PYTHONROOT
/bin/python ../util/show_profile.py profile
$thread_num
>>
profile_log
tail
-n
8 profile
>>
profile_log
echo
""
>>
profile_log_
$1
done
done
#Divided log
awk
'BEGIN{RS="\n\n"}{i++}{print > "ResNet_log_"i}'
profile_log_
$1
mkdir
$1_log
&&
mv
ResNet_log_
*
$1_log
ps
-ef
|grep
'serving'
|grep
-v
grep
|cut
-c
9-15 | xargs
kill
-9
python/examples/imdb/benchmark.sh
浏览文件 @
40fc1d5f
rm
profile_log
export
CUDA_VISIBLE_DEVICES
=
0,1,2,3
rm
profile_log
*
export
FLAGS_profile_server
=
1
export
FLAGS_profile_client
=
1
export
FLAGS_serving_latency
=
1
python
-m
paddle_serving_server_gpu.serve
--model
$1
--port
9292
--thread
4
--gpu_ids
0,1,2,3
--mem_optim
--ir_optim
2> elog
>
stdlog &
$PYTHONROOT
/bin/python3
-m
paddle_serving_server.serve
--model
$1
--port
9292
--thread
4
--mem_optim
--ir_optim
2> elog
>
stdlog &
hostname
=
`
echo
$(
hostname
)
|awk
-F
'.baidu.com'
'{print $1}'
`
#save cpu and gpu utilization log
if
[
-d
utilization
]
;
then
rm
-rf
utilization
else
mkdir
utilization
fi
sleep
5
#warm up
$PYTHONROOT
/bin/python3 benchmark.py
--thread
4
--batch_size
1
--model
$2
/serving_client_conf.prototxt
--request
rpc
>
profile 2>&1
echo
-e
"import psutil
\n
cpu_utilization=psutil.cpu_percent(1,False)
\n
print('CPU_UTILIZATION:', cpu_utilization)
\n
"
>
cpu_utilization.py
for
thread_num
in
1 4 8 16
do
for
batch_size
in
1 4 16 64
do
job_bt
=
`
date
'+%Y%m%d%H%M%S'
`
python
benchmark.py
--thread
$thread_num
--batch_size
$batch_size
--model
$2
/serving_client_conf.prototxt
--request
rpc
>
profile 2>&1
$PYTHONROOT
/bin/python3
benchmark.py
--thread
$thread_num
--batch_size
$batch_size
--model
$2
/serving_client_conf.prototxt
--request
rpc
>
profile 2>&1
echo
"model_name:"
$1
echo
"thread_num:"
$thread_num
echo
"batch_size:"
$batch_size
...
...
@@ -21,15 +30,14 @@ do
echo
"model_name:
$1
"
>>
profile_log_
$1
echo
"batch_size:
$batch_size
"
>>
profile_log_
$1
job_et
=
`
date
'+%Y%m%d%H%M%S'
`
awk
'BEGIN {max = 0} {if(NR>1){if ($1 > max) max=$1}} END {print "MAX_GPU_MEMORY_USE:", max}'
gpu_use.log
>>
profile_log_
$1
monquery
-n
${
hostname
}
-i
GPU_AVERAGE_UTILIZATION
-s
$job_bt
-e
$job_et
-d
10
>
gpu_log_file_
${
job_bt
}
monquery
-n
${
hostname
}
-i
CPU_USER
-s
$job_bt
-e
$job_et
-d
10
>
cpu_log_file_
${
job_bt
}
cpu_num
=
$(
cat
/proc/cpuinfo |
grep
processor |
wc
-l
)
gpu_num
=
$(
nvidia-smi
-L
|wc
-l
)
python ../util/show_profile.py profile
$thread_num
>>
profile_log_
$1
$PYTHONROOT
/bin/python3 ../util/show_profile.py profile
$thread_num
>>
profile_log_
$1
$PYTHONROOT
/bin/python3 cpu_utilization.py
>>
profile_log_
$1
tail
-n
8 profile
>>
profile_log_
$1
echo
""
>>
profile_log_
$1
done
done
#Divided log
awk
'BEGIN{RS="\n\n"}{i++}{print > "imdb_log_"i}'
profile_log_
$1
mkdir
$1_log
&&
mv
imdb_log_
*
$1_log
ps
-ef
|grep
'serving'
|grep
-v
grep
|cut
-c
9-15 | xargs
kill
-9
python/paddle_serving_app/reader/image_reader.py
浏览文件 @
40fc1d5f
...
...
@@ -692,7 +692,7 @@ class Resize(object):
Args:
size (sequence or int): Desired output size. If size is a sequence like
(
h, w
), output size will be matched to this. If size is an int,
(
w, h
), output size will be matched to this. If size is an int,
smaller edge of the image will be matched to this number.
i.e, if height > width, then image will be rescaled to
(size * height / width, size)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录