Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
576d6808
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
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看板
未验证
提交
576d6808
编写于
6月 04, 2020
作者:
Z
zhangchunle
提交者:
GitHub
6月 04, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
generate ci index (#24792)
上级
38442739
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
92 addition
and
15 deletion
+92
-15
paddle/scripts/paddle_build.sh
paddle/scripts/paddle_build.sh
+92
-15
未找到文件。
paddle/scripts/paddle_build.sh
浏览文件 @
576d6808
...
...
@@ -315,6 +315,32 @@ function build_base() {
make
install
-j
${
parallel_number
}
}
function
build_size
()
{
cat
<<
EOF
============================================
Calculate /paddle/build size and PR whl size
============================================
EOF
if
[
"
$1
"
==
"fluid_inference"
]
;
then
cd
${
PADDLE_ROOT
}
/build
cp
-r
fluid_inference_install_dir fluid_inference
tar
-czf
fluid_inference.tgz fluid_inference
buildSize
=
$(
du
-h
--max-depth
=
0
${
PADDLE_ROOT
}
/build/fluid_inference.tgz |awk
'{print $1}'
)
echo
"FLuid_Inference Size:
$buildSize
"
else
SYSTEM
=
`
uname
-s
`
if
[
"
$SYSTEM
"
==
"Darwin"
]
;
then
com
=
'du -h -d 0'
else
com
=
'du -h --max-depth=0'
fi
buildSize
=
$(
$com
${
PADDLE_ROOT
}
/build |awk
'{print $1}'
)
echo
"Build Size:
$buildSize
"
PR_whlSize
=
$(
$com
${
PADDLE_ROOT
}
/build/python/dist |awk
'{print $1}'
)
echo
"PR whl Size:
$PR_whlSize
"
fi
}
function
build
()
{
mkdir
-p
${
PADDLE_ROOT
}
/build
cd
${
PADDLE_ROOT
}
/build
...
...
@@ -324,6 +350,18 @@ function build() {
============================================
EOF
build_base
$@
current_branch
=
`
git branch |
grep
\*
|
cut
-d
' '
-f2
`
if
[
"
$current_branch
"
!=
"develop_base_pr"
]
;
then
build_size
fi
}
function
cmake_gen_and_build
()
{
startTime_s
=
`
date
+%s
`
cmake_gen
$1
build
$2
endTime_s
=
`
date
+%s
`
echo
"Build Time:
$[
$endTime_s
-
$startTime_s
]s"
}
function
build_mac
()
{
...
...
@@ -338,6 +376,15 @@ EOF
make clean
fi
make
install
-j
8
build_size
}
function
cmake_gen_and_build_mac
()
{
startTime_s
=
`
date
+%s
`
cmake_gen
$1
build_mac
endTime_s
=
`
date
+%s
`
echo
"Build Time:
$[
$endTime_s
-
$startTime_s
]s"
}
function
run_test
()
{
...
...
@@ -454,8 +501,10 @@ EOF
elif
[
"
$1
"
==
"cp37-cp37m"
]
;
then
pip3.7
install
--user
${
INSTALL_PREFIX
:-
/paddle/build
}
/opt/paddle/share/wheels/
*
.whl
fi
ut_startTime_s
=
`
date
+%s
`
ctest
--output-on-failure
-j
$2
ut_endTime_s
=
`
date
+%s
`
echo
"Mac testCase Time:
$[
$ut_endTime_s
-
$ut_startTime_s
]s"
paddle version
# Recovery proxy to avoid failure in later steps
export
http_proxy
=
$my_proxy
...
...
@@ -680,9 +729,25 @@ function caught_error() {
done
}
function
case_count
(){
cat
<<
EOF
============================================
Generating TestCases Count ...
============================================
EOF
testcases
=
$1
num
=
$(
echo
$testcases
|grep
-o
'\^'
|wc
-l
)
if
[
"
$2
"
==
""
]
;
then
echo
"exclusive TestCases count is
$num
"
else
echo
"
$2
card TestCases count is
$num
"
fi
}
function
card_test
()
{
set
-m
case_count
$1
$2
ut_startTime_s
=
`
date
+%s
`
# get the CUDA device count
CUDA_DEVICE_COUNT
=
$(
nvidia-smi
-L
|
wc
-l
)
...
...
@@ -730,6 +795,12 @@ function card_test() {
done
wait
;
# wait for all subshells to finish
ut_endTime_s
=
`
date
+%s
`
if
[
"
$2
"
==
""
]
;
then
echo
"exclusive TestCases Total Time:
$[
$ut_endTime_s
-
$ut_startTime_s
]s"
else
echo
"
$2
card TestCases Total Time:
$[
$ut_endTime_s
-
$ut_startTime_s
]s"
fi
set
+m
}
...
...
@@ -815,9 +886,12 @@ set -ex
}
function
parallel_test
()
{
ut_total_startTime_s
=
`
date
+%s
`
mkdir
-p
${
PADDLE_ROOT
}
/build
cd
${
PADDLE_ROOT
}
/build
parallel_test_base
ut_total_endTime_s
=
`
date
+%s
`
echo
"TestCases Total Time:
$[
$ut_total_endTime_s
-
$ut_total_startTime_s
]s"
}
function
enable_unused_var_check
()
{
...
...
@@ -1075,10 +1149,14 @@ EOF
if
[[
"
$1
"
!=
""
]]
;
then
parallel_number
=
$1
fi
startTime_s
=
`
date
+%s
`
cmake ..
-DWITH_DISTRIBUTE
=
OFF
-DON_INFER
=
ON
-DCUDA_ARCH_NAME
=
${
CUDA_ARCH_NAME
:-
Auto
}
make
-j
${
parallel_number
}
fluid_lib_dist
make
-j
${
parallel_number
}
inference_lib_dist
endTime_s
=
`
date
+%s
`
echo
"Build Time:
$[
$endTime_s
-
$startTime_s
]s"
build_size
"fluid_inference"
}
function
tar_fluid_lib
()
{
...
...
@@ -1100,10 +1178,13 @@ function test_fluid_lib() {
Testing fluid library for inference ...
========================================
EOF
fluid_startTime_s
=
`
date
+%s
`
cd
${
PADDLE_ROOT
}
/paddle/fluid/inference/api/demo_ci
./run.sh
${
PADDLE_ROOT
}
${
WITH_MKL
:-
ON
}
${
WITH_GPU
:-
OFF
}
${
INFERENCE_DEMO_INSTALL_DIR
}
\
${
TENSORRT_INCLUDE_DIR
:-
/usr/local/TensorRT/include
}
\
${
TENSORRT_LIB_DIR
:-
/usr/local/TensorRT/lib
}
fluid_endTime_s
=
`
date
+%s
`
echo
"test_fluid_lib Total Time:
$[
$fluid_endTime_s
-
$fluid_startTime_s
]s"
./clean.sh
}
...
...
@@ -1113,8 +1194,11 @@ function test_fluid_lib_train() {
Testing fluid library for training ...
========================================
EOF
fluid_train_startTime_s
=
`
date
+%s
`
cd
${
PADDLE_ROOT
}
/paddle/fluid/train/demo
./run.sh
${
PADDLE_ROOT
}
${
WITH_MKL
:-
ON
}
fluid_train_endTime_s
=
`
date
+%s
`
echo
"test_fluid_lib_train Total Time:
$[
$fluid_train_endTime_s
-
$fluid_train_startTime_s
]s"
./clean.sh
}
...
...
@@ -1134,21 +1218,18 @@ function example() {
fi
}
function
main
()
{
local
CMD
=
$1
local
parallel_number
=
$2
init
case
$CMD
in
build_only
)
cmake_gen
${
PYTHON_ABI
:-
""
}
build
${
parallel_number
}
cmake_gen_and_build
${
PYTHON_ABI
:-
""
}
${
parallel_number
}
;;
build_and_check
)
check_style
generate_upstream_develop_api_spec
${
PYTHON_ABI
:-
""
}
${
parallel_number
}
cmake_gen
${
PYTHON_ABI
:-
""
}
build
${
parallel_number
}
cmake_gen_and_build
${
PYTHON_ABI
:-
""
}
${
parallel_number
}
check_sequence_op_unittest
generate_api_spec
${
PYTHON_ABI
:-
""
}
"PR"
example
...
...
@@ -1204,8 +1285,7 @@ function main() {
;;
cicheck_coverage
)
check_approvals_of_unittest 1
cmake_gen
${
PYTHON_ABI
:-
""
}
build
${
parallel_number
}
cmake_gen_and_build
${
PYTHON_ABI
:-
""
}
${
parallel_number
}
enable_unused_var_check
parallel_test
check_coverage
...
...
@@ -1233,13 +1313,11 @@ function main() {
assert_api_spec_approvals
;;
maccheck
)
cmake_gen
${
PYTHON_ABI
:-
""
}
build_mac
cmake_gen_and_build_mac
${
PYTHON_ABI
:-
""
}
run_mac_test
${
PYTHON_ABI
:-
""
}
${
PROC_RUN
:-
1
}
;;
maccheck_py35
)
cmake_gen
${
PYTHON_ABI
:-
""
}
build_mac
cmake_gen_and_build_mac
${
PYTHON_ABI
:-
""
}
run_mac_test
${
PYTHON_ABI
:-
""
}
${
PROC_RUN
:-
1
}
check_change_of_unittest
${
PYTHON_ABI
:-
""
}
;;
...
...
@@ -1248,8 +1326,7 @@ function main() {
build_mac
;;
cicheck_py35
)
cmake_gen
${
PYTHON_ABI
:-
""
}
build
${
parallel_number
}
cmake_gen_and_build
${
PYTHON_ABI
:-
""
}
${
parallel_number
}
parallel_test
;;
cmake_gen
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录