Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
6064c2f4
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
332
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看板
未验证
提交
6064c2f4
编写于
6月 16, 2020
作者:
H
hong19860320
提交者:
GitHub
6月 16, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[XPU] Enable XPU CI (#3796)
上级
79a32b9d
变更
24
显示空白变更内容
内联
并排
Showing
24 changed file
with
35 addition
and
29 deletion
+35
-29
lite/CMakeLists.txt
lite/CMakeLists.txt
+3
-1
lite/tests/api/CMakeLists.txt
lite/tests/api/CMakeLists.txt
+5
-2
lite/tests/api/test_bert_lite_xpu.cc
lite/tests/api/test_bert_lite_xpu.cc
+1
-1
lite/tests/api/test_ernie_lite_xpu.cc
lite/tests/api/test_ernie_lite_xpu.cc
+1
-1
lite/tests/kernels/activation_compute_test.cc
lite/tests/kernels/activation_compute_test.cc
+3
-3
lite/tests/kernels/batch_norm_compute_test.cc
lite/tests/kernels/batch_norm_compute_test.cc
+1
-1
lite/tests/kernels/cast_compute_test.cc
lite/tests/kernels/cast_compute_test.cc
+1
-1
lite/tests/kernels/dropout_compute_test.cc
lite/tests/kernels/dropout_compute_test.cc
+1
-1
lite/tests/kernels/elementwise_compute_test.cc
lite/tests/kernels/elementwise_compute_test.cc
+1
-1
lite/tests/kernels/gather_compute_test.cc
lite/tests/kernels/gather_compute_test.cc
+1
-1
lite/tests/kernels/layer_norm_compute_test.cc
lite/tests/kernels/layer_norm_compute_test.cc
+1
-1
lite/tests/kernels/lookup_table_compute_test.cc
lite/tests/kernels/lookup_table_compute_test.cc
+3
-2
lite/tests/kernels/matmul_compute_test.cc
lite/tests/kernels/matmul_compute_test.cc
+2
-2
lite/tests/kernels/mul_compute_test.cc
lite/tests/kernels/mul_compute_test.cc
+1
-1
lite/tests/kernels/multiclass_nms_compute_test.cc
lite/tests/kernels/multiclass_nms_compute_test.cc
+1
-1
lite/tests/kernels/pool_compute_test.cc
lite/tests/kernels/pool_compute_test.cc
+1
-1
lite/tests/kernels/reshape_compute_test.cc
lite/tests/kernels/reshape_compute_test.cc
+1
-1
lite/tests/kernels/scale_compute_test.cc
lite/tests/kernels/scale_compute_test.cc
+1
-1
lite/tests/kernels/slice_compute_test.cc
lite/tests/kernels/slice_compute_test.cc
+1
-1
lite/tests/kernels/softmax_compute_test.cc
lite/tests/kernels/softmax_compute_test.cc
+1
-1
lite/tests/kernels/stack_compute_test.cc
lite/tests/kernels/stack_compute_test.cc
+1
-1
lite/tests/kernels/transpose_compute_test.cc
lite/tests/kernels/transpose_compute_test.cc
+1
-1
lite/tests/kernels/yolo_box_compute_test.cc
lite/tests/kernels/yolo_box_compute_test.cc
+1
-1
lite/tools/ci_build.sh
lite/tools/ci_build.sh
+1
-1
未找到文件。
lite/CMakeLists.txt
浏览文件 @
6064c2f4
...
...
@@ -53,6 +53,8 @@ if (WITH_TESTING)
lite_download_and_uncompress
(
${
LITE_MODEL_DIR
}
${
LITE_URL
}
"resnet50.tar.gz"
)
lite_download_and_uncompress
(
${
LITE_MODEL_DIR
}
${
LITE_URL
}
"inception_v4_simple.tar.gz"
)
lite_download_and_uncompress
(
${
LITE_MODEL_DIR
}
${
LITE_URL
}
"step_rnn.tar.gz"
)
lite_download_and_uncompress
(
${
LITE_MODEL_DIR
}
${
LITE_URL
}
"bert.tar.gz"
)
lite_download_and_uncompress
(
${
LITE_MODEL_DIR
}
${
LITE_URL
}
"ernie.tar.gz"
)
endif
()
endif
()
...
...
lite/tests/api/CMakeLists.txt
浏览文件 @
6064c2f4
...
...
@@ -3,14 +3,17 @@ if(LITE_WITH_XPU)
DEPS mir_passes lite_api_test_helper paddle_api_full paddle_api_light gflags utils
${
ops
}
${
host_kernels
}
${
x86_kernels
}
${
xpu_kernels
}
ARGS --model_dir=
${
LITE_MODEL_DIR
}
/resnet50
)
add_dependencies
(
test_resnet50_lite_xpu extern_lite_download_resnet50_tar_gz
)
lite_cc_test
(
test_ernie_lite_xpu SRCS test_ernie_lite_xpu.cc
DEPS mir_passes lite_api_test_helper paddle_api_full paddle_api_light gflags utils
${
ops
}
${
host_kernels
}
${
x86_kernels
}
${
xpu_kernels
}
ARGS --model_dir=
${
LITE_MODEL_DIR
}
/resnet50
)
ARGS --model_dir=
${
LITE_MODEL_DIR
}
/ernie
)
add_dependencies
(
test_ernie_lite_xpu extern_lite_download_ernie_tar_gz
)
lite_cc_test
(
test_bert_lite_xpu SRCS test_bert_lite_xpu.cc
DEPS mir_passes lite_api_test_helper paddle_api_full paddle_api_light gflags utils
${
ops
}
${
host_kernels
}
${
x86_kernels
}
${
xpu_kernels
}
ARGS --model_dir=
${
LITE_MODEL_DIR
}
/resnet50
)
ARGS --model_dir=
${
LITE_MODEL_DIR
}
/bert
)
add_dependencies
(
test_bert_lite_xpu extern_lite_download_bert_tar_gz
)
endif
()
if
(
LITE_WITH_RKNPU
)
...
...
lite/tests/api/test_bert_lite_xpu.cc
浏览文件 @
6064c2f4
...
...
@@ -93,7 +93,7 @@ TEST(Ernie, test_ernie_lite_xpu) {
for
(
size_t
i
=
0
;
i
<
results
.
size
();
++
i
)
{
for
(
size_t
j
=
0
;
j
<
results
[
i
].
size
();
++
j
)
{
EXPECT_NEAR
(
out
->
data
<
float
>
()[
j
+
(
out
->
shape
()[
1
]
*
i
)],
results
[
i
][
j
],
1
e-5
);
out
->
data
<
float
>
()[
j
+
(
out
->
shape
()[
1
]
*
i
)],
results
[
i
][
j
],
3
e-5
);
}
}
}
...
...
lite/tests/api/test_ernie_lite_xpu.cc
浏览文件 @
6064c2f4
...
...
@@ -93,7 +93,7 @@ TEST(Ernie, test_ernie_lite_xpu) {
for
(
size_t
i
=
0
;
i
<
results
.
size
();
++
i
)
{
for
(
size_t
j
=
0
;
j
<
results
[
i
].
size
();
++
j
)
{
EXPECT_NEAR
(
out
->
data
<
float
>
()[
j
+
(
out
->
shape
()[
1
]
*
i
)],
results
[
i
][
j
],
1
e-5
);
out
->
data
<
float
>
()[
j
+
(
out
->
shape
()[
1
]
*
i
)],
results
[
i
][
j
],
2
e-5
);
}
}
}
...
...
lite/tests/kernels/activation_compute_test.cc
浏览文件 @
6064c2f4
...
...
@@ -300,7 +300,7 @@ TEST(Activation_relu, precision) {
abs_error
=
1e-2
;
// Using fp16 in NPU
#elif defined(LITE_WITH_ARM)
place
=
TARGET
(
kARM
);
#elif defined(LITE_WITH_XPU)
#elif defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#else
return
;
...
...
@@ -426,7 +426,7 @@ TEST(Activation_tanh, precision) {
abs_error
=
1e-2
;
// Using fp16 in NPU
#elif defined(LITE_WITH_ARM)
place
=
TARGET
(
kARM
);
#elif defined(LITE_WITH_XPU)
#elif defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#else
return
;
...
...
@@ -572,7 +572,7 @@ TEST(Activation_gelu, precision) {
LOG
(
INFO
)
<<
"test gelu op"
;
Place
place
;
float
abs_error
=
2e-5
;
#if defined(LITE_WITH_XPU)
#if defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#else
return
;
...
...
lite/tests/kernels/batch_norm_compute_test.cc
浏览文件 @
6064c2f4
...
...
@@ -157,7 +157,7 @@ TEST(BatchNorm, precision) {
LOG
(
INFO
)
<<
"test BatchNorm op"
;
float
abs_error
=
2e-5
;
Place
place
;
#if defined(LITE_WITH_XPU)
#if defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#elif defined(LITE_WITH_NPU)
place
=
TARGET
(
kNPU
);
...
...
lite/tests/kernels/cast_compute_test.cc
浏览文件 @
6064c2f4
...
...
@@ -135,7 +135,7 @@ TEST(Cast, precision) {
float
abs_error
=
2e-5
;
#if defined(LITE_WITH_ARM)
place
=
TARGET
(
kARM
);
#elif defined(LITE_WITH_XPU)
#elif defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#else
return
;
...
...
lite/tests/kernels/dropout_compute_test.cc
浏览文件 @
6064c2f4
...
...
@@ -94,7 +94,7 @@ TEST(Dropout, precision) {
#if defined(LITE_WITH_NPU)
place
=
TARGET
(
kNPU
);
abs_error
=
1e-2
;
// Using fp16 in NPU
#elif defined(LITE_WITH_XPU)
#elif defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#else
return
;
...
...
lite/tests/kernels/elementwise_compute_test.cc
浏览文件 @
6064c2f4
...
...
@@ -228,7 +228,7 @@ TEST(Elementwise, precision) {
abs_error
=
1e-2
;
// use fp16 in npu
#elif defined(LITE_WITH_ARM)
place
=
TARGET
(
kARM
);
#elif defined(LITE_WITH_XPU)
#elif defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#else
return
;
...
...
lite/tests/kernels/gather_compute_test.cc
浏览文件 @
6064c2f4
...
...
@@ -98,7 +98,7 @@ TEST(Gather, precision) {
abs_error
=
1e-2
;
// use fp16 in npu
#elif defined(LITE_WITH_ARM)
place
=
TARGET
(
kARM
);
#elif defined(LITE_WITH_XPU)
#elif defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#else
return
;
...
...
lite/tests/kernels/layer_norm_compute_test.cc
浏览文件 @
6064c2f4
...
...
@@ -147,7 +147,7 @@ TEST(LayerNorm, precision) {
LOG
(
INFO
)
<<
"test layer_norm op"
;
float
abs_error
=
2e-5
;
Place
place
;
#if defined(LITE_WITH_XPU)
#if defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#elif defined(LITE_WITH_NPU)
place
=
TARGET
(
kNPU
);
...
...
lite/tests/kernels/lookup_table_compute_test.cc
浏览文件 @
6064c2f4
...
...
@@ -116,7 +116,7 @@ TEST(LookupTable, precision) {
abs_error
=
1e-2
;
#elif defined(LITE_WITH_ARM)
place
=
TARGET
(
kARM
);
#elif defined(LITE_WITH_XPU)
#elif defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#else
return
;
...
...
@@ -132,7 +132,8 @@ TEST(LookupTable, precision) {
std
::
vector
<
std
::
vector
<
int64_t
>>
{{
5
,
2
,
3
,
1
},
{
2
,
3
,
1
},
{
3
,
1
}})
{
for
(
auto
w_dims
:
std
::
vector
<
std
::
vector
<
int64_t
>>
{{
4
,
2
},
{
6
,
8
},
{
12
,
15
}})
{
#if defined(LITE_WITH_XPU) && defined(LITE_WITH_NPU)
#if (defined(LITE_WITH_XPU) && defined(LITE_WITH_XTCL)) || \
defined(LITE_WITH_NPU)
for
(
auto
padding_idx
:
std
::
vector
<
int64_t
>
{
-
1
})
{
// Only -1 is supported by XPU or NPU
#else
...
...
lite/tests/kernels/matmul_compute_test.cc
浏览文件 @
6064c2f4
...
...
@@ -457,7 +457,7 @@ TEST(Matmul2x2, precision) {
abs_error
=
1e-2
;
// use fp16 in npu
#elif defined(LITE_WITH_ARM)
place
=
TARGET
(
kARM
);
#elif defined(LITE_WITH_XPU)
#elif defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#else
return
;
...
...
@@ -489,7 +489,7 @@ TEST(Matmul2x2_y_transpose, precision) {
abs_error
=
1e-2
;
// use fp16 in npu
#elif defined(LITE_WITH_ARM)
place
=
TARGET
(
kARM
);
#elif defined(LITE_WITH_XPU)
#elif defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#else
return
;
...
...
lite/tests/kernels/mul_compute_test.cc
浏览文件 @
6064c2f4
...
...
@@ -127,7 +127,7 @@ TEST(Mul, precision) {
#if defined(LITE_WITH_NPU)
place
=
TARGET
(
kNPU
);
abs_error
=
1e-2
;
// use fp16 in npu
#elif defined(LITE_WITH_XPU)
#elif defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#else
return
;
...
...
lite/tests/kernels/multiclass_nms_compute_test.cc
浏览文件 @
6064c2f4
...
...
@@ -478,7 +478,7 @@ TEST(multiclass_nms, precision) {
Place
place
;
#if defined(LITE_WITH_ARM)
place
=
TARGET
(
kHost
);
#elif defined(LITE_WITH_XPU)
#elif defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#else
return
;
...
...
lite/tests/kernels/pool_compute_test.cc
浏览文件 @
6064c2f4
...
...
@@ -381,7 +381,7 @@ TEST(Pool, precision) {
#if defined(LITE_WITH_NPU)
place
=
TARGET
(
kNPU
);
abs_error
=
1e-2
;
// Using fp16 in NPU
#elif defined(LITE_WITH_XPU)
#elif defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#else
return
;
...
...
lite/tests/kernels/reshape_compute_test.cc
浏览文件 @
6064c2f4
...
...
@@ -206,7 +206,7 @@ TEST(Reshape, precision) {
abs_error
=
1e-2
;
// Using fp16 in NPU
#elif defined(LITE_WITH_ARM)
place
=
TARGET
(
kHost
);
#elif defined(LITE_WITH_XPU)
#elif defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#else
return
;
...
...
lite/tests/kernels/scale_compute_test.cc
浏览文件 @
6064c2f4
...
...
@@ -165,7 +165,7 @@ TEST(Scale, precision) {
abs_error
=
4e-3
;
// Using fp16 in NPU
#elif defined(LITE_WITH_ARM)
place
=
TARGET
(
kARM
);
#elif defined(LITE_WITH_XPU)
#elif defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
abs_error
=
3e-4
;
// Some operations use fp16 in XPU
#elif defined(LITE_WITH_X86)
...
...
lite/tests/kernels/slice_compute_test.cc
浏览文件 @
6064c2f4
...
...
@@ -273,7 +273,7 @@ TEST(Slice, precision) {
test_slice
(
place
);
test_slice_tensor
(
place
);
test_slice_tensor_list
(
place
);
#elif defined(LITE_WITH_XPU)
#elif defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
Place
place
(
TARGET
(
kXPU
));
test_slice
(
place
);
#endif
...
...
lite/tests/kernels/softmax_compute_test.cc
浏览文件 @
6064c2f4
...
...
@@ -103,7 +103,7 @@ TEST(Softmax, precision) {
#if defined(LITE_WITH_NPU)
place
=
TARGET
(
kNPU
);
abs_error
=
4e-3
;
// Using fp16 in NPU
#elif defined(LITE_WITH_XPU)
#elif defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#else
return
;
...
...
lite/tests/kernels/stack_compute_test.cc
浏览文件 @
6064c2f4
...
...
@@ -106,7 +106,7 @@ TEST(Stack, precision) {
Place
place
;
#ifdef LITE_WITH_ARM
place
=
TARGET
(
kARM
);
#elif defined(LITE_WITH_XPU)
#elif defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#else
return
;
...
...
lite/tests/kernels/transpose_compute_test.cc
浏览文件 @
6064c2f4
...
...
@@ -164,7 +164,7 @@ TEST(Transpose, precision) {
LOG
(
INFO
)
<<
"test Transpose op"
;
float
abs_error
=
2e-5
;
Place
place
;
#if
def LITE_WITH_XPU
#if
defined(LITE_WITH_XPU) && defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#elif defined(LITE_WITH_NPU)
place
=
TARGET
(
kNPU
);
...
...
lite/tests/kernels/yolo_box_compute_test.cc
浏览文件 @
6064c2f4
...
...
@@ -247,7 +247,7 @@ TEST(YoloBox, precision) {
Place
place
;
#if defined(LITE_WITH_ARM)
place
=
TARGET
(
kARM
);
#elif defined(LITE_WITH_XPU)
#elif defined(LITE_WITH_XPU)
&& defined(LITE_WITH_XTCL)
place
=
TARGET
(
kXPU
);
#else
return
;
...
...
lite/tools/ci_build.sh
浏览文件 @
6064c2f4
...
...
@@ -353,7 +353,7 @@ function cmake_xpu {
-DWITH_MKL
=
ON
\
-DLITE_BUILD_EXTRA
=
ON
\
-DLITE_WITH_XPU
=
ON
\
-DXPU_SDK_ROOT
=
"
$(
pwd
)
/../../XPU_SDK
"
-DXPU_SDK_ROOT
=
"
/opt/output
"
}
function
build_xpu
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录