Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
87dbc768
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
87dbc768
编写于
6月 16, 2019
作者:
C
Chunwei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make lite CI compile faster
上级
56e21116
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
40 addition
and
25 deletion
+40
-25
.gitlab-ci.yml
.gitlab-ci.yml
+6
-3
paddle/fluid/lite/CMakeLists.txt
paddle/fluid/lite/CMakeLists.txt
+9
-1
paddle/fluid/lite/gen_code/CMakeLists.txt
paddle/fluid/lite/gen_code/CMakeLists.txt
+6
-6
paddle/fluid/lite/kernels/arm/split_compute_test.cc
paddle/fluid/lite/kernels/arm/split_compute_test.cc
+1
-0
paddle/fluid/lite/tools/build.sh
paddle/fluid/lite/tools/build.sh
+18
-15
未找到文件。
.gitlab-ci.yml
浏览文件 @
87dbc768
before_script
:
before_script
:
-
env
-
env
-
export CI_USER_DIR=$(pwd)
image
:
$SERVER_LITE_DOCKER_IMAGE
image
:
$SERVER_LITE_DOCKER_IMAGE
...
@@ -14,6 +15,8 @@ check:prebuilt:
...
@@ -14,6 +15,8 @@ check:prebuilt:
stage
:
ci
stage
:
ci
script
:
script
:
-
rm -rf ~/.pip
-
rm -rf ~/.pip
-
export http_proxy=$CI_PROXY
-
export https_proxy=$CI_PROXY
-
pip install pre-commit
-
pip install pre-commit
-
pre-commit install
-
pre-commit install
...
@@ -27,7 +30,7 @@ check:prebuilt:
...
@@ -27,7 +30,7 @@ check:prebuilt:
cache
:
cache
:
key
:
check_style
key
:
check_style
paths
:
paths
:
-
/root
/.cache
-
$CI_USER_DIR
/.cache
build:server:
build:server:
tags
:
tags
:
...
@@ -38,7 +41,7 @@ build:server:
...
@@ -38,7 +41,7 @@ build:server:
key
:
server_thirdparty
key
:
server_thirdparty
paths
:
paths
:
-
build/third_party
-
build/third_party
-
/root
/.ccache
-
~
/.ccache
script
:
script
:
-
apt install ccache
-
apt install ccache
-
export http_proxy=$CI_PROXY
-
export http_proxy=$CI_PROXY
...
@@ -73,7 +76,7 @@ build:mobile:
...
@@ -73,7 +76,7 @@ build:mobile:
paths
:
paths
:
-
$MOBILE_LITE_CACHE0
-
$MOBILE_LITE_CACHE0
-
$MOBILE_LITE_CACHE1
-
$MOBILE_LITE_CACHE1
-
/root
/.ccache
-
~
/.ccache
script
:
script
:
-
apt install ccache
-
apt install ccache
-
export http_proxy=$CI_PROXY
-
export http_proxy=$CI_PROXY
...
...
paddle/fluid/lite/CMakeLists.txt
浏览文件 @
87dbc768
...
@@ -80,6 +80,9 @@ function (lite_deps TARGET)
...
@@ -80,6 +80,9 @@ function (lite_deps TARGET)
endfunction
()
endfunction
()
# A fake target to include all the libraries and tests the lite module depends.
add_custom_target
(
lite_compile_deps COMMAND echo 1
)
# Add names for lite libraries for latter compile. We use this name list to avoid compiling
# Add names for lite libraries for latter compile. We use this name list to avoid compiling
# the whole fluid project to accelerate the compile speed.
# the whole fluid project to accelerate the compile speed.
set
(
offline_lib_registry_file
"
${
CMAKE_BINARY_DIR
}
/lite_libs.txt"
)
set
(
offline_lib_registry_file
"
${
CMAKE_BINARY_DIR
}
/lite_libs.txt"
)
...
@@ -112,6 +115,9 @@ function(lite_cc_library TARGET)
...
@@ -112,6 +115,9 @@ function(lite_cc_library TARGET)
cc_library
(
${
TARGET
}
SRCS
${
args_SRCS
}
DEPS
${
deps
}
${
args_DEPS
}
)
cc_library
(
${
TARGET
}
SRCS
${
args_SRCS
}
DEPS
${
deps
}
${
args_DEPS
}
)
# collect targets need to compile for lite
add_dependencies
(
lite_compile_deps
${
TARGET
}
)
# register a library name.
# register a library name.
file
(
APPEND
${
offline_lib_registry_file
}
"
${
TARGET
}
\n
"
)
file
(
APPEND
${
offline_lib_registry_file
}
"
${
TARGET
}
\n
"
)
endfunction
()
endfunction
()
...
@@ -160,6 +166,9 @@ function(lite_cc_test TARGET)
...
@@ -160,6 +166,9 @@ function(lite_cc_test TARGET)
)
)
_lite_cc_test
(
${
TARGET
}
SRCS
${
args_SRCS
}
DEPS
${
deps
}
ARGS
${
args_ARGS
}
)
_lite_cc_test
(
${
TARGET
}
SRCS
${
args_SRCS
}
DEPS
${
deps
}
ARGS
${
args_ARGS
}
)
file
(
APPEND
${
offline_test_registry_file
}
"
${
TARGET
}
\n
"
)
file
(
APPEND
${
offline_test_registry_file
}
"
${
TARGET
}
\n
"
)
# collect targets need to compile for lite
add_dependencies
(
lite_compile_deps
${
TARGET
}
)
endfunction
()
endfunction
()
add_subdirectory
(
operators
)
add_subdirectory
(
operators
)
...
@@ -173,4 +182,3 @@ add_subdirectory(model_parser)
...
@@ -173,4 +182,3 @@ add_subdirectory(model_parser)
add_subdirectory
(
utils
)
add_subdirectory
(
utils
)
add_subdirectory
(
api
)
add_subdirectory
(
api
)
add_subdirectory
(
gen_code
)
add_subdirectory
(
gen_code
)
paddle/fluid/lite/gen_code/CMakeLists.txt
浏览文件 @
87dbc768
...
@@ -18,11 +18,11 @@ if (NOT LITE_WITH_LIGHT_WEIGHT_FRAMEWORK)
...
@@ -18,11 +18,11 @@ if (NOT LITE_WITH_LIGHT_WEIGHT_FRAMEWORK)
DEPS scope_lite op_lite kernel_lite paddle_infer_gencode
DEPS scope_lite op_lite kernel_lite paddle_infer_gencode
)
)
#
lite_cc_test(test_generated_code SRCS generated_code_test.cc DEPS __generated_code__
lite_cc_test
(
test_generated_code SRCS generated_code_test.cc DEPS __generated_code__
#
${ops_lite} ${host_kernels}
${
ops_lite
}
${
host_kernels
}
#
X86_DEPS ${x86_kernels}
X86_DEPS
${
x86_kernels
}
#
)
)
# add_dependencies(__generated_code__ test_gen_code_lite)
add_dependencies
(
__generated_code__ test_gen_code_lite
)
add_dependencies
(
__generated_code__ extern_lite_download_lite_naive_model_tar_gz
)
endif
()
endif
()
paddle/fluid/lite/kernels/arm/split_compute_test.cc
浏览文件 @
87dbc768
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include "paddle/fluid/lite/kernels/arm/split_compute.h"
#include "paddle/fluid/lite/kernels/arm/split_compute.h"
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include <cstring>
#include <limits>
#include <limits>
#include <vector>
#include <vector>
#include "paddle/fluid/lite/core/op_registry.h"
#include "paddle/fluid/lite/core/op_registry.h"
...
...
paddle/fluid/lite/tools/build.sh
浏览文件 @
87dbc768
...
@@ -6,6 +6,8 @@ LIBS_FILE="./lite_libs.txt"
...
@@ -6,6 +6,8 @@ LIBS_FILE="./lite_libs.txt"
readonly
common_flags
=
"-DWITH_LITE=ON -DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=OFF -DWITH_PYTHON=OFF -DWITH_TESTING=ON -DLITE_WITH_ARM=OFF"
readonly
common_flags
=
"-DWITH_LITE=ON -DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=OFF -DWITH_PYTHON=OFF -DWITH_TESTING=ON -DLITE_WITH_ARM=OFF"
NUM_CORES_FOR_COMPILE
=
8
# for code gen, a source file is generated after a test, but is dependended by some targets in cmake.
# for code gen, a source file is generated after a test, but is dependended by some targets in cmake.
# here we fake an empty file to make cmake works.
# here we fake an empty file to make cmake works.
function
prepare_for_codegen
{
function
prepare_for_codegen
{
...
@@ -23,9 +25,17 @@ function cmake_x86 {
...
@@ -23,9 +25,17 @@ function cmake_x86 {
cmake ..
-DWITH_GPU
=
OFF
-DWITH_MKLDNN
=
OFF
-DLITE_WITH_X86
=
ON
${
common_flags
}
cmake ..
-DWITH_GPU
=
OFF
-DWITH_MKLDNN
=
OFF
-DLITE_WITH_X86
=
ON
${
common_flags
}
}
}
# This method is only called in CI.
function
cmake_x86_for_CI
{
function
cmake_x86_for_CI
{
prepare_for_codegen
prepare_for_codegen
# fake an empty __generated_code__.cc to pass cmake.
cmake ..
-DWITH_GPU
=
OFF
-DWITH_MKLDNN
=
OFF
-DLITE_WITH_X86
=
ON
${
common_flags
}
-DLITE_WITH_PROFILE
=
ON
cmake ..
-DWITH_GPU
=
OFF
-DWITH_MKLDNN
=
OFF
-DLITE_WITH_X86
=
ON
${
common_flags
}
-DLITE_WITH_PROFILE
=
ON
# Compile and execute the gen_code related test, so it will generate some code, and make the compilation reasonable.
make test_gen_code_lite
-j
$NUM_CORES_FOR_COMPILE
make test_cxx_api_lite
-j
$NUM_CORES_FOR_COMPILE
ctest
-R
test_cxx_api_lite
ctest
-R
test_gen_code_lite
make test_generated_code
-j
$NUM_CORES_FOR_COMPILE
}
}
function
cmake_gpu
{
function
cmake_gpu
{
...
@@ -61,14 +71,11 @@ function cmake_arm {
...
@@ -61,14 +71,11 @@ function cmake_arm {
function
build_single
{
function
build_single
{
#make $1 -j$(expr $(nproc) - 2)
#make $1 -j$(expr $(nproc) - 2)
make
$1
-j
8
make
$1
-j
$NUM_CORES_FOR_COMPILE
}
}
function
build
{
function
build
{
file
=
$1
make lite_compile_deps
-j
$NUM_CORES_FOR_COMPILE
for
_test
in
$(
cat
$file
)
;
do
build_single
$_test
done
}
}
# It will eagerly test all lite related unittests.
# It will eagerly test all lite related unittests.
...
@@ -77,10 +84,6 @@ function test_lite {
...
@@ -77,10 +84,6 @@ function test_lite {
echo
"file:
${
file
}
"
echo
"file:
${
file
}
"
for
_test
in
$(
cat
$file
)
;
do
for
_test
in
$(
cat
$file
)
;
do
# We move the build phase here to make the 'gen_code' test compiles after the
# corresponding test is executed and the C++ code generates.
#make $_test -j$(expr $(nproc) - 2)
make
$_test
-j8
ctest
-R
$_test
-V
ctest
-R
$_test
-V
done
done
}
}
...
@@ -91,10 +94,8 @@ function build_test_server {
...
@@ -91,10 +94,8 @@ function build_test_server {
cd
./build
cd
./build
export
LD_LIBRARY_PATH
=
"
$LD_LIBRARY_PATH
:/paddle/build/third_party/install/mklml/lib"
export
LD_LIBRARY_PATH
=
"
$LD_LIBRARY_PATH
:/paddle/build/third_party/install/mklml/lib"
cmake_x86_for_CI
cmake_x86_for_CI
# compile the tests and execute them.
build
test_lite
$TESTS_FILE
test_lite
$TESTS_FILE
# build the remaining libraries to check compiling error.
build
$LIBS_FILE
}
}
# test_arm_android <some_test_name> <adb_port_number>
# test_arm_android <some_test_name> <adb_port_number>
...
@@ -135,6 +136,8 @@ function build_test_arm {
...
@@ -135,6 +136,8 @@ function build_test_arm {
echo
-ne
'\n'
|
${
ANDROID_HOME
}
/emulator/emulator
-avd
paddle-armv7
-noaudio
-no-window
-gpu
off
-verbose
-port
${
port_armv7
}
&
echo
-ne
'\n'
|
${
ANDROID_HOME
}
/emulator/emulator
-avd
paddle-armv7
-noaudio
-no-window
-gpu
off
-verbose
-port
${
port_armv7
}
&
sleep
1m
sleep
1m
cur_dir
=
$(
pwd
)
for
os
in
"android"
"armlinux"
;
do
for
os
in
"android"
"armlinux"
;
do
for
abi
in
"arm64-v8a"
"armeabi-v7a"
"armeabi-v7a-hf"
;
do
for
abi
in
"arm64-v8a"
"armeabi-v7a"
"armeabi-v7a-hf"
;
do
# TODO(TJ): enable compile on v7-hf on andorid and all v7 on armlinux
# TODO(TJ): enable compile on v7-hf on andorid and all v7 on armlinux
...
@@ -148,9 +151,10 @@ function build_test_arm {
...
@@ -148,9 +151,10 @@ function build_test_arm {
continue
continue
fi
fi
build_dir
=
build.lite.
${
os
}
.
${
abi
}
build_dir
=
$cur_dir
/
build.lite.
${
os
}
.
${
abi
}
mkdir
-p
$build_dir
mkdir
-p
$build_dir
cd
$build_dir
cd
$build_dir
cmake_arm
${
os
}
${
abi
}
cmake_arm
${
os
}
${
abi
}
build
$TESTS_FILE
build
$TESTS_FILE
...
@@ -179,7 +183,6 @@ function build_test_arm {
...
@@ -179,7 +183,6 @@ function build_test_arm {
test_arm_android
$_test
$port
test_arm_android
$_test
$port
done
done
fi
fi
cd
-
done
done
done
done
adb devices |
grep
emulator |
cut
-f1
|
while
read
line
;
do
adb
-s
$line
emu
kill
;
done
adb devices |
grep
emulator |
cut
-f1
|
while
read
line
;
do
adb
-s
$line
emu
kill
;
done
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录