Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
7b6dbd83
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看板
未验证
提交
7b6dbd83
编写于
11月 26, 2020
作者:
L
LoveAn
提交者:
GitHub
11月 26, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix some problem and complete op map rule, test=document_fix (#29123)
上级
d0129fcd
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
23 addition
and
9 deletion
+23
-9
tools/test_op_benchmark.sh
tools/test_op_benchmark.sh
+23
-9
未找到文件。
tools/test_op_benchmark.sh
浏览文件 @
7b6dbd83
...
@@ -26,6 +26,9 @@ PADDLE_FILENAME_OP_MAP=(
...
@@ -26,6 +26,9 @@ PADDLE_FILENAME_OP_MAP=(
[
"activation_op.cu"
]=
"leaky_relu elu sqrt square pow exp abs log"
[
"activation_op.cu"
]=
"leaky_relu elu sqrt square pow exp abs log"
[
"activation_op.h"
]=
"relu leaky_relu elu sqrt square pow exp abs log"
[
"activation_op.h"
]=
"relu leaky_relu elu sqrt square pow exp abs log"
[
"activation_op.cc"
]=
"relu leaky_relu elu sqrt square pow exp abs log"
[
"activation_op.cc"
]=
"relu leaky_relu elu sqrt square pow exp abs log"
[
"interpolate_op.h"
]=
"bilinear_interp nearest_interp trilinear_interp bicubic_interp linear_interp"
[
"interpolate_op.cc"
]=
"bilinear_interp nearest_interp trilinear_interp bicubic_interp linear_interp"
[
"interpolate_op.cu"
]=
"bilinear_interp nearest_interp trilinear_interp bicubic_interp linear_interp"
)
)
# Benchmark repo name -> op name
# Benchmark repo name -> op name
...
@@ -33,6 +36,14 @@ declare -A BENCHMARK_APINAME_OP_MAP
...
@@ -33,6 +36,14 @@ declare -A BENCHMARK_APINAME_OP_MAP
BENCHMARK_APINAME_OP_MAP
=(
BENCHMARK_APINAME_OP_MAP
=(
[
"argmin"
]=
"arg_min"
[
"argmin"
]=
"arg_min"
[
"argmax"
]=
"arg_max"
[
"argmax"
]=
"arg_max"
[
"cos_sim"
]=
"cosine_similarity"
[
"elementwise_max"
]=
"maximum"
[
"elementwise_min"
]=
"minimum"
[
"bilinear_interp"
]=
"interp_bilinear"
[
"nearest_interp"
]=
"interp_nearest"
[
"trilinear_interp"
]=
"interp_trilinear"
[
"bicubic_interp"
]=
"interp_bicubic"
[
"linear_interp"
]=
"interp_linear"
)
)
# ops that will run benchmark test
# ops that will run benchmark test
...
@@ -55,6 +66,8 @@ function load_CHANGE_OP_MAP {
...
@@ -55,6 +66,8 @@ function load_CHANGE_OP_MAP {
do
do
# match directory limit
# match directory limit
[[
"
$change_file
"
=
~
"paddle/fluid/operators/"
]]
||
continue
[[
"
$change_file
"
=
~
"paddle/fluid/operators/"
]]
||
continue
# match file name limit
[[
"
$change_file
"
=
~
"_op."
]]
||
continue
LOG
"[INFO] Found
\"
${
change_file
}
\"
changed."
LOG
"[INFO] Found
\"
${
change_file
}
\"
changed."
change_file_name
=
${
change_file
#*paddle/fluid/operators/
}
change_file_name
=
${
change_file
#*paddle/fluid/operators/
}
if
[
-n
"
${
PADDLE_FILENAME_OP_MAP
[
$change_file_name
]
}
"
]
if
[
-n
"
${
PADDLE_FILENAME_OP_MAP
[
$change_file_name
]
}
"
]
...
@@ -62,11 +75,12 @@ function load_CHANGE_OP_MAP {
...
@@ -62,11 +75,12 @@ function load_CHANGE_OP_MAP {
for
op_name
in
${
PADDLE_FILENAME_OP_MAP
[
$change_file_name
]
}
for
op_name
in
${
PADDLE_FILENAME_OP_MAP
[
$change_file_name
]
}
do
do
LOG
"[INFO] Load op:
\"
${
op_name
}
\"
."
LOG
"[INFO] Load op:
\"
${
op_name
}
\"
."
CHANGE_OP_MAP[
${
op_name
}
]=
"
dummy
"
CHANGE_OP_MAP[
${
op_name
}
]=
"
$change_file
"
done
done
else
else
change_file_name
=
${
change_file_name
##*/
}
LOG
"[INFO] Load op:
\"
${
change_file_name
%_op*
}
\"
."
LOG
"[INFO] Load op:
\"
${
change_file_name
%_op*
}
\"
."
CHANGE_OP_MAP[
${
change_file_name
%_op*
}
]=
"
dummy
"
CHANGE_OP_MAP[
${
change_file_name
%_op*
}
]=
"
$change_file
"
fi
fi
done
done
[
${#
CHANGE_OP_MAP
[*]
}
-eq
0
]
&&
LOG
"[INFO] No op to test, skip this ci."
&&
exit
0
[
${#
CHANGE_OP_MAP
[*]
}
-eq
0
]
&&
LOG
"[INFO] No op to test, skip this ci."
&&
exit
0
...
@@ -107,7 +121,7 @@ function load_BENCHMARK_OP_MAP {
...
@@ -107,7 +121,7 @@ function load_BENCHMARK_OP_MAP {
# compile and install paddlepaddle
# compile and install paddlepaddle
function
compile_install_paddlepaddle
{
function
compile_install_paddlepaddle
{
LOG
"[
DEBUG
] Compiling install package ..."
LOG
"[
INFO
] Compiling install package ..."
export
WITH_GPU
=
ON
export
WITH_GPU
=
ON
export
WITH_AVX
=
ON
export
WITH_AVX
=
ON
export
WITH_MKL
=
ON
export
WITH_MKL
=
ON
...
@@ -119,16 +133,17 @@ function compile_install_paddlepaddle {
...
@@ -119,16 +133,17 @@ function compile_install_paddlepaddle {
export
PYTHON_ABI
=
cp37-cp37m
export
PYTHON_ABI
=
cp37-cp37m
export
CMAKE_BUILD_TYPE
=
Release
export
CMAKE_BUILD_TYPE
=
Release
[
-d
build
]
&&
rm
-rf
build
[
-d
build
]
&&
rm
-rf
build
bash paddle/scripts/paddle_build.sh build
bash paddle/scripts/paddle_build.sh build
$(
nproc
)
[
$?
-ne
0
]
&&
LOG
"[FATAL] compile fail."
&&
exit
7
[
$?
-ne
0
]
&&
LOG
"[FATAL] compile fail."
&&
exit
7
LOG
"[
DEBUG
] Uninstall Paddle ..."
LOG
"[
INFO
] Uninstall Paddle ..."
pip uninstall
-y
paddlepaddle paddlepaddle_gpu
pip uninstall
-y
paddlepaddle paddlepaddle_gpu
LOG
"[
DEBUG
] Install Paddle ..."
LOG
"[
INFO
] Install Paddle ..."
pip
install
build/python/dist/paddlepaddle_gpu-0.0.0-cp37-cp37m-linux_x86_64.whl
pip
install
build/python/dist/paddlepaddle_gpu-0.0.0-cp37-cp37m-linux_x86_64.whl
}
}
# run op benchmark test
# run op benchmark test
function
run_op_benchmark_test
{
function
run_op_benchmark_test
{
[
${#
BENCHMARK_OP_MAP
[*]
}
-eq
0
]
&&
return
local
logs_dir op_name branch_name api_info_file
local
logs_dir op_name branch_name api_info_file
api_info_file
=
"
$(
pwd
)
/api_info.txt"
api_info_file
=
"
$(
pwd
)
/api_info.txt"
[
-f
"
$api_info_file
"
]
&&
rm
-f
$api_info_file
[
-f
"
$api_info_file
"
]
&&
rm
-f
$api_info_file
...
@@ -136,11 +151,10 @@ function run_op_benchmark_test {
...
@@ -136,11 +151,10 @@ function run_op_benchmark_test {
do
do
echo
"
$api_info
"
>>
$api_info_file
echo
"
$api_info
"
>>
$api_info_file
done
done
LOG
"[INFO] Uninstall "
for
branch_name
in
"develop"
"test_pr"
for
branch_name
in
"develop"
"test_pr"
do
do
git checkout
$branch_name
git checkout
$branch_name
[
$?
-ne
0
]
&&
LOG
"[FATAL] Missing branh
${
branch_name
}
."
&&
exit
7
[
$?
-ne
0
]
&&
LOG
"[FATAL] Missing bran
c
h
${
branch_name
}
."
&&
exit
7
LOG
"[INFO] Now branch name is
${
branch_name
}
."
LOG
"[INFO] Now branch name is
${
branch_name
}
."
compile_install_paddlepaddle
compile_install_paddlepaddle
logs_dir
=
"
$(
pwd
)
/logs-
${
branch_name
}
"
logs_dir
=
"
$(
pwd
)
/logs-
${
branch_name
}
"
...
@@ -171,7 +185,7 @@ function summary_problems {
...
@@ -171,7 +185,7 @@ function summary_problems {
if
[
-z
"
${
BENCHMARK_OP_MAP
[
$op_name
]
}
"
]
if
[
-z
"
${
BENCHMARK_OP_MAP
[
$op_name
]
}
"
]
then
then
exit_code
=
8
exit_code
=
8
LOG
"[WARNING] Missing test script of
\"
${
op_name
}
\"
in benchmark."
LOG
"[WARNING] Missing test script of
\"
${
op_name
}
\"
(
${
CHANGE_OP_MAP
[
$op_name
]
}
)
in benchmark."
fi
fi
done
done
[
$exit_code
-ne
0
]
&&
exit
$exit_code
[
$exit_code
-ne
0
]
&&
exit
$exit_code
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录