Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
af2770d3
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看板
未验证
提交
af2770d3
编写于
9月 27, 2020
作者:
H
hong19860320
提交者:
GitHub
9月 27, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[XPU] Refine the unit tests (#4457)
上级
7d3ae0ba
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
19 addition
and
18 deletion
+19
-18
lite/tests/api/CMakeLists.txt
lite/tests/api/CMakeLists.txt
+10
-11
lite/tests/api/test_bert_fp32_baidu_xpu.cc
lite/tests/api/test_bert_fp32_baidu_xpu.cc
+1
-1
lite/tests/api/test_ernie_fp32_baidu_xpu.cc
lite/tests/api/test_ernie_fp32_baidu_xpu.cc
+1
-1
lite/tests/api/test_fpr_fp32_baidu_xpu.cc
lite/tests/api/test_fpr_fp32_baidu_xpu.cc
+1
-1
lite/tests/api/test_googlenet_fp32_baidu_xpu.cc
lite/tests/api/test_googlenet_fp32_baidu_xpu.cc
+1
-1
lite/tests/api/test_mmdnn_fp32_baidu_xpu.cc
lite/tests/api/test_mmdnn_fp32_baidu_xpu.cc
+1
-1
lite/tests/api/test_resnet50_fp32_baidu_xpu.cc
lite/tests/api/test_resnet50_fp32_baidu_xpu.cc
+1
-1
lite/tests/api/test_vgg19_fp32_baidu_xpu.cc
lite/tests/api/test_vgg19_fp32_baidu_xpu.cc
+1
-1
lite/tools/ci_build.sh
lite/tools/ci_build.sh
+2
-0
未找到文件。
lite/tests/api/CMakeLists.txt
浏览文件 @
af2770d3
...
@@ -8,18 +8,17 @@ function(lite_cc_test_with_model_and_data TARGET)
...
@@ -8,18 +8,17 @@ function(lite_cc_test_with_model_and_data TARGET)
set
(
multiValueArgs
""
)
set
(
multiValueArgs
""
)
cmake_parse_arguments
(
args
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
cmake_parse_arguments
(
args
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
set
(
ARGS
""
)
if
(
DEFINED args_MODEL
)
if
(
DEFINED args_MODEL
)
set
(
ARGS
"
${
ARGS
}
--model_dir=
${
LITE_MODEL_DIR
}
/
${
args_MODEL
}
"
)
set
(
ARGS
${
ARGS
}
--model_dir=
${
LITE_MODEL_DIR
}
/
${
args_MODEL
}
)
endif
()
endif
()
if
(
DEFINED args_DATA
)
if
(
DEFINED args_DATA
)
set
(
ARGS
"
${
ARGS
}
--data_dir=
${
LITE_MODEL_DIR
}
/
${
args_DATA
}
"
)
set
(
ARGS
${
ARGS
}
--data_dir=
${
LITE_MODEL_DIR
}
/
${
args_DATA
}
)
endif
()
endif
()
if
(
DEFINED args_CONFIG
)
if
(
DEFINED args_CONFIG
)
set
(
ARGS
"
${
ARGS
}
--config_dir=
${
LITE_MODEL_DIR
}
/
${
args_CONFIG
}
"
)
set
(
ARGS
${
ARGS
}
--config_dir=
${
LITE_MODEL_DIR
}
/
${
args_CONFIG
}
)
endif
()
endif
()
if
(
DEFINED args_ARGS
)
if
(
DEFINED args_ARGS
)
set
(
ARGS
"
${
ARGS
}
${
args_ARGS
}
"
)
set
(
ARGS
${
ARGS
}
${
args_ARGS
}
)
endif
()
endif
()
lite_cc_test
(
${
TARGET
}
SRCS
${
TARGET
}
.cc
lite_cc_test
(
${
TARGET
}
SRCS
${
TARGET
}
.cc
DEPS
${
lite_model_test_DEPS
}
paddle_api_full
DEPS
${
lite_model_test_DEPS
}
paddle_api_full
...
@@ -45,7 +44,7 @@ function(lite_cc_test_with_model_and_data TARGET)
...
@@ -45,7 +44,7 @@ function(lite_cc_test_with_model_and_data TARGET)
endfunction
()
endfunction
()
if
(
LITE_WITH_ARM
)
if
(
LITE_WITH_ARM
)
lite_cc_test_with_model_and_data
(
test_transformer_with_mask_fp32_arm MODEL transformer_with_mask_fp32
ARGS
)
lite_cc_test_with_model_and_data
(
test_transformer_with_mask_fp32_arm MODEL transformer_with_mask_fp32
)
endif
()
endif
()
if
(
LITE_WITH_NPU
)
if
(
LITE_WITH_NPU
)
...
@@ -55,11 +54,11 @@ if(LITE_WITH_NPU)
...
@@ -55,11 +54,11 @@ if(LITE_WITH_NPU)
endif
()
endif
()
if
(
LITE_WITH_XPU AND NOT LITE_WITH_XTCL
)
if
(
LITE_WITH_XPU AND NOT LITE_WITH_XTCL
)
lite_cc_test_with_model_and_data
(
test_resnet50_fp32_xpu MODEL resnet50 DATA ILSVRC2012_small
)
lite_cc_test_with_model_and_data
(
test_resnet50_fp32_
baidu_
xpu MODEL resnet50 DATA ILSVRC2012_small
)
lite_cc_test_with_model_and_data
(
test_googlenet_fp32_xpu MODEL GoogLeNet DATA ILSVRC2012_small
)
lite_cc_test_with_model_and_data
(
test_googlenet_fp32_
baidu_
xpu MODEL GoogLeNet DATA ILSVRC2012_small
)
lite_cc_test_with_model_and_data
(
test_vgg19_fp32_xpu MODEL VGG19 DATA ILSVRC2012_small
)
lite_cc_test_with_model_and_data
(
test_vgg19_fp32_
baidu_
xpu MODEL VGG19 DATA ILSVRC2012_small
)
lite_cc_test_with_model_and_data
(
test_ernie_fp32_xpu MODEL ernie DATA bert_data
)
lite_cc_test_with_model_and_data
(
test_ernie_fp32_
baidu_
xpu MODEL ernie DATA bert_data
)
lite_cc_test_with_model_and_data
(
test_bert_fp32_xpu MODEL bert DATA bert_data
)
lite_cc_test_with_model_and_data
(
test_bert_fp32_
baidu_
xpu MODEL bert DATA bert_data
)
endif
()
endif
()
if
(
LITE_WITH_RKNPU
)
if
(
LITE_WITH_RKNPU
)
...
...
lite/tests/api/test_bert_fp32_xpu.cc
→
lite/tests/api/test_bert_fp32_
baidu_
xpu.cc
浏览文件 @
af2770d3
...
@@ -30,7 +30,7 @@ DEFINE_int32(iteration, 9, "iteration times to run");
...
@@ -30,7 +30,7 @@ DEFINE_int32(iteration, 9, "iteration times to run");
namespace
paddle
{
namespace
paddle
{
namespace
lite
{
namespace
lite
{
TEST
(
Bert
,
test_bert_fp32_xpu
)
{
TEST
(
Bert
,
test_bert_fp32_
baidu_
xpu
)
{
lite_api
::
CxxConfig
config
;
lite_api
::
CxxConfig
config
;
config
.
set_model_dir
(
FLAGS_model_dir
);
config
.
set_model_dir
(
FLAGS_model_dir
);
config
.
set_valid_places
({
lite_api
::
Place
{
TARGET
(
kXPU
),
PRECISION
(
kFloat
)},
config
.
set_valid_places
({
lite_api
::
Place
{
TARGET
(
kXPU
),
PRECISION
(
kFloat
)},
...
...
lite/tests/api/test_ernie_fp32_xpu.cc
→
lite/tests/api/test_ernie_fp32_
baidu_
xpu.cc
浏览文件 @
af2770d3
...
@@ -41,7 +41,7 @@ lite::Tensor GetTensorWithShape(std::vector<int64_t> shape) {
...
@@ -41,7 +41,7 @@ lite::Tensor GetTensorWithShape(std::vector<int64_t> shape) {
return
ret
;
return
ret
;
}
}
TEST
(
Ernie
,
test_ernie_fp32_xpu
)
{
TEST
(
Ernie
,
test_ernie_fp32_
baidu_
xpu
)
{
lite_api
::
CxxConfig
config
;
lite_api
::
CxxConfig
config
;
config
.
set_model_dir
(
FLAGS_model_dir
);
config
.
set_model_dir
(
FLAGS_model_dir
);
config
.
set_valid_places
({
lite_api
::
Place
{
TARGET
(
kXPU
),
PRECISION
(
kFloat
)},
config
.
set_valid_places
({
lite_api
::
Place
{
TARGET
(
kXPU
),
PRECISION
(
kFloat
)},
...
...
lite/tests/api/test_fpr_fp32_xpu.cc
→
lite/tests/api/test_fpr_fp32_
baidu_
xpu.cc
浏览文件 @
af2770d3
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
namespace
paddle
{
namespace
paddle
{
namespace
lite
{
namespace
lite
{
TEST
(
ResnetCbam
,
test_resnet_cbam_fp32_xpu
)
{
TEST
(
ResnetCbam
,
test_resnet_cbam_fp32_
baidu_
xpu
)
{
lite_api
::
CxxConfig
config
;
lite_api
::
CxxConfig
config
;
// config.set_model_dir(FLAGS_model_dir);
// config.set_model_dir(FLAGS_model_dir);
config
.
set_model_file
(
FLAGS_model_dir
+
"/__model__"
);
config
.
set_model_file
(
FLAGS_model_dir
+
"/__model__"
);
...
...
lite/tests/api/test_googlenet_fp32_xpu.cc
→
lite/tests/api/test_googlenet_fp32_
baidu_
xpu.cc
浏览文件 @
af2770d3
...
@@ -32,7 +32,7 @@ DEFINE_int32(channel, 3, "image channel");
...
@@ -32,7 +32,7 @@ DEFINE_int32(channel, 3, "image channel");
namespace
paddle
{
namespace
paddle
{
namespace
lite
{
namespace
lite
{
TEST
(
GoogLeNet
,
test_googlenet_fp32_xpu
)
{
TEST
(
GoogLeNet
,
test_googlenet_fp32_
baidu_
xpu
)
{
lite_api
::
CxxConfig
config
;
lite_api
::
CxxConfig
config
;
config
.
set_model_dir
(
FLAGS_model_dir
);
config
.
set_model_dir
(
FLAGS_model_dir
);
config
.
set_valid_places
({
lite_api
::
Place
{
TARGET
(
kXPU
),
PRECISION
(
kFloat
)},
config
.
set_valid_places
({
lite_api
::
Place
{
TARGET
(
kXPU
),
PRECISION
(
kFloat
)},
...
...
lite/tests/api/test_mmdnn_fp32_xpu.cc
→
lite/tests/api/test_mmdnn_fp32_
baidu_
xpu.cc
浏览文件 @
af2770d3
...
@@ -199,7 +199,7 @@ class FileReader {
...
@@ -199,7 +199,7 @@ class FileReader {
}
}
};
};
TEST
(
MMDNN
,
test_mmdnn_fp32_xpu
)
{
TEST
(
MMDNN
,
test_mmdnn_fp32_
baidu_
xpu
)
{
lite_api
::
CxxConfig
config
;
lite_api
::
CxxConfig
config
;
// config.set_model_dir(FLAGS_model_dir);
// config.set_model_dir(FLAGS_model_dir);
config
.
set_model_file
(
FLAGS_model_dir
+
"/__model__"
);
config
.
set_model_file
(
FLAGS_model_dir
+
"/__model__"
);
...
...
lite/tests/api/test_resnet50_fp32_xpu.cc
→
lite/tests/api/test_resnet50_fp32_
baidu_
xpu.cc
浏览文件 @
af2770d3
...
@@ -32,7 +32,7 @@ DEFINE_int32(channel, 3, "image channel");
...
@@ -32,7 +32,7 @@ DEFINE_int32(channel, 3, "image channel");
namespace
paddle
{
namespace
paddle
{
namespace
lite
{
namespace
lite
{
TEST
(
Resnet50
,
test_resnet50_fp32_xpu
)
{
TEST
(
Resnet50
,
test_resnet50_fp32_
baidu_
xpu
)
{
lite_api
::
CxxConfig
config
;
lite_api
::
CxxConfig
config
;
config
.
set_model_dir
(
FLAGS_model_dir
);
config
.
set_model_dir
(
FLAGS_model_dir
);
config
.
set_valid_places
({
lite_api
::
Place
{
TARGET
(
kXPU
),
PRECISION
(
kFloat
)},
config
.
set_valid_places
({
lite_api
::
Place
{
TARGET
(
kXPU
),
PRECISION
(
kFloat
)},
...
...
lite/tests/api/test_vgg19_fp32_xpu.cc
→
lite/tests/api/test_vgg19_fp32_
baidu_
xpu.cc
浏览文件 @
af2770d3
...
@@ -32,7 +32,7 @@ DEFINE_int32(channel, 3, "image channel");
...
@@ -32,7 +32,7 @@ DEFINE_int32(channel, 3, "image channel");
namespace
paddle
{
namespace
paddle
{
namespace
lite
{
namespace
lite
{
TEST
(
VGG19
,
test_vgg19_fp32_xpu
)
{
TEST
(
VGG19
,
test_vgg19_fp32_
baidu_
xpu
)
{
lite_api
::
CxxConfig
config
;
lite_api
::
CxxConfig
config
;
config
.
set_model_dir
(
FLAGS_model_dir
);
config
.
set_model_dir
(
FLAGS_model_dir
);
config
.
set_valid_places
({
lite_api
::
Place
{
TARGET
(
kXPU
),
PRECISION
(
kFloat
)},
config
.
set_valid_places
({
lite_api
::
Place
{
TARGET
(
kXPU
),
PRECISION
(
kFloat
)},
...
...
lite/tools/ci_build.sh
浏览文件 @
af2770d3
...
@@ -564,6 +564,8 @@ function run_all_tests_on_adb_device {
...
@@ -564,6 +564,8 @@ function run_all_tests_on_adb_device {
fi
fi
# Extract the arguments from ctest command line
# Extract the arguments from ctest command line
test_args
=
$(
echo
$(
ctest
-V
-N
-R
${
test_name
}
)
|
sed
"/.*
${
test_name
}
\"\(
.*
\)\"
.*/ s//
\1
/g"
)
test_args
=
$(
echo
$(
ctest
-V
-N
-R
${
test_name
}
)
|
sed
"/.*
${
test_name
}
\"\(
.*
\)\"
.*/ s//
\1
/g"
)
# Remove the quotes
test_args
=
$(
echo
$test_args
|
sed
"s/
\"
//g"
)
run_test_case_on_adb_device
--adb_device_name
=
$adb_device_name
--adb_work_dir
=
$adb_work_dir
--target_name
=
$test_name
$test_args
run_test_case_on_adb_device
--adb_device_name
=
$adb_device_name
--adb_work_dir
=
$adb_work_dir
--target_name
=
$test_name
$test_args
done
done
cd
-
>
/dev/null
cd
-
>
/dev/null
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录