From 5f14efd5be5b9dff069000388a7998e3a9029cd6 Mon Sep 17 00:00:00 2001 From: LokeZhou Date: Mon, 27 Mar 2023 14:48:56 +0800 Subject: [PATCH] [TIPC] * benchamrk use cocomini dataset (#7995) * benchamrk set run 5m finish * static train pop data['image_file'] --- ppdet/engine/trainer.py | 3 +++ test_tipc/benchmark_train.sh | 4 ++-- .../deformable_detr_r50_1x_coco_train_infer_python.txt | 2 +- .../dino/dino_r50_4scale_1x_coco_train_infer_python.txt | 2 +- .../fcos/fcos_r50_fpn_1x_coco_train_infer_python.txt | 2 +- .../mask_rcnn_r50_fpn_1x_coco_train_infer_python.txt | 2 +- .../picodet/picodet_s_320_coco_lcnet_train_infer_python.txt | 2 +- .../ppyoloe/ppyoloe_crn_s_300e_coco_train_infer_python.txt | 4 +++- .../yolov3_darknet53_270e_coco_train_infer_python.txt | 2 +- test_tipc/prepare.sh | 6 +++--- test_tipc/test_train_inference_python.sh | 2 +- 11 files changed, 18 insertions(+), 13 deletions(-) diff --git a/ppdet/engine/trainer.py b/ppdet/engine/trainer.py index 0378e00ec..730b99f28 100644 --- a/ppdet/engine/trainer.py +++ b/ppdet/engine/trainer.py @@ -487,6 +487,9 @@ class Trainer(object): profiler.add_profiler_step(profiler_options) self._compose_callback.on_step_begin(self.status) data['epoch_id'] = epoch_id + if self.cfg.get('to_static', + False) and 'image_file' in data.keys(): + data.pop('image_file') if self.use_amp: if isinstance( diff --git a/test_tipc/benchmark_train.sh b/test_tipc/benchmark_train.sh index bb2324f00..b4dced75a 100644 --- a/test_tipc/benchmark_train.sh +++ b/test_tipc/benchmark_train.sh @@ -243,7 +243,7 @@ for batch_size in ${batch_size_list[*]}; do --run_mode ${run_mode} \ --fp_item ${precision} \ --keyword ips: \ - --skip_steps 2 \ + --skip_steps 4 \ --device_num ${device_num} \ --speed_unit images/s \ --convergence_key loss: " @@ -279,7 +279,7 @@ for batch_size in ${batch_size_list[*]}; do --run_mode ${run_mode} \ --fp_item ${precision} \ --keyword ips: \ - --skip_steps 2 \ + --skip_steps 4 \ --device_num ${device_num} \ --speed_unit images/s \ --convergence_key loss: " diff --git a/test_tipc/configs/deformable_detr/deformable_detr_r50_1x_coco_train_infer_python.txt b/test_tipc/configs/deformable_detr/deformable_detr_r50_1x_coco_train_infer_python.txt index a2b9ae5c4..f4b23d2d7 100644 --- a/test_tipc/configs/deformable_detr/deformable_detr_r50_1x_coco_train_infer_python.txt +++ b/test_tipc/configs/deformable_detr/deformable_detr_r50_1x_coco_train_infer_python.txt @@ -53,6 +53,6 @@ inference:./deploy/python/infer.py batch_size:2 fp_items:fp32|fp16 epoch:1 -repeat:2 +repeat:1 --profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile flags:null \ No newline at end of file diff --git a/test_tipc/configs/dino/dino_r50_4scale_1x_coco_train_infer_python.txt b/test_tipc/configs/dino/dino_r50_4scale_1x_coco_train_infer_python.txt index 87117a4cc..ee694fdd7 100644 --- a/test_tipc/configs/dino/dino_r50_4scale_1x_coco_train_infer_python.txt +++ b/test_tipc/configs/dino/dino_r50_4scale_1x_coco_train_infer_python.txt @@ -53,7 +53,7 @@ inference:./deploy/python/infer.py batch_size:2 fp_items:fp32|fp16 epoch:1 -repeat:2 +repeat:1 --profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile flags:null ===========================infer_benchmark_params=========================== diff --git a/test_tipc/configs/fcos/fcos_r50_fpn_1x_coco_train_infer_python.txt b/test_tipc/configs/fcos/fcos_r50_fpn_1x_coco_train_infer_python.txt index f95e1a040..325148db5 100644 --- a/test_tipc/configs/fcos/fcos_r50_fpn_1x_coco_train_infer_python.txt +++ b/test_tipc/configs/fcos/fcos_r50_fpn_1x_coco_train_infer_python.txt @@ -53,7 +53,7 @@ inference:./deploy/python/infer.py batch_size:2|8 fp_items:fp32|fp16 epoch:1 -repeat:3 +repeat:1 --profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile flags:null ===========================infer_benchmark_params=========================== diff --git a/test_tipc/configs/mask_rcnn/mask_rcnn_r50_fpn_1x_coco_train_infer_python.txt b/test_tipc/configs/mask_rcnn/mask_rcnn_r50_fpn_1x_coco_train_infer_python.txt index db6d2b00a..f03b573c0 100644 --- a/test_tipc/configs/mask_rcnn/mask_rcnn_r50_fpn_1x_coco_train_infer_python.txt +++ b/test_tipc/configs/mask_rcnn/mask_rcnn_r50_fpn_1x_coco_train_infer_python.txt @@ -53,7 +53,7 @@ inference:./deploy/python/infer.py batch_size:2|4 fp_items:fp32|fp16 epoch:1 -repeat:2 +repeat:1 --profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile flags:null ===========================infer_benchmark_params=========================== diff --git a/test_tipc/configs/picodet/picodet_s_320_coco_lcnet_train_infer_python.txt b/test_tipc/configs/picodet/picodet_s_320_coco_lcnet_train_infer_python.txt index 57e7e3c3c..cb10d21b3 100644 --- a/test_tipc/configs/picodet/picodet_s_320_coco_lcnet_train_infer_python.txt +++ b/test_tipc/configs/picodet/picodet_s_320_coco_lcnet_train_infer_python.txt @@ -53,7 +53,7 @@ null:null batch_size:64 fp_items:fp32|fp16 epoch:1 -repeat:25 +repeat:1 --profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile flags:null ===========================infer_benchmark_params=========================== diff --git a/test_tipc/configs/ppyoloe/ppyoloe_crn_s_300e_coco_train_infer_python.txt b/test_tipc/configs/ppyoloe/ppyoloe_crn_s_300e_coco_train_infer_python.txt index 19fa1673b..8464d70a7 100644 --- a/test_tipc/configs/ppyoloe/ppyoloe_crn_s_300e_coco_train_infer_python.txt +++ b/test_tipc/configs/ppyoloe/ppyoloe_crn_s_300e_coco_train_infer_python.txt @@ -53,8 +53,10 @@ inference:./deploy/python/infer.py batch_size:8 fp_items:fp32|fp16 epoch:1 -repeat:12 +repeat:1 --profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile flags:null ===========================infer_benchmark_params=========================== numpy_infer_input:3x640x640_2.npy +===========================to_static_train_benchmark_params=========================== +to_static_train:--to_static diff --git a/test_tipc/configs/yolov3/yolov3_darknet53_270e_coco_train_infer_python.txt b/test_tipc/configs/yolov3/yolov3_darknet53_270e_coco_train_infer_python.txt index 7c0b3aa5b..9b3553e03 100644 --- a/test_tipc/configs/yolov3/yolov3_darknet53_270e_coco_train_infer_python.txt +++ b/test_tipc/configs/yolov3/yolov3_darknet53_270e_coco_train_infer_python.txt @@ -53,7 +53,7 @@ null:null batch_size:8 fp_items:fp32|fp16 epoch:1 -repeat:3 +repeat:1 --profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile flags:null ===========================infer_benchmark_params=========================== diff --git a/test_tipc/prepare.sh b/test_tipc/prepare.sh index 5d3d890f8..989966849 100644 --- a/test_tipc/prepare.sh +++ b/test_tipc/prepare.sh @@ -99,9 +99,9 @@ elif [ ${MODE} = "benchmark_train" ];then cd ../../ else # prepare lite benchmark coco data - wget -nc -P ./dataset/coco/ https://paddledet.bj.bcebos.com/data/coco_benchmark.tar --no-check-certificate - cd ./dataset/coco/ && tar -xf coco_benchmark.tar - mv -u coco_benchmark/* ./ + wget -nc -P ./dataset/coco/ https://bj.bcebos.com/v1/paddledet/data/cocomini.zip --no-check-certificate + cd ./dataset/coco/ && unzip cocomini.zip + mv -u cocomini/* ./ ls ./ cd ../../ # prepare lite benchmark mot data diff --git a/test_tipc/test_train_inference_python.sh b/test_tipc/test_train_inference_python.sh index d5c09ccf0..072fb89cf 100644 --- a/test_tipc/test_train_inference_python.sh +++ b/test_tipc/test_train_inference_python.sh @@ -311,7 +311,7 @@ else fi # run train train_log_path="${LOG_PATH}/${trainer}_gpus_${gpu}_autocast_${autocast}_nodes_${nodes}.log" - eval "${cmd} > ${train_log_path} 2>&1" + eval "timeout 5m ${cmd} > ${train_log_path} 2>&1" last_status=$? cat ${train_log_path} status_check $last_status "${cmd}" "${status_log}" "${model_name}" "${train_log_path}" -- GitLab