Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
1779e99f
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看板
未验证
提交
1779e99f
编写于
12月 09, 2020
作者:
L
LoveAn
提交者:
GitHub
12月 09, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add accuary test and optimize match relu of op name (#29486)
上级
966aa0e3
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
34 addition
and
8 deletion
+34
-8
tools/check_op_benchmark_result.py
tools/check_op_benchmark_result.py
+8
-2
tools/test_op_benchmark.sh
tools/test_op_benchmark.sh
+26
-6
未找到文件。
tools/check_op_benchmark_result.py
浏览文件 @
1779e99f
...
@@ -89,8 +89,14 @@ def compare_benchmark_result(develop_result, pr_result):
...
@@ -89,8 +89,14 @@ def compare_benchmark_result(develop_result, pr_result):
for
line
in
pr_result
.
get
(
"parameters"
).
strip
().
split
(
"
\n
"
):
for
line
in
pr_result
.
get
(
"parameters"
).
strip
().
split
(
"
\n
"
):
logging
.
info
(
"
\t
%s"
%
line
)
logging
.
info
(
"
\t
%s"
%
line
)
else
:
else
:
# TODO(Avin0323): Accuracy need to add.
if
not
pr_result
.
get
(
"consistent"
):
pass
status
=
False
logging
.
info
(
"------ OP: %s ------"
%
pr_result
.
get
(
"name"
))
logging
.
info
(
"Accaury diff: %s"
%
pr_result
.
get
(
"diff"
))
logging
.
info
(
"backward: %s"
%
pr_result
.
get
(
"backward"
))
logging
.
info
(
"parameters:"
)
for
line
in
pr_result
.
get
(
"parameters"
).
strip
().
split
(
"
\n
"
):
logging
.
info
(
"
\t
%s"
%
line
)
return
status
return
status
...
...
tools/test_op_benchmark.sh
浏览文件 @
1779e99f
...
@@ -31,6 +31,17 @@ function LOG {
...
@@ -31,6 +31,17 @@ function LOG {
echo
"[
$0
:
${
BASH_LINENO
[0]
}
]
$*
"
>
&2
echo
"[
$0
:
${
BASH_LINENO
[0]
}
]
$*
"
>
&2
}
}
# Limit cu file directory
function
match_cu_file_directory
{
local
sub_dir cu_file_dir
cu_file_dir
=
$(
dirname
${
1
}
)
for
sub_dir
in
""
"/elementwise"
"/reduce_ops"
do
[
"
${
cu_file_dir
}
"
==
"paddle/fluid/operators
${
sub_dir
}
"
]
&&
return
0
done
return
1
}
# Load op files by header file
# Load op files by header file
function
load_CHANGE_OP_FILES_by_header_file
{
function
load_CHANGE_OP_FILES_by_header_file
{
local
change_file
local
change_file
...
@@ -38,6 +49,8 @@ function load_CHANGE_OP_FILES_by_header_file {
...
@@ -38,6 +49,8 @@ function load_CHANGE_OP_FILES_by_header_file {
do
do
if
[[
"
$change_file
"
=
~
"_op.cu"
]]
if
[[
"
$change_file
"
=
~
"_op.cu"
]]
then
then
# match cu file directory limit
match_cu_file_directory
$change_file
||
continue
LOG
"[INFO] Found
\"
${
1
}
\"
include by
\"
${
change_file
}
\"
."
LOG
"[INFO] Found
\"
${
1
}
\"
include by
\"
${
change_file
}
\"
."
CHANGE_OP_FILES[
${#
CHANGE_OP_FILES
[@]
}
]=
"
$change_file
"
CHANGE_OP_FILES[
${#
CHANGE_OP_FILES
[@]
}
]=
"
$change_file
"
elif
[[
"
$change_file
"
=
~
".h"
]]
elif
[[
"
$change_file
"
=
~
".h"
]]
...
@@ -50,14 +63,16 @@ function load_CHANGE_OP_FILES_by_header_file {
...
@@ -50,14 +63,16 @@ function load_CHANGE_OP_FILES_by_header_file {
# Load op files that PR changes
# Load op files that PR changes
function
load_CHANGE_OP_FILES
{
function
load_CHANGE_OP_FILES
{
local
change_file
local
sub_dir
change_file
for
change_file
in
$(
git diff
--name-
only
origin/develop
)
for
change_file
in
$(
git diff
--name-
status
origin/develop |
grep
"^M"
|
awk
'{print $2}'
)
do
do
# match directory limit
# match directory limit
[[
"
$change_file
"
=
~
"paddle/fluid/operators/"
]]
||
continue
[[
"
$change_file
"
=
~
"paddle/fluid/operators/"
]]
||
continue
# match file name limit
# match file name limit
if
[[
"
$change_file
"
=
~
"_op.cu"
]]
if
[[
"
$change_file
"
=
~
"_op.cu"
]]
then
then
# match cu file directory limit
match_cu_file_directory
$change_file
||
continue
LOG
"[INFO] Found
\"
${
change_file
}
\"
changed."
LOG
"[INFO] Found
\"
${
change_file
}
\"
changed."
CHANGE_OP_FILES[
${#
CHANGE_OP_FILES
[@]
}
]=
"
$change_file
"
CHANGE_OP_FILES[
${#
CHANGE_OP_FILES
[@]
}
]=
"
$change_file
"
elif
[[
"
$change_file
"
=
~
".h"
]]
elif
[[
"
$change_file
"
=
~
".h"
]]
...
@@ -97,9 +112,12 @@ function load_CHANGE_OP_MAP {
...
@@ -97,9 +112,12 @@ function load_CHANGE_OP_MAP {
CHANGE_OP_MAP[
${
op_name
}
]=
"
$change_file
"
CHANGE_OP_MAP[
${
op_name
}
]=
"
$change_file
"
done
done
else
else
change_file_name
=
${
change_file_name
##*/
}
op_name
=
${
change_file_name
##*/
}
LOG
"[INFO] Load op:
\"
${
change_file_name
%_op*
}
\"
."
op_name
=
${
op_name
%_cudnn_op*
}
CHANGE_OP_MAP[
${
change_file_name
%_op*
}
]=
"
$change_file
"
op_name
=
${
op_name
%_op*
}
[
-n
"
${
SKIP_OP_MAP
[
$op_name
]
}
"
]
&&
continue
LOG
"[INFO] Load op:
\"
${
op_name
}
\"
."
CHANGE_OP_MAP[
${
op_name
}
]=
"
$change_file
"
fi
fi
done
done
}
}
...
@@ -160,6 +178,8 @@ function run_op_benchmark_test {
...
@@ -160,6 +178,8 @@ function run_op_benchmark_test {
do
do
echo
"
$api_info
"
>>
$api_info_file
echo
"
$api_info
"
>>
$api_info_file
done
done
# install tensorflow for testing accuary
pip
install
tensorflow
==
2.3.0 tensorflow-probability
for
branch_name
in
"develop"
"test_pr"
for
branch_name
in
"develop"
"test_pr"
do
do
git checkout
$branch_name
git checkout
$branch_name
...
@@ -174,7 +194,7 @@ function run_op_benchmark_test {
...
@@ -174,7 +194,7 @@ function run_op_benchmark_test {
$logs_dir
\
$logs_dir
\
$VISIBLE_DEVICES
\
$VISIBLE_DEVICES
\
"gpu"
\
"gpu"
\
"
speed
"
\
"
both
"
\
$api_info_file
\
$api_info_file
\
"paddle"
"paddle"
popd
>
/dev/null
popd
>
/dev/null
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录