Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
7a15e640
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
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看板
未验证
提交
7a15e640
编写于
11月 26, 2020
作者:
C
chalsliu
提交者:
GitHub
11月 26, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support precision test for new ut
上级
173c22ae
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
64 addition
and
2 deletion
+64
-2
paddle/scripts/paddle_build.sh
paddle/scripts/paddle_build.sh
+7
-0
tools/check_added_ut.sh
tools/check_added_ut.sh
+42
-0
tools/get_pr_ut.py
tools/get_pr_ut.py
+15
-2
未找到文件。
paddle/scripts/paddle_build.sh
浏览文件 @
7a15e640
...
...
@@ -294,6 +294,10 @@ function cmake_gen() {
cmake_base
$1
}
function
cmake_gen_in_current_dir
()
{
cmake_base
$1
}
function
abort
(){
echo
"Your change doesn't follow PaddlePaddle's code style."
1>&2
echo
"Please use pre-commit to check what is wrong."
1>&2
...
...
@@ -1777,6 +1781,9 @@ function main() {
cmake_gen
)
cmake_gen
${
PYTHON_ABI
:-
""
}
;;
cmake_gen_in_current_dir
)
cmake_gen_in_current_dir
${
PYTHON_ABI
:-
""
}
;;
gen_fluid_lib
)
gen_fluid_lib
${
parallel_number
}
;;
...
...
tools/check_added_ut.sh
0 → 100644
浏览文件 @
7a15e640
#!/bin/bash
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set
-e
if
[
-z
${
BRANCH
}
]
;
then
BRANCH
=
"develop"
fi
PADDLE_ROOT
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
/../"
&&
pwd
)
"
CURDIR
=
`
pwd
`
cd
$PADDLE_ROOT
cp
$PADDLE_ROOT
/paddle/scripts/paddle_build.sh
$PADDLE_ROOT
/paddle/scripts/paddle_build_pre.sh
CURBRANCH
=
`
git rev-parse
--abbrev-ref
HEAD
`
git checkout
-b
prec_added_ut upstream/
${
BRANCH
}
mkdir
prec_build
cd
prec_build
bash
$PADDLE_ROOT
/paddle/scripts/paddle_build_pre.sh cmake_gen_in_current_dir
>
prebuild.log 2>&1
ctest
-N
|
awk
-F
':'
'{print $2}'
|
sed
'/^$/d'
|
sed
'$d'
|
sed
's/ //g'
>
/
$PADDLE_ROOT
/br-ut
cd
$PADDLE_ROOT
/build
ctest
-N
|
awk
-F
':'
'{print $2}'
|
sed
'/^$/d'
|
sed
'$d'
|
sed
's/ //g'
>
/
$PADDLE_ROOT
/pr-ut
cd
/
$PADDLE_ROOT
grep
-F
-x
-v
-f
br-ut pr-ut
>
/
$PADDLE_ROOT
/added_ut
echo
"New-UT:"
cat
/
$PADDLE_ROOT
/added_ut
rm
-rf
prec_build
rm
/
$PADDLE_ROOT
/br-ut /
$PADDLE_ROOT
/pr-ut
$PADDLE_ROOT
/paddle/scripts/paddle_build_pre.sh
git checkout
$CURBRANCH
git branch
-D
prec_added_ut
cd
$CURDIR
tools/get_pr_ut.py
浏览文件 @
7a15e640
...
...
@@ -51,6 +51,7 @@ class PRChecker(object):
def
get_pr_ut
(
self
):
""" Get unit tests in pull request. """
check_added_ut
=
False
ut_list
=
[]
file_ut_map
=
None
cmd
=
'wget -q --no-check-certificate https://sys-p0.bj.bcebos.com/prec/file_ut.json'
...
...
@@ -58,10 +59,14 @@ class PRChecker(object):
with
open
(
'file_ut.json'
)
as
jsonfile
:
file_ut_map
=
json
.
load
(
jsonfile
)
for
f
in
self
.
get_pr_files
():
if
f
not
in
file_ut_map
:
return
''
if
f
.
endswith
(
'.h'
)
or
f
.
endswith
(
'.cu'
):
return
''
if
f
not
in
file_ut_map
:
if
f
.
find
(
'test_'
)
!=
-
1
or
f
.
find
(
'_test'
)
!=
-
1
:
check_added_ut
=
True
continue
else
:
return
''
else
:
ut_list
.
extend
(
file_ut_map
.
get
(
f
))
ut_list
=
list
(
set
(
ut_list
))
...
...
@@ -71,6 +76,14 @@ class PRChecker(object):
for
ut
in
delta
:
ut_list
.
append
(
ut
.
rstrip
(
'
\r\n
'
))
if
check_added_ut
:
cmd
=
'bash {}/tools/check_added_ut.sh'
.
format
(
PADDLE_ROOT
)
os
.
system
(
cmd
)
with
open
(
'{}/added_ut'
.
format
(
PADDLE_ROOT
))
as
utfile
:
for
ut
in
utfile
:
ut_list
.
append
(
ut
.
rstrip
(
'
\r\n
'
))
return
' '
.
join
(
ut_list
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录