Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
849bf9d0
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
849bf9d0
编写于
11月 30, 2017
作者:
T
tensor-tang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
separate mkldnn benchmark as train and infer
上级
6c5f928a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
115 addition
and
0 deletion
+115
-0
benchmark/paddle/image/run_mkldnn_infer.sh
benchmark/paddle/image/run_mkldnn_infer.sh
+68
-0
benchmark/paddle/image/run_mkldnn_train.sh
benchmark/paddle/image/run_mkldnn_train.sh
+47
-0
未找到文件。
benchmark/paddle/image/run_mkldnn.sh
→
benchmark/paddle/image/run_mkldnn
_infer
.sh
浏览文件 @
849bf9d0
set
-e
function
train
()
{
function
infer
()
{
unset
OMP_NUM_THREADS MKL_NUM_THREADS OMP_DYNAMIC KMP_AFFINITY
topology
=
$1
layer_num
=
$2
...
...
@@ -8,43 +8,13 @@ function train() {
use_mkldnn
=
$4
if
[
$4
==
"True"
]
;
then
thread
=
1
log
=
"logs/train-
${
topology
}
-
${
layer_num
}
-mkldnn-
${
bs
}
.log"
elif
[
$4
==
"False"
]
;
then
thread
=
`
nproc
`
# each trainer_count use only 1 core to avoid conflict
log
=
"logs/train-
${
topology
}
-
${
layer_num
}
-
${
thread
}
mklml-
${
bs
}
.log"
else
echo
"Wrong input
$4
, use True or False."
exit
0
fi
args
=
"batch_size=
${
bs
}
,layer_num=
${
layer_num
}
"
config
=
"
${
topology
}
.py"
paddle train
--job
=
time
\
--config
=
$config
\
--use_mkldnn
=
$use_mkldnn
\
--use_gpu
=
False
\
--trainer_count
=
$thread
\
--log_period
=
10
\
--test_period
=
100
\
--config_args
=
$args
\
2>&1 |
tee
${
log
}
}
function
test
()
{
unset
OMP_NUM_THREADS MKL_NUM_THREADS OMP_DYNAMIC KMP_AFFINITY
topology
=
$1
layer_num
=
$2
bs
=
$3
use_mkldnn
=
$4
if
[
$4
==
"True"
]
;
then
thread
=
1
log
=
"logs/test-
${
topology
}
-
${
layer_num
}
-mkldnn-
${
bs
}
.log"
log
=
"logs/infer-
${
topology
}
-
${
layer_num
}
-mkldnn-
${
bs
}
.log"
elif
[
$4
==
"False"
]
;
then
thread
=
`
nproc
`
if
[
$thread
-gt
$bs
]
;
then
thread
=
$bs
fi
log
=
"logs/
test
-
${
topology
}
-
${
layer_num
}
-
${
thread
}
mklml-
${
bs
}
.log"
log
=
"logs/
infer
-
${
topology
}
-
${
layer_num
}
-
${
thread
}
mklml-
${
bs
}
.log"
else
echo
"Wrong input
$4
, use True or False."
exit
0
...
...
@@ -69,8 +39,8 @@ function test() {
--use_mkldnn
=
$use_mkldnn
\
--use_gpu
=
False
\
--trainer_count
=
$thread
\
--log_period
=
10
\
--config_args
=
"batch_size=
${
bs
}
,layer_num=
${
layer_num
}
,is_
test
=True"
\
--log_period
=
32
\
--config_args
=
"batch_size=
${
bs
}
,layer_num=
${
layer_num
}
,is_
infer
=True"
\
--init_model_path
=
$models_in
\
2>&1 |
tee
${
log
}
}
...
...
@@ -91,17 +61,8 @@ fi
# inference benchmark
for
use_mkldnn
in
True False
;
do
for
batchsize
in
1 2 4 8 16
;
do
test
googlenet v1
$batchsize
$use_mkldnn
test
resnet 50
$batchsize
$use_mkldnn
test
vgg 19
$batchsize
$use_mkldnn
done
done
# training benchmark
for
use_mkldnn
in
True False
;
do
for
batchsize
in
64 128 256
;
do
train vgg 19
$batchsize
$use_mkldnn
train resnet 50
$batchsize
$use_mkldnn
train googlenet v1
$batchsize
$use_mkldnn
infer googlenet v1
$batchsize
$use_mkldnn
infer resnet 50
$batchsize
$use_mkldnn
infer vgg 19
$batchsize
$use_mkldnn
done
done
benchmark/paddle/image/run_mkldnn_train.sh
0 → 100755
浏览文件 @
849bf9d0
set
-e
function
train
()
{
unset
OMP_NUM_THREADS MKL_NUM_THREADS OMP_DYNAMIC KMP_AFFINITY
topology
=
$1
layer_num
=
$2
bs
=
$3
use_mkldnn
=
$4
if
[
$4
==
"True"
]
;
then
thread
=
1
log
=
"logs/train-
${
topology
}
-
${
layer_num
}
-mkldnn-
${
bs
}
.log"
elif
[
$4
==
"False"
]
;
then
thread
=
`
nproc
`
# each trainer_count use only 1 core to avoid conflict
log
=
"logs/train-
${
topology
}
-
${
layer_num
}
-
${
thread
}
mklml-
${
bs
}
.log"
else
echo
"Wrong input
$4
, use True or False."
exit
0
fi
args
=
"batch_size=
${
bs
}
,layer_num=
${
layer_num
}
"
config
=
"
${
topology
}
.py"
paddle train
--job
=
time
\
--config
=
$config
\
--use_mkldnn
=
$use_mkldnn
\
--use_gpu
=
False
\
--trainer_count
=
$thread
\
--log_period
=
10
\
--test_period
=
100
\
--config_args
=
$args
\
2>&1 |
tee
${
log
}
}
if
[
!
-f
"train.list"
]
;
then
echo
" "
>
train.list
fi
if
[
!
-d
"logs"
]
;
then
mkdir
logs
fi
# training benchmark
for
use_mkldnn
in
True False
;
do
for
batchsize
in
64 128 256
;
do
train vgg 19
$batchsize
$use_mkldnn
train resnet 50
$batchsize
$use_mkldnn
train googlenet v1
$batchsize
$use_mkldnn
done
done
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录