Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
6c5f928a
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6c5f928a
编写于
11月 27, 2017
作者:
T
tensor-tang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enable inference benchmark
上级
33fa2dfb
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
68 addition
and
7 deletion
+68
-7
benchmark/paddle/image/googlenet.py
benchmark/paddle/image/googlenet.py
+1
-1
benchmark/paddle/image/resnet.py
benchmark/paddle/image/resnet.py
+1
-1
benchmark/paddle/image/run_mkldnn.sh
benchmark/paddle/image/run_mkldnn.sh
+65
-4
benchmark/paddle/image/vgg.py
benchmark/paddle/image/vgg.py
+1
-1
未找到文件。
benchmark/paddle/image/googlenet.py
浏览文件 @
6c5f928a
...
@@ -9,7 +9,7 @@ use_gpu = get_config_arg('use_gpu', bool, True)
...
@@ -9,7 +9,7 @@ use_gpu = get_config_arg('use_gpu', bool, True)
args
=
{
'height'
:
height
,
'width'
:
width
,
'color'
:
True
,
'num_class'
:
num_class
}
args
=
{
'height'
:
height
,
'width'
:
width
,
'color'
:
True
,
'num_class'
:
num_class
}
define_py_data_sources2
(
define_py_data_sources2
(
"train.list"
,
None
,
module
=
"provider"
,
obj
=
"process"
,
args
=
args
)
"train.list"
,
"test.list"
,
module
=
"provider"
,
obj
=
"process"
,
args
=
args
)
settings
(
settings
(
batch_size
=
batch_size
,
batch_size
=
batch_size
,
...
...
benchmark/paddle/image/resnet.py
浏览文件 @
6c5f928a
...
@@ -10,7 +10,7 @@ is_test = get_config_arg("is_test", bool, False)
...
@@ -10,7 +10,7 @@ is_test = get_config_arg("is_test", bool, False)
args
=
{
'height'
:
height
,
'width'
:
width
,
'color'
:
True
,
'num_class'
:
num_class
}
args
=
{
'height'
:
height
,
'width'
:
width
,
'color'
:
True
,
'num_class'
:
num_class
}
define_py_data_sources2
(
define_py_data_sources2
(
"train.list"
,
None
,
module
=
"provider"
,
obj
=
"process"
,
args
=
args
)
"train.list"
,
"test.list"
,
module
=
"provider"
,
obj
=
"process"
,
args
=
args
)
settings
(
settings
(
batch_size
=
batch_size
,
batch_size
=
batch_size
,
...
...
benchmark/paddle/image/run_mkldnn.sh
浏览文件 @
6c5f928a
...
@@ -8,13 +8,13 @@ function train() {
...
@@ -8,13 +8,13 @@ function train() {
use_mkldnn
=
$4
use_mkldnn
=
$4
if
[
$4
==
"True"
]
;
then
if
[
$4
==
"True"
]
;
then
thread
=
1
thread
=
1
log
=
"logs/
${
topology
}
-
${
layer_num
}
-mkldnn-
${
bs
}
.log"
log
=
"logs/
train-
${
topology
}
-
${
layer_num
}
-mkldnn-
${
bs
}
.log"
elif
[
$4
==
"False"
]
;
then
elif
[
$4
==
"False"
]
;
then
thread
=
`
nproc
`
thread
=
`
nproc
`
# each trainer_count use only 1 core to avoid conflict
# each trainer_count use only 1 core to avoid conflict
log
=
"logs/
${
topology
}
-
${
layer_num
}
-
${
thread
}
mklml-
${
bs
}
.log"
log
=
"logs/
train-
${
topology
}
-
${
layer_num
}
-
${
thread
}
mklml-
${
bs
}
.log"
else
else
echo
"Wrong input
$
3
, use True or False."
echo
"Wrong input
$
4
, use True or False."
exit
0
exit
0
fi
fi
args
=
"batch_size=
${
bs
}
,layer_num=
${
layer_num
}
"
args
=
"batch_size=
${
bs
}
,layer_num=
${
layer_num
}
"
...
@@ -30,13 +30,74 @@ function train() {
...
@@ -30,13 +30,74 @@ function train() {
2>&1 |
tee
${
log
}
2>&1 |
tee
${
log
}
}
}
if
[
!
-d
"train.list"
]
;
then
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"
elif
[
$4
==
"False"
]
;
then
thread
=
`
nproc
`
if
[
$thread
-gt
$bs
]
;
then
thread
=
$bs
fi
log
=
"logs/test-
${
topology
}
-
${
layer_num
}
-
${
thread
}
mklml-
${
bs
}
.log"
else
echo
"Wrong input
$4
, use True or False."
exit
0
fi
models_in
=
"models/
${
topology
}
-
${
layer_num
}
/pass-00000/"
if
[
!
-d
$models_in
]
;
then
echo
"Training model
${
topology
}
_
${
layer_num
}
"
paddle train
--job
=
train
\
--config
=
"
${
topology
}
.py"
\
--use_mkldnn
=
True
\
--use_gpu
=
False
\
--trainer_count
=
1
\
--num_passes
=
1
\
--save_dir
=
"models/
${
topology
}
-
${
layer_num
}
"
\
--config_args
=
"batch_size=128,layer_num=
${
layer_num
}
"
\
>
/dev/null 2>&1
echo
"Done"
fi
paddle train
--job
=
test
\
--config
=
"
${
topology
}
.py"
\
--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"
\
--init_model_path
=
$models_in
\
2>&1 |
tee
${
log
}
}
if
[
!
-f
"train.list"
]
;
then
echo
" "
>
train.list
echo
" "
>
train.list
fi
fi
if
[
!
-f
"test.list"
]
;
then
echo
" "
>
test.list
fi
if
[
!
-d
"logs"
]
;
then
if
[
!
-d
"logs"
]
;
then
mkdir
logs
mkdir
logs
fi
fi
if
[
!
-d
"models"
]
;
then
mkdir
-p
models
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
use_mkldnn
in
True False
;
do
for
batchsize
in
64 128 256
;
do
for
batchsize
in
64 128 256
;
do
train vgg 19
$batchsize
$use_mkldnn
train vgg 19
$batchsize
$use_mkldnn
...
...
benchmark/paddle/image/vgg.py
浏览文件 @
6c5f928a
...
@@ -9,7 +9,7 @@ layer_num = get_config_arg('layer_num', int, 19)
...
@@ -9,7 +9,7 @@ layer_num = get_config_arg('layer_num', int, 19)
args
=
{
'height'
:
height
,
'width'
:
width
,
'color'
:
True
,
'num_class'
:
num_class
}
args
=
{
'height'
:
height
,
'width'
:
width
,
'color'
:
True
,
'num_class'
:
num_class
}
define_py_data_sources2
(
define_py_data_sources2
(
"train.list"
,
None
,
module
=
"provider"
,
obj
=
"process"
,
args
=
args
)
"train.list"
,
"test.list"
,
module
=
"provider"
,
obj
=
"process"
,
args
=
args
)
settings
(
settings
(
batch_size
=
batch_size
,
batch_size
=
batch_size
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录