未验证 提交 096b0f2e 编写于 作者: T tianshuo78520a 提交者: GitHub

Add op benchmark run function log (#35034)

* Add run function log

* test=document_fix
上级 4641e8fc
......@@ -36,6 +36,7 @@ function LOG {
# Limit cu file directory
function match_cu_file_directory {
LOG "[INFO] run function match_cu_file_directory"
local sub_dir cu_file_dir
cu_file_dir=$(dirname ${1})
for sub_dir in "" "/elementwise" "/reduce_ops"
......@@ -47,6 +48,7 @@ function match_cu_file_directory {
# Load op files by header file
function load_CHANGE_OP_FILES_by_header_file {
LOG "[INFO] run function load_CHANGE_OP_FILES_by_header_file"
local change_file
for change_file in $(grep -rl "${1}" paddle/fluid/operators)
do
......@@ -68,6 +70,7 @@ function load_CHANGE_OP_FILES_by_header_file {
# Load op files that PR changes
function load_CHANGE_OP_FILES {
LOG "[INFO] run function load_CHANGE_OP_FILES"
local sub_dir change_file
# TODO(Avin0323): Need to filter the files added by the new OP.
for change_file in $(git diff --name-only origin/develop)
......@@ -108,6 +111,7 @@ function prepare_benchmark_environment {
# Load unique op name from CHANGE_OP_FILES
function load_CHANGE_OP_MAP {
LOG "[INFO] run function load_CHANGE_OP_MAP"
local op_name change_file change_file_name
source benchmark/ci/scripts/op_benchmark.config
for change_file in ${CHANGE_OP_FILES[@]}
......@@ -133,6 +137,7 @@ function load_CHANGE_OP_MAP {
# Load ops that will run benchmark test
function load_BENCHMARK_OP_MAP {
LOG "[INFO] run function load_BENCHMARK_OP_MAP"
local line op_name api_name
source benchmark/ci/scripts/op_benchmark.config
for line in $(cat api_info.txt)
......@@ -173,6 +178,7 @@ function compile_install_paddlepaddle {
}
function build_whl {
LOG "[INFO] run function build_whl"
for branch_name in "develop" "test"
do
git checkout ${branch_name}
......@@ -184,6 +190,7 @@ function build_whl {
# run op benchmark test
function run_op_benchmark_test {
LOG "[INFO] run function run_op_benchmark_test"
[ ${#BENCHMARK_OP_MAP[*]} -eq 0 ] && return
local logs_dir op_name branch_name api_info_file
[ -z "$VISIBLE_DEVICES" ] && export VISIBLE_DEVICES=0
......@@ -219,6 +226,7 @@ function run_op_benchmark_test {
# check benchmark result
function check_op_benchmark_result {
LOG "[INFO] run function check_op_benchmark_result"
local logs_dir api_info_file check_status_code
# default 3 times
[ -z "${RETRY_TIMES}" ] && RETRY_TIMES=3
......@@ -254,6 +262,7 @@ function check_op_benchmark_result {
}
function check_CHANGE_OP_MAP {
LOG "[INFO] run function check_CHANGE_OP_MAP"
for op_name in ${!CHANGE_OP_MAP[@]}
do
if [ -z "${BENCHMARK_OP_MAP[$op_name]}" ]
......@@ -271,6 +280,7 @@ function check_CHANGE_OP_MAP {
# diff benchmakr result and miss op
function summary_problems {
LOG "[INFO] run function summary_problems"
local op_name exit_code
exit_code=0
if [ ${#BENCHMARK_OP_MAP[*]} -ne 0 ]
......@@ -297,6 +307,8 @@ function cpu_op_benchmark {
function gpu_op_benchmark {
LOG "[INFO] Start run op benchmark gpu test ..."
load_CHANGE_OP_FILES
load_CHANGE_OP_MAP
load_BENCHMARK_OP_MAP
run_op_benchmark_test
summary_problems
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册