run_all.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Use docker: paddlepaddle/paddle:latest-gpu-cuda10.1-cudnn7 paddle=2.1.2 python3.7
  2. #
  3. # Usage:
  4. # git clone https://github.com/PaddlePaddle/PaddleDetection.git
  5. # cd PaddleDetection
  6. # bash benchmark/run_all.sh
  7. log_path=${LOG_PATH_INDEX_DIR:-$(pwd)} # benchmark系统指定该参数,不需要跑profile时,log_path指向存speed的目录
  8. # run prepare.sh
  9. bash benchmark/prepare.sh
  10. model_name_list=(faster_rcnn fcos deformable_detr gfl hrnet higherhrnet solov2 jde fairmot)
  11. fp_item_list=(fp32)
  12. max_epoch=2
  13. for model_item in ${model_name_list[@]}; do
  14. for fp_item in ${fp_item_list[@]}; do
  15. case ${model_item} in
  16. faster_rcnn) bs_list=(1 8) ;;
  17. fcos) bs_list=(2) ;;
  18. deformable_detr) bs_list=(2) ;;
  19. gfl) bs_list=(2) ;;
  20. hrnet) bs_list=(64) ;;
  21. higherhrnet) bs_list=(20) ;;
  22. solov2) bs_list=(2) ;;
  23. jde) bs_list=(4) ;;
  24. fairmot) bs_list=(6) ;;
  25. *) echo "wrong model_name"; exit 1;
  26. esac
  27. for bs_item in ${bs_list[@]}
  28. do
  29. run_mode=sp
  30. log_name=detection_${model_item}_bs${bs_item}_${fp_item} # 如:clas_MobileNetv1_mp_bs32_fp32_8
  31. echo "index is speed, 1gpus, begin, ${log_name}"
  32. CUDA_VISIBLE_DEVICES=0 bash benchmark/run_benchmark.sh ${run_mode} ${bs_item} \
  33. ${fp_item} ${max_epoch} ${model_item} | tee ${log_path}/${log_name}_speed_1gpus 2>&1
  34. sleep 60
  35. run_mode=mp
  36. log_name=detection_${model_item}_bs${bs_item}_${fp_item} # 如:clas_MobileNetv1_mp_bs32_fp32_8
  37. echo "index is speed, 8gpus, run_mode is multi_process, begin, ${log_name}"
  38. CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 bash benchmark/run_benchmark.sh ${run_mode} \
  39. ${bs_item} ${fp_item} ${max_epoch} ${model_item}| tee ${log_path}/${log_name}_speed_8gpus8p 2>&1
  40. sleep 60
  41. done
  42. done
  43. done