Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
0a76f72c
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
694
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
0a76f72c
编写于
12月 19, 2017
作者:
T
Tao Luo
提交者:
GitHub
12月 19, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6706 from luotao1/mkl_script
refine mkl&openblas script for benchmark
上级
537a15f1
d9f20576
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
105 addition
and
0 deletion
+105
-0
benchmark/paddle/image/run_mkl_infer.sh
benchmark/paddle/image/run_mkl_infer.sh
+0
-0
benchmark/paddle/image/run_mkl_train.sh
benchmark/paddle/image/run_mkl_train.sh
+4
-0
benchmark/paddle/image/run_openblas_infer.sh
benchmark/paddle/image/run_openblas_infer.sh
+62
-0
benchmark/paddle/image/run_openblas_train.sh
benchmark/paddle/image/run_openblas_train.sh
+39
-0
未找到文件。
benchmark/paddle/image/run_mkl
dnn
_infer.sh
→
benchmark/paddle/image/run_mkl_infer.sh
浏览文件 @
0a76f72c
文件已移动
benchmark/paddle/image/run_mkl
dnn
_train.sh
→
benchmark/paddle/image/run_mkl_train.sh
浏览文件 @
0a76f72c
...
...
@@ -28,6 +28,10 @@ function train() {
--test_period
=
100
\
--config_args
=
$args
\
2>&1 |
tee
${
log
}
avg_time
=
`
tail
${
log
}
-n
1 |
awk
-F
' '
'{print $8}'
|
sed
's/avg=//'
`
fps
=
`
awk
'BEGIN{printf "%.2f",('
$bs
' / '
$avg_time
' * 1000)}'
`
echo
"FPS:
$fps
images/sec"
2>&1 |
tee
-a
${
log
}
}
if
[
!
-f
"train.list"
]
;
then
...
...
benchmark/paddle/image/run_openblas_infer.sh
0 → 100755
浏览文件 @
0a76f72c
set
-e
function
clock_to_seconds
()
{
hours
=
`
echo
$1
|
awk
-F
':'
'{print $1}'
`
mins
=
`
echo
$1
|
awk
-F
':'
'{print $2}'
`
secs
=
`
echo
$1
|
awk
-F
':'
'{print $3}'
`
echo
`
awk
'BEGIN{printf "%.2f",('
$secs
' + '
$mins
' * 60 + '
$hours
' * 3600)}'
`
}
function
infer
()
{
unset
OMP_NUM_THREADS MKL_NUM_THREADS OMP_DYNAMIC KMP_AFFINITY
topology
=
$1
layer_num
=
$2
bs
=
$3
thread
=
`
nproc
`
if
[
$thread
-gt
$bs
]
;
then
thread
=
$bs
fi
log
=
"logs/infer-
${
topology
}
-
${
layer_num
}
-
${
thread
}
openblas-
${
bs
}
.log"
models_in
=
"models/
${
topology
}
-
${
layer_num
}
/pass-00000/"
if
[
!
-d
$models_in
]
;
then
echo
"./run_mkl_infer.sh to save the model first"
exit
0
fi
log_period
=
$((
256
/
bs
))
paddle train
--job
=
test
\
--config
=
"
${
topology
}
.py"
\
--use_gpu
=
False
\
--trainer_count
=
$thread
\
--log_period
=
$log_period
\
--config_args
=
"batch_size=
${
bs
}
,layer_num=
${
layer_num
}
,is_infer=True"
\
--init_model_path
=
$models_in
\
2>&1 |
tee
${
log
}
# calculate the last 5 logs period time of 1280 samples,
# the time before are burning time.
start
=
`
tail
${
log
}
-n
7 |
head
-n
1 |
awk
-F
' '
'{print $2}'
| xargs
`
end
=
`
tail
${
log
}
-n
2 |
head
-n
1 |
awk
-F
' '
'{print $2}'
| xargs
`
start_sec
=
`
clock_to_seconds
$start
`
end_sec
=
`
clock_to_seconds
$end
`
fps
=
`
awk
'BEGIN{printf "%.2f",(1280 / ('
$end_sec
' - '
$start_sec
'))}'
`
echo
"Last 1280 samples start:
${
start
}
(
${
start_sec
}
sec), end:
${
end
}
(
${
end_sec
}
sec;"
>>
${
log
}
echo
"FPS:
$fps
images/sec"
2>&1 |
tee
-a
${
log
}
}
if
[
!
-f
"train.list"
]
;
then
echo
" "
>
train.list
fi
if
[
!
-f
"test.list"
]
;
then
echo
" "
>
test.list
fi
if
[
!
-d
"logs"
]
;
then
mkdir
logs
fi
# inference benchmark
for
batchsize
in
1 2 4 8 16
;
do
infer googlenet v1
$batchsize
infer resnet 50
$batchsize
infer vgg 19
$batchsize
done
benchmark/paddle/image/run_openblas_train.sh
0 → 100755
浏览文件 @
0a76f72c
set
-e
function
train
()
{
unset
OMP_NUM_THREADS MKL_NUM_THREADS OMP_DYNAMIC KMP_AFFINITY
topology
=
$1
layer_num
=
$2
bs
=
$3
thread
=
`
nproc
`
# each trainer_count use only 1 core to avoid conflict
log
=
"logs/train-
${
topology
}
-
${
layer_num
}
-
${
thread
}
openblas-
${
bs
}
.log"
args
=
"batch_size=
${
bs
}
,layer_num=
${
layer_num
}
"
config
=
"
${
topology
}
.py"
paddle train
--job
=
time
\
--config
=
$config
\
--use_gpu
=
False
\
--trainer_count
=
$thread
\
--log_period
=
10
\
--test_period
=
100
\
--config_args
=
$args
\
2>&1 |
tee
${
log
}
avg_time
=
`
tail
${
log
}
-n
1 |
awk
-F
' '
'{print $8}'
|
sed
's/avg=//'
`
fps
=
`
awk
'BEGIN{printf "%.2f",('
$bs
' / '
$avg_time
' * 1000)}'
`
echo
"FPS:
$fps
images/sec"
2>&1 |
tee
-a
${
log
}
}
if
[
!
-f
"train.list"
]
;
then
echo
" "
>
train.list
fi
if
[
!
-d
"logs"
]
;
then
mkdir
logs
fi
# training benchmark
for
batchsize
in
64 128 256
;
do
train vgg 19
$batchsize
train resnet 50
$batchsize
train googlenet v1
$batchsize
done
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录