未验证 提交 0927444b 编写于 作者: W wangna11BD 提交者: GitHub

fix TIPC bug for cafe67538 (#765)

* fix TIPC bug for cafe67538

* fix style for TIPC
上级 fca1fe35
......@@ -67,6 +67,14 @@ FILENAME=$new_filename
# MODE must be one of ['benchmark_train']
MODE=$2
PARAMS=$3
REST_ARGS=$4
to_static=""
# parse "to_static" options and modify trainer into "to_static_trainer"
if [[ $PARAMS =~ "dynamicTostatic" ]] ;then
to_static="d2sT_"
sed -i 's/trainer:norm_train/trainer:to_static_train/g' $FILENAME
fi
IFS=$'\n'
# parser params from train_benchmark.txt
......@@ -77,7 +85,7 @@ lines=(${dataline})
model_name=$(func_parser_value "${lines[1]}")
# 获取benchmark_params所在的行数
line_num=`grep -n "train_benchmark_params" $FILENAME | cut -d ":" -f 1`
line_num=`grep -n -w "train_benchmark_params" $FILENAME | cut -d ":" -f 1`
# for train log parser
batch_size=$(func_parser_value "${lines[line_num]}")
line_num=`expr $line_num + 1`
......@@ -128,6 +136,13 @@ if [ ! -n "$PARAMS" ] ;then
fp_items_list=(${fp_items})
device_num_list=(N1C4)
run_mode="DP"
elif [[ ${PARAMS} = "dynamicTostatic" ]] ;then
IFS="|"
model_type=$PARAMS
batch_size_list=(${batch_size})
fp_items_list=(${fp_items})
device_num_list=(N1C4)
run_mode="DP"
else
# parser params from input: modeltype_bs${bs_item}_${fp_item}_${run_mode}_${device_num}
IFS="_"
......@@ -149,14 +164,6 @@ else
device_num_list=($device_num)
fi
# for log name
to_static=""
# parse "to_static" options and modify trainer into "to_static_trainer"
if [[ ${model_type} = "dynamicTostatic" ]];then
to_static="d2sT_"
sed -i 's/trainer:norm_train/trainer:to_static_train/g' $FILENAME
fi
IFS="|"
for batch_size in ${batch_size_list[*]}; do
for precision in ${fp_items_list[*]}; do
......
......@@ -17,7 +17,7 @@ norm_train:tools/main.py -c configs/cyclegan_horse2zebra.yaml --seed 123 -o log_
pact_train:null
fpgm_train:null
distill_train:null
to_static_train:model.to_static=True
null:null
null:null
##
===========================eval_params===========================
......@@ -49,6 +49,8 @@ null:null
null:null
--benchmark:True
null:null
===========================to_static_train_benchmark_params===========================
to_static_train:model.to_static=True
===========================train_benchmark_params==========================
batch_size:1
fp_items:fp32
......
......@@ -17,7 +17,7 @@ norm_train:tools/main.py -c configs/pix2pix_facades.yaml --seed 123 -o log_confi
pact_train:null
fpgm_train:null
distill_train:null
to_static_train:model.to_static=True
null:null
null:null
##
===========================eval_params===========================
......@@ -49,6 +49,8 @@ null:null
null:null
--benchmark:True
null:null
===========================to_static_train_benchmark_params===========================
to_static_train:model.to_static=True
===========================train_benchmark_params==========================
batch_size:1
fp_items:fp32
......
......@@ -17,7 +17,7 @@ norm_train:tools/main.py -c configs/edvr_m_wo_tsa.yaml --seed 123 -o log_config.
pact_train:null
fpgm_train:null
distill_train:null
to_static_train:model.to_static=True
null:null
null:null
##
===========================eval_params===========================
......@@ -49,9 +49,11 @@ null:null
null:null
--benchmark:True
null:null
===========================to_static_train_benchmark_params===========================
to_static_train:model.to_static=True
===========================train_benchmark_params==========================
batch_size:64
fp_items:fp32|fp16
total_iters:100
--profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile
flags:FLAGS_cudnn_exhaustive_search=0
flags:FLAGS_cudnn_exhaustive_search=1
......@@ -17,7 +17,7 @@ norm_train:tools/main.py -c configs/esrgan_psnr_x4_div2k.yaml --seed 123 -o log_
pact_train:null
fpgm_train:null
distill_train:null
to_static_train:model.to_static=True
null:null
null:null
##
===========================eval_params===========================
......@@ -49,9 +49,11 @@ null:null
null:null
--benchmark:True
null:null
===========================to_static_train_benchmark_params===========================
to_static_train:model.to_static=True
===========================train_benchmark_params==========================
batch_size:32|64
fp_items:fp32
total_iters:500
--profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile
flags:FLAGS_cudnn_exhaustive_search=0
flags:FLAGS_cudnn_exhaustive_search=1
......@@ -17,7 +17,7 @@ norm_train:tools/main.py -c configs/msvsr_reds.yaml --seed 123 -o log_config.int
pact_train:null
fpgm_train:null
distill_train:null
to_static_train:model.to_static=True
null:null
null:null
##
===========================eval_params===========================
......@@ -49,11 +49,13 @@ null:null
null:null
--benchmark:True
null:null
===========================to_static_train_benchmark_params===========================
to_static_train:model.to_static=True
===========================train_benchmark_params==========================
batch_size:2|4
fp_items:fp32|fp16
total_iters:60
--profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile
flags:FLAGS_cudnn_exhaustive_search=0
flags:FLAGS_cudnn_exhaustive_search=1
===========================infer_benchmark_params==========================
random_infer_input:[{float32,[2,3,180,320]}]
......@@ -5,7 +5,7 @@ FILENAME=$1
# MODE be one of ['lite_train_lite_infer' 'lite_train_whole_infer' 'whole_train_whole_infer', 'whole_infer']
MODE=$2
dataline=$(awk 'NR==1, NR==51{print}' $FILENAME)
dataline=$(cat ${FILENAME})
# parser params
IFS=$'\n'
......@@ -33,8 +33,8 @@ trainer_list=$(func_parser_value "${lines[14]}")
trainer_norm=$(func_parser_key "${lines[15]}")
norm_trainer=$(func_parser_value "${lines[15]}")
to_static_key=$(func_parser_key "${lines[19]}")
to_static_trainer=$(func_parser_value "${lines[19]}")
trainer_key1=$(func_parser_key "${lines[19]}")
trainer_value1=$(func_parser_value "${lines[19]}")
trainer_key2=$(func_parser_key "${lines[20]}")
trainer_value2=$(func_parser_value "${lines[20]}")
......@@ -73,6 +73,10 @@ save_log_key=$(func_parser_key "${lines[48]}")
infer_key1=$(func_parser_key "${lines[50]}")
infer_value1=$(func_parser_value "${lines[50]}")
line_num=`grep -n -w "to_static_train_benchmark_params" $FILENAME | cut -d ":" -f 1`
to_static_key=$(func_parser_key "${lines[line_num]}")
to_static_trainer=$(func_parser_value "${lines[line_num]}")
LOG_PATH="./test_tipc/output/${model_name}/${MODE}"
mkdir -p ${LOG_PATH}
status_log="${LOG_PATH}/results_python.log"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册