@@ -65,7 +65,22 @@ FILENAME=$new_filename
65
65
# MODE must be one of ['benchmark_train']
66
66
MODE=$2
67
67
PARAMS=$3
68
- # bash test_tipc/benchmark_train.sh test_tipc/configs/det_mv3_db_v2_0/train_benchmark.txt benchmark_train dynamic_bs8_null_DP_N1C1
68
+ REST_ARGS=$4
69
+ # bash test_tipc/benchmark_train.sh test_tipc/configs/det_mv3_db_v2_0/train_benchmark.txt benchmark_train
70
+ # bash test_tipc/benchmark_train.sh test_tipc/configs/det_mv3_db_v2_0/train_benchmark.txt benchmark_train to_static
71
+ # bash test_tipc/benchmark_train.sh test_tipc/configs/det_mv3_db_v2_0/train_benchmark.txt benchmark_train dynamic_bs8_null_DP_N1C1 to_static
72
+
73
+ to_static=" d2sF"
74
+ # parse "to_static" options and modify trainer into "to_static_trainer"
75
+ if [ $REST_ARGS = " to_static" ] || [ $PARAMS = " to_static" ] ; then
76
+ to_static=" d2sT"
77
+ sed -i ' s/trainer:norm_train/trainer:to_static_train/g' $FILENAME
78
+ # clear PARAM contents
79
+ if [ $PARAMS = " to_static" ] ; then
80
+ PARAMS=" "
81
+ fi
82
+ fi
83
+
69
84
IFS=$' \n '
70
85
# parser params from train_benchmark.txt
71
86
sed -i ' s/ -o DataLoader.Train.sampler.shuffle=False//g' $FILENAME
@@ -168,7 +183,7 @@ for batch_size in ${batch_size_list[*]}; do
168
183
if [ ${# gpu_id} -le 1 ]; then
169
184
log_path=" $SAVE_LOG /profiling_log"
170
185
mkdir -p $log_path
171
- log_name=" ${repo_name} _${model_name} _bs${batch_size} _${precision} _${run_mode} _${device_num} _profiling"
186
+ log_name=" ${repo_name} _${model_name} _bs${batch_size} _${precision} _${run_mode} _${device_num} _ ${to_static} _profiling"
172
187
func_sed_params " $FILENAME " " ${line_gpuid} " " 0" # sed used gpu_id
173
188
# set profile_option params
174
189
tmp=` sed -i " ${line_profile} s/.*/${profile_option} /" " ${FILENAME} " `
@@ -184,8 +199,8 @@ for batch_size in ${batch_size_list[*]}; do
184
199
speed_log_path=" $SAVE_LOG /index"
185
200
mkdir -p $log_path
186
201
mkdir -p $speed_log_path
187
- log_name=" ${repo_name} _${model_name} _bs${batch_size} _${precision} _${run_mode} _${device_num} _log"
188
- speed_log_name=" ${repo_name} _${model_name} _bs${batch_size} _${precision} _${run_mode} _${device_num} _speed"
202
+ log_name=" ${repo_name} _${model_name} _bs${batch_size} _${precision} _${run_mode} _${device_num} _ ${to_static} _log"
203
+ speed_log_name=" ${repo_name} _${model_name} _bs${batch_size} _${precision} _${run_mode} _${device_num} _ ${to_static} _speed"
189
204
func_sed_params " $FILENAME " " ${line_profile} " " null" # sed profile_id as null
190
205
cmd=" bash test_tipc/test_train_inference_python.sh ${FILENAME} benchmark_train > ${log_path} /${log_name} 2>&1 "
191
206
echo $cmd
@@ -219,8 +234,8 @@ for batch_size in ${batch_size_list[*]}; do
219
234
speed_log_path=" $SAVE_LOG /index"
220
235
mkdir -p $log_path
221
236
mkdir -p $speed_log_path
222
- log_name=" ${repo_name} _${model_name} _bs${batch_size} _${precision} _${run_mode} _${device_num} _log"
223
- speed_log_name=" ${repo_name} _${model_name} _bs${batch_size} _${precision} _${run_mode} _${device_num} _speed"
237
+ log_name=" ${repo_name} _${model_name} _bs${batch_size} _${precision} _${run_mode} _${device_num} _ ${to_static} _log"
238
+ speed_log_name=" ${repo_name} _${model_name} _bs${batch_size} _${precision} _${run_mode} _${device_num} _ ${to_static} _speed"
224
239
func_sed_params " $FILENAME " " ${line_gpuid} " " $gpu_id " # sed used gpu_id
225
240
func_sed_params " $FILENAME " " ${line_profile} " " null" # sed --profile_option as null
226
241
cmd=" bash test_tipc/test_train_inference_python.sh ${FILENAME} benchmark_train > ${log_path} /${log_name} 2>&1 "
0 commit comments