Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
6d14659f
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看板
未验证
提交
6d14659f
编写于
1月 11, 2021
作者:
W
wuhuanzhou
提交者:
GitHub
1月 11, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
op benchmark ci auto retry (#30143)
上级
42a6442a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
68 addition
and
5 deletion
+68
-5
tools/check_op_benchmark_result.py
tools/check_op_benchmark_result.py
+32
-2
tools/test_op_benchmark.sh
tools/test_op_benchmark.sh
+36
-3
未找到文件。
tools/check_op_benchmark_result.py
浏览文件 @
6d14659f
...
...
@@ -121,7 +121,29 @@ def compare_benchmark_result(case_name, develop_result, pr_result,
check_results
[
"accuracy"
].
append
(
case_name
)
def
summary_results
(
check_results
):
def
update_api_info_file
(
fail_case_list
,
api_info_file
):
"""Update api info file to auto retry benchmark test.
"""
check_path_exists
(
api_info_file
)
# set of case names for performance check failures
fail_case_set
=
set
(
map
(
lambda
x
:
x
.
split
(
'_'
)[
0
],
fail_case_list
))
# list of api infos for performance check failures
api_info_list
=
list
()
with
open
(
api_info_file
)
as
f
:
for
line
in
f
:
case
=
line
.
split
(
','
)[
0
]
if
case
in
fail_case_set
:
api_info_list
.
append
(
line
)
# update api info file
with
open
(
api_info_file
,
'w'
)
as
f
:
for
api_info_line
in
api_info_list
:
f
.
write
(
api_info_line
)
def
summary_results
(
check_results
,
api_info_file
):
"""Summary results and return exit code.
"""
for
case_name
in
check_results
[
"speed"
]:
...
...
@@ -131,6 +153,9 @@ def summary_results(check_results):
logging
.
error
(
"Check accuracy result with case
\"
%s
\"
failed."
%
case_name
)
if
len
(
check_results
[
"speed"
])
and
api_info_file
:
update_api_info_file
(
check_results
[
"speed"
],
api_info_file
)
if
len
(
check_results
[
"speed"
])
or
len
(
check_results
[
"accuracy"
]):
return
8
else
:
...
...
@@ -155,6 +180,11 @@ if __name__ == "__main__":
type
=
str
,
required
=
True
,
help
=
"Specify the benchmark result directory of PR branch."
)
parser
.
add_argument
(
"--api_info_file"
,
type
=
str
,
required
=
False
,
help
=
"Specify the api info to run benchmark test."
)
args
=
parser
.
parse_args
()
check_results
=
dict
(
accuracy
=
list
(),
speed
=
list
())
...
...
@@ -172,4 +202,4 @@ if __name__ == "__main__":
compare_benchmark_result
(
case_name
,
develop_result
,
pr_result
,
check_results
)
exit
(
summary_results
(
check_results
))
exit
(
summary_results
(
check_results
,
args
.
api_info_file
))
tools/test_op_benchmark.sh
浏览文件 @
6d14659f
...
...
@@ -208,15 +208,48 @@ function run_op_benchmark_test {
done
}
# check benchmark result
function
check_op_benchmark_result
{
local
api_info_file check_status_code
# default 3 times
[
-z
"
${
RETRY_TIMES
}
"
]
&&
RETRY_TIMES
=
3
api_info_file
=
$(
pwd
)
/api_info.txt
for
retry_time
in
$(
seq
0
${
RETRY_TIMES
}
)
do
if
[
$retry_time
-gt
0
]
;
then
# run op benchmark speed test
# there is no need to recompile and install paddle
LOG
"[INFO] retry
${
retry_time
}
times ..."
pushd
benchmark/api
>
/dev/null
bash deploy/main_control.sh tests_v2
\
tests_v2/configs
\
$(
pwd
)
/logs-test_pr
\
$VISIBLE_DEVICES
\
"gpu"
\
"speed"
\
${
api_info_file
}
\
"paddle"
popd
>
/dev/null
fi
# check current result and update the file to benchmark test
python
${
PADDLE_ROOT
}
/tools/check_op_benchmark_result.py
\
--develop_logs_dir
$(
pwd
)
/logs-develop
\
--pr_logs_dir
$(
pwd
)
/logs-test_pr
\
--api_info_file
${
api_info_file
}
check_status_code
=
$?
# TODO(Avin0323): retry only if the performance check fails
[
$check_status_code
-eq
0
]
&&
break
done
return
$check_status_code
}
# diff benchmakr result and miss op
function
summary_problems
{
local
op_name exit_code
exit_code
=
0
if
[
${#
BENCHMARK_OP_MAP
[*]
}
-ne
0
]
then
python
${
PADDLE_ROOT
}
/tools/check_op_benchmark_result.py
\
--develop_logs_dir
$(
pwd
)
/logs-develop
\
--pr_logs_dir
$(
pwd
)
/logs-test_pr
check_op_benchmark_result
exit_code
=
$?
fi
for
op_name
in
${
!CHANGE_OP_MAP[@]
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录