Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
e43081ff
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
e43081ff
编写于
6月 23, 2020
作者:
H
huzhiqiang
提交者:
GitHub
6月 23, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CI][Opt]Check the usability of opt in CI project (#3820)
上级
69f9cea0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
27 addition
and
17 deletion
+27
-17
lite/tests/math/conv_compute_test.cc
lite/tests/math/conv_compute_test.cc
+17
-17
lite/tools/ci_build.sh
lite/tools/ci_build.sh
+10
-0
未找到文件。
lite/tests/math/conv_compute_test.cc
浏览文件 @
e43081ff
...
...
@@ -236,19 +236,19 @@ void test_conv_fp32(const std::vector<DDim>& input_dims,
double
gops
=
2.0
*
dim_out
.
production
()
*
dim_in
[
1
]
*
weight_dim
[
2
]
*
weight_dim
[
3
]
/
param
.
groups
;
LOG
(
INFO
)
<<
"conv fp32: input shape: "
<<
dim_in
<<
", output shape"
<<
dim_out
<<
",running time, avg: "
<<
t0
.
LapTimes
().
Avg
()
<<
", min time: "
<<
t0
.
LapTimes
().
Min
()
<<
", total GOPS: "
<<
1e-9
*
gops
<<
" GOPS, avg GOPs: "
<<
1e-6
*
gops
/
t0
.
LapTimes
().
Avg
()
<<
" GOPs, max GOPs: "
<<
1e-6
*
gops
/
t0
.
LapTimes
().
Min
();
VLOG
(
4
)
<<
"conv fp32: input shape: "
<<
dim_in
<<
", output shape"
<<
dim_out
<<
",running time, avg: "
<<
t0
.
LapTimes
().
Avg
()
<<
", min time: "
<<
t0
.
LapTimes
().
Min
()
<<
", total GOPS: "
<<
1e-9
*
gops
<<
" GOPS, avg GOPs: "
<<
1e-6
*
gops
/
t0
.
LapTimes
().
Avg
()
<<
" GOPs, max GOPs: "
<<
1e-6
*
gops
/
t0
.
LapTimes
().
Min
();
if
(
FLAGS_check_result
)
{
double
max_ratio
=
0
;
double
max_diff
=
0
;
tensor_cmp_host
(
tout_basic
,
*
param
.
output
,
max_ratio
,
max_diff
);
LOG
(
INFO
)
<<
"compare result, max diff: "
<<
max_diff
<<
", max ratio: "
<<
max_ratio
;
VLOG
(
4
)
<<
"compare result, max diff: "
<<
max_diff
<<
", max ratio: "
<<
max_ratio
;
if
(
std
::
abs
(
max_ratio
)
>
1e-3
f
)
{
if
(
max_diff
>
5e-4
f
)
{
LOG
(
WARNING
)
<<
"basic result"
;
...
...
@@ -274,15 +274,15 @@ void test_conv_fp32(const std::vector<DDim>& input_dims,
}
}
}
LOG
(
INFO
)
<<
"test fp32 conv: input: "
<<
dim_in
<<
", output: "
<<
dim_out
<<
", weight dim: "
<<
weight_dim
<<
", pad: "
<<
pads
[
0
]
<<
", "
<<
pads
[
1
]
<<
", "
<<
pads
[
2
]
<<
", "
<<
pads
[
3
]
<<
", stride: "
<<
strides
[
0
]
<<
", "
<<
strides
[
1
]
<<
", dila_: "
<<
dilas
[
0
]
<<
", "
<<
dilas
[
1
]
<<
", group: "
<<
group
<<
", bias: "
<<
(
flag_bias
?
"true"
:
"false"
)
<<
", act: "
<<
flag_act
<<
", threads: "
<<
th
<<
", power_mode: "
<<
cls
<<
" successed!!
\n
"
;
VLOG
(
4
)
<<
"test fp32 conv: input: "
<<
dim_in
<<
", output: "
<<
dim_out
<<
", weight dim: "
<<
weight_dim
<<
", pad: "
<<
pads
[
0
]
<<
", "
<<
pads
[
1
]
<<
", "
<<
pads
[
2
]
<<
", "
<<
pads
[
3
]
<<
", stride: "
<<
strides
[
0
]
<<
", "
<<
strides
[
1
]
<<
", dila_: "
<<
dilas
[
0
]
<<
", "
<<
dilas
[
1
]
<<
", group: "
<<
group
<<
", bias: "
<<
(
flag_bias
?
"true"
:
"false"
)
<<
", act: "
<<
flag_act
<<
", threads: "
<<
th
<<
", power_mode: "
<<
cls
<<
" successed!!
\n
"
;
}
}
}
...
...
lite/tools/ci_build.sh
浏览文件 @
e43081ff
...
...
@@ -564,8 +564,18 @@ function test_arm_model {
function
test_model_optimize_tool_compile
{
cd
$workspace
cd
build
# Compile opt tool
cmake ..
-DWITH_LITE
=
ON
-DLITE_ON_MODEL_OPTIMIZE_TOOL
=
ON
-DWITH_TESTING
=
OFF
-DLITE_BUILD_EXTRA
=
ON
make opt
-j
$NUM_CORES_FOR_COMPILE
# Check whether opt can transform quantized mobilenetv1 successfully.
cd
lite/api
&&
chmod
+x ./opt
wget
--no-check-certificate
https://paddlelite-data.bj.bcebos.com/doc_models/MobileNetV1_quant.tar.gz
tar
zxf MobileNetV1_quant.tar.gz
./opt
--model_dir
=
./MobileNetV1_quant
--valid_targets
=
arm
--optimize_out
=
quant_mobilenetv1
if
[
!
-f
quant_mobilenetv1.nb
]
;
then
echo
-e
"Error! Resulted opt can not tramsform MobileNetV1_quant successfully!"
exit
1
fi
}
function
_test_paddle_code_generator
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录