Skip to content

Commit e47f435

Browse files
authored
support ampo1 in benchmark; fp16 -> amp (#8412)
* support ampo1 in benchmark; fp16 -> amp * benchmark: fp16 -> amp
1 parent 253a5d2 commit e47f435

6 files changed

+14
-11
lines changed

test_tipc/configs/dino/dino_r50_4scale_1x_coco_train_infer_python.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ inference:./deploy/python/infer.py
5151
--trt_max_shape:1600
5252
===========================train_benchmark_params==========================
5353
batch_size:2
54-
fp_items:fp32|fp16
54+
fp_items:fp32|amp
5555
epoch:1
5656
repeat:1
5757
--profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile
5858
flags:null
5959
===========================infer_benchmark_params===========================
60-
numpy_infer_input:3x640x640_2.npy
60+
numpy_infer_input:3x640x640_2.npy

test_tipc/configs/picodet/picodet_lcnet_2_5x_416_coco_train_infer_python.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ inference:./deploy/python/infer.py
5151
null:null
5252
===========================train_benchmark_params==========================
5353
batch_size:48
54-
fp_items:fp32|fp16
54+
fp_items:fp32|amp
5555
epoch:1
5656
repeat:1
5757
--profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile
5858
flags:null
5959
===========================infer_benchmark_params===========================
60-
numpy_infer_input:3x416x416_2.npy
60+
numpy_infer_input:3x416x416_2.npy

test_tipc/configs/picodet/picodet_s_320_coco_lcnet_train_infer_python.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ inference:./deploy/python/infer.py
5151
null:null
5252
===========================train_benchmark_params==========================
5353
batch_size:64
54-
fp_items:fp32|fp16
54+
fp_items:fp32|amp
5555
epoch:1
5656
repeat:1
5757
--profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile
5858
flags:null
5959
===========================infer_benchmark_params===========================
6060
numpy_infer_input:3x320x320_2.npy
6161
===========================to_static_train_benchmark_params===========================
62-
to_static_train:--to_static
62+
to_static_train:--to_static

test_tipc/configs/ppyoloe/ppyoloe+/ppyoloe_plus_crn_l_80e_coco_train_infer_python.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ inference:./deploy/python/infer.py
5151
--trt_max_shape:1600
5252
===========================train_benchmark_params==========================
5353
batch_size:16
54-
fp_items:fp32|fp16
54+
fp_items:fp32|amp
5555
epoch:1
5656
repeat:1
5757
--profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile

test_tipc/configs/rtdetr/rtdetr_hgnetv2_l_6x_coco_train_infer_python.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ inference:./deploy/python/infer.py
5151
--trt_max_shape:1600
5252
===========================train_benchmark_params==========================
5353
batch_size:16
54-
fp_items:fp32|fp16
54+
fp_items:fp32|amp
5555
epoch:1
5656
repeat:1
5757
--profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile
58-
flags:null
58+
flags:null

test_tipc/test_train_inference_python.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ if [ ${MODE} = "whole_infer" ] || [ ${MODE} = "klquant_whole_infer" ]; then
203203
export_cmd="${python} ${run_export} ${set_export_weight} ${set_filename} ${set_save_export_dir} "
204204
echo $export_cmd
205205
eval $export_cmd
206-
status_check $? "${export_cmd}" "${status_log}" "${model_name}"
206+
status_check $? "${export_cmd}" "${status_log}" "${model_name}"
207207

208208
#run inference
209209
save_export_model_dir="${save_export_value}/${model_name}"
@@ -279,7 +279,10 @@ else
279279
set_use_gpu=$(func_set_params "${train_use_gpu_key}" "${use_gpu}")
280280
set_train_params1=$(func_set_params "${train_param_key1}" "${train_param_value1}")
281281
save_log="${LOG_PATH}/${trainer}_gpus_${gpu}_autocast_${autocast}"
282-
if [ ${autocast} = "amp" ] || [ ${autocast} = "fp16" ]; then
282+
if [ ${autocast} = "amp" ]; then
283+
set_autocast="--amp"
284+
set_amp_level="amp_level=O1"
285+
elif [ ${autocast} = "fp16" ]; then
283286
set_autocast="--amp"
284287
set_amp_level="amp_level=O2"
285288
else

0 commit comments

Comments
 (0)