Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
fef0a81c
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看板
未验证
提交
fef0a81c
编写于
11月 25, 2020
作者:
L
LoveAn
提交者:
GitHub
11月 25, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Set exit code in op benchmark ci, test=document_fix (#29045)
上级
40f54537
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
4 deletion
+16
-4
tools/check_op_benchmark_result.py
tools/check_op_benchmark_result.py
+12
-3
tools/test_op_benchmark.sh
tools/test_op_benchmark.sh
+4
-1
未找到文件。
tools/check_op_benchmark_result.py
浏览文件 @
fef0a81c
...
@@ -55,6 +55,7 @@ def load_benchmark_result_from_logs_dir(logs_dir):
...
@@ -55,6 +55,7 @@ def load_benchmark_result_from_logs_dir(logs_dir):
def
compare_benchmark_result
(
develop_result
,
pr_result
):
def
compare_benchmark_result
(
develop_result
,
pr_result
):
"""Compare the differences between devlop and pr.
"""Compare the differences between devlop and pr.
"""
"""
status
=
True
develop_speed
=
develop_result
.
get
(
"speed"
)
develop_speed
=
develop_result
.
get
(
"speed"
)
pr_speed
=
pr_result
.
get
(
"speed"
)
pr_speed
=
pr_result
.
get
(
"speed"
)
...
@@ -71,6 +72,9 @@ def compare_benchmark_result(develop_result, pr_result):
...
@@ -71,6 +72,9 @@ def compare_benchmark_result(develop_result, pr_result):
total_time_diff
=
(
total_time_diff
=
(
pr_total_time
-
develop_total_time
)
/
develop_total_time
pr_total_time
-
develop_total_time
)
/
develop_total_time
if
gpu_time_diff
>
0.05
:
status
=
False
# TODO(Avin0323): Print all info for making relu of alart.
# TODO(Avin0323): Print all info for making relu of alart.
logging
.
info
(
"------ OP: %s ------"
%
pr_result
.
get
(
"name"
))
logging
.
info
(
"------ OP: %s ------"
%
pr_result
.
get
(
"name"
))
logging
.
info
(
"GPU time change: %.5f%% (develop: %.7f -> PR: %.7f)"
%
logging
.
info
(
"GPU time change: %.5f%% (develop: %.7f -> PR: %.7f)"
%
...
@@ -85,7 +89,7 @@ def compare_benchmark_result(develop_result, pr_result):
...
@@ -85,7 +89,7 @@ def compare_benchmark_result(develop_result, pr_result):
# TODO(Avin0323): Accuracy need to add.
# TODO(Avin0323): Accuracy need to add.
pass
pass
return
True
return
status
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
@@ -93,7 +97,7 @@ if __name__ == "__main__":
...
@@ -93,7 +97,7 @@ if __name__ == "__main__":
"""
"""
logging
.
basicConfig
(
logging
.
basicConfig
(
level
=
logging
.
INFO
,
level
=
logging
.
INFO
,
format
=
"[%(
path
name)s:%(lineno)d] [%(levelname)s] %(message)s"
)
format
=
"[%(
file
name)s:%(lineno)d] [%(levelname)s] %(message)s"
)
parser
=
argparse
.
ArgumentParser
()
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
parser
.
add_argument
(
...
@@ -108,6 +112,8 @@ if __name__ == "__main__":
...
@@ -108,6 +112,8 @@ if __name__ == "__main__":
help
=
"Specify the benchmark result directory of PR branch."
)
help
=
"Specify the benchmark result directory of PR branch."
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
exit_code
=
0
develop_result_dict
=
load_benchmark_result_from_logs_dir
(
develop_result_dict
=
load_benchmark_result_from_logs_dir
(
args
.
develop_logs_dir
)
args
.
develop_logs_dir
)
...
@@ -117,4 +123,7 @@ if __name__ == "__main__":
...
@@ -117,4 +123,7 @@ if __name__ == "__main__":
pr_result
=
parse_log_file
(
os
.
path
.
join
(
args
.
pr_logs_dir
,
log_file
))
pr_result
=
parse_log_file
(
os
.
path
.
join
(
args
.
pr_logs_dir
,
log_file
))
if
develop_result
is
None
or
pr_result
is
None
:
if
develop_result
is
None
or
pr_result
is
None
:
continue
continue
compare_benchmark_result
(
develop_result
,
pr_result
)
if
not
compare_benchmark_result
(
develop_result
,
pr_result
):
exit_code
=
8
exit
(
exit_code
)
tools/test_op_benchmark.sh
浏览文件 @
fef0a81c
...
@@ -161,17 +161,20 @@ function run_op_benchmark_test {
...
@@ -161,17 +161,20 @@ function run_op_benchmark_test {
# diff benchmakr result and miss op
# diff benchmakr result and miss op
function
summary_problems
{
function
summary_problems
{
local
op_name
local
op_name
exit_code
python
${
PADDLE_ROOT
}
/tools/check_op_benchmark_result.py
\
python
${
PADDLE_ROOT
}
/tools/check_op_benchmark_result.py
\
--develop_logs_dir
$(
pwd
)
/logs-develop
\
--develop_logs_dir
$(
pwd
)
/logs-develop
\
--pr_logs_dir
$(
pwd
)
/logs-test_pr
--pr_logs_dir
$(
pwd
)
/logs-test_pr
exit_code
=
$?
for
op_name
in
${
!CHANGE_OP_MAP[@]
}
for
op_name
in
${
!CHANGE_OP_MAP[@]
}
do
do
if
[
-z
"
${
BENCHMARK_OP_MAP
[
$op_name
]
}
"
]
if
[
-z
"
${
BENCHMARK_OP_MAP
[
$op_name
]
}
"
]
then
then
exit_code
=
8
LOG
"[WARNING] Missing test script of
\"
${
op_name
}
\"
in benchmark."
LOG
"[WARNING] Missing test script of
\"
${
op_name
}
\"
in benchmark."
fi
fi
done
done
[
$exit_code
-ne
0
]
&&
exit
$exit_code
}
}
function
main
{
function
main
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录