run_all.sh 1.9 KB
Newer Older
1 2 3 4 5 6
# Use docker: paddlepaddle/paddle:latest-gpu-cuda10.1-cudnn7  paddle=2.1.2  python3.7
#
# Usage:
#   git clone https://github.com/PaddlePaddle/PaddleDetection.git
#   cd PaddleDetection
#   bash benchmark/run_all.sh
G
gmm 已提交
7
log_path=${LOG_PATH_INDEX_DIR:-$(pwd)}  #  benchmark系统指定该参数,不需要跑profile时,log_path指向存speed的目录
8 9 10 11

# run prepare.sh
bash benchmark/prepare.sh

12
model_name_list=(faster_rcnn fcos deformable_detr gfl hrnet higherhrnet solov2 jde fairmot)
13
fp_item_list=(fp32)
G
gmm 已提交
14
max_epoch=2
15

G
gmm 已提交
16
for model_item in ${model_name_list[@]}; do
17
      for fp_item in ${fp_item_list[@]}; do
G
gmm 已提交
18
          case ${model_item} in
19
              faster_rcnn) bs_list=(1 8) ;;
H
hysunflower 已提交
20
              fcos) bs_list=(2) ;;
21
              deformable_detr) bs_list=(2) ;;
H
hysunflower 已提交
22 23 24 25 26 27
              gfl) bs_list=(2) ;;
              hrnet) bs_list=(64) ;;
              higherhrnet) bs_list=(20) ;;
              solov2) bs_list=(2) ;;
              jde) bs_list=(4) ;;
              fairmot) bs_list=(6) ;;
28 29 30 31 32
              *) echo "wrong model_name"; exit 1;
          esac
          for bs_item in ${bs_list[@]}
            do
            run_mode=sp
G
gmm 已提交
33 34
            log_name=detection_${model_item}_bs${bs_item}_${fp_item}   # 如:clas_MobileNetv1_mp_bs32_fp32_8
            echo "index is speed, 1gpus, begin, ${log_name}"
35
            CUDA_VISIBLE_DEVICES=0 bash benchmark/run_benchmark.sh ${run_mode} ${bs_item} \
H
hysunflower 已提交
36
             ${fp_item} ${max_epoch} ${model_item} | tee ${log_path}/${log_name}_speed_1gpus 2>&1
37 38 39
            sleep 60

            run_mode=mp
G
gmm 已提交
40 41
            log_name=detection_${model_item}_bs${bs_item}_${fp_item}   # 如:clas_MobileNetv1_mp_bs32_fp32_8
            echo "index is speed, 8gpus, run_mode is multi_process, begin, ${log_name}"
42
            CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 bash benchmark/run_benchmark.sh ${run_mode} \
G
gmm 已提交
43
             ${bs_item} ${fp_item} ${max_epoch} ${model_item}| tee ${log_path}/${log_name}_speed_8gpus8p 2>&1
44 45 46 47
            sleep 60
            done
      done
done