Skip to content

Commit

Permalink
[benchmark] update paddlex benchmark scripts (PaddlePaddle#2060)
Browse files Browse the repository at this point in the history
* [benchmark] fixed paddlex benchmark for picodet 320

* [Bug Fix] fixed paddlex ppseg pp-trt infer error

* [Bug Fix] fixed paddlex dino benchmark trt shapes

* [benchmark] support paddlex ppyoloe pptrt benchmark

* [benchmark] adjust paddlex dino trt shapes

* [benchmark] add max_workspace_size flags for tensorrt/pptrt backend

* [benchmark] add max_workspace_size flags for tensorrt/pptrt backend

* [benchmark] add max_workspace_size flags for tensorrt/pptrt backend

* [benchmark] add ort/paddle h2d gpu configs for paddlex

* [benchmark] update paddlex benchmark scripts

* [benchmark] update paddlex benchmark scripts

---------

Co-authored-by: qiuyanjun <[email protected]>
  • Loading branch information
DefTruth and qiuyanjun authored Jun 22, 2023
1 parent a180fb3 commit 4aff322
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 10 deletions.
18 changes: 13 additions & 5 deletions benchmark/paddlex/benchmark_gpu.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Run all models specify hardware and specify backend
set -x

CONFIG_PATH="config.gpu.paddle.fp32.txt"
if [ ! "$1" = "$CONFIG_PATH" ]; then
Expand All @@ -16,16 +17,21 @@ fi
./benchmark_ppcls --model CLIP_vit_base_patch16_224 --image ppcls_cls_demo.JPEG --config_path $CONFIG_PATH

# PaddleDetection
./benchmark_ppdet --model PP-YOLOE+_crn_l_80e --image ppdet_det_img.jpg --config_path $CONFIG_PATH
./benchmark_ppdet --model rt_detr_hgnetv2_l --image ppdet_det_img.jpg --config_path $CONFIG_PATH
./benchmark_ppdet --model dino_r50_4scale --image ppdet_det_img_800x800.jpg --config_path $CONFIG_PATH
./benchmark_ppdet --model PP-PicoDet_s_320_lcnet --image ppdet_det_img.jpg --config_path $CONFIG_PATH
./benchmark_ppdet --model dino_r50_4scale --image ppdet_det_img.jpg --config_path $CONFIG_PATH
./benchmark_ppdet --model PP-PicoDet_s_320_lcnet_with_nms --image ppdet_det_img.jpg --config_path $CONFIG_PATH
./benchmark_ppdet --model PP-PicoDet_s_320_lcnet_without_nms --image ppdet_det_img.jpg --config_path $CONFIG_PATH --no_nms
./benchmark_ppdet --model PP-YOLOE+_crn_l_80e --image ppdet_det_img.jpg --config_path $CONFIG_PATH
./benchmark_ppdet --model PP-YOLOE+_crn_l_80e_with_nms --image ppdet_det_img.jpg --config_path $CONFIG_PATH
./benchmark_ppdet --model PP-YOLOE+_crn_l_80e_with_trt_nms --image ppdet_det_img.jpg --config_path $CONFIG_PATH
./benchmark_ppdet --model PP-YOLOE+_crn_l_80e_without_nms --image ppdet_det_img.jpg --config_path $CONFIG_PATH --no_nms

# PaddleSeg
./benchmark_ppseg --model OCRNet_HRNetW48 --image ppseg_cityscapes_demo.png --config_path $CONFIG_PATH
./benchmark_ppseg --model PP-LiteSeg-STDC1 --image ppseg_cityscapes_demo.png --config_path $CONFIG_PATH
./benchmark_ppseg --model OCRNet_HRNetW48 --image ppseg_cityscapes_demo_512x512.png --config_path $CONFIG_PATH
./benchmark_ppseg --model PP-LiteSeg-STDC1 --image ppseg_cityscapes_demo_512x512.png --config_path $CONFIG_PATH
./benchmark_ppseg --model SegFormer-B0 --image ppseg_cityscapes_demo_512x512.png --config_path $CONFIG_PATH
./benchmark_ppseg --model PP-MobileSeg-Base --image ppseg_ade_val_512x512.png --config_path $CONFIG_PATH
./benchmark_ppseg --model SegFormer-B0 --image ppseg_cityscapes_demo.png --config_path $CONFIG_PATH

# PaddleOCR
./benchmark_ppocr_rec --model PP-OCRv4-mobile-rec --image ppocrv4_word_1.jpg --rec_label_file ppocr_keys_v1.txt --config_path $CONFIG_PATH
Expand All @@ -39,3 +45,5 @@ fi
# PP-StructureV2
./benchmark_structurev2_layout --model PP-Structurev2-layout --image structurev2_layout_val_0002.jpg --config_path $CONFIG_PATH
./benchmark_structurev2_table --model PP-Structurev2-SLANet --image structurev2_table.jpg --table_char_dict_path table_structure_dict_ch.txt --config_path $CONFIG_PATH

set +x
3 changes: 3 additions & 0 deletions benchmark/paddlex/benchmark_gpu_trt.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Run all models specify hardware and specify backend
set -x

CONFIG_PATH="config.gpu.paddle_trt.fp32.txt"
if [ ! "$1" = "$CONFIG_PATH" ]; then
Expand Down Expand Up @@ -46,3 +47,5 @@ fi
# PP-StructureV2
./benchmark_structurev2_layout --model PP-Structurev2-layout --image structurev2_layout_val_0002.jpg --config_path $CONFIG_PATH
./benchmark_structurev2_table --model PP-Structurev2-SLANet --image structurev2_table.jpg --table_char_dict_path table_structure_dict_ch.txt --config_path $CONFIG_PATH

set +x
18 changes: 13 additions & 5 deletions benchmark/paddlex/benchmark_x86.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Run all models specify hardware and specify backend
set -x

CONFIG_PATH="config.x86.paddle.fp32.txt"
if [ ! "$1" = "$CONFIG_PATH" ]; then
Expand All @@ -16,16 +17,21 @@ fi
./benchmark_ppcls --model CLIP_vit_base_patch16_224 --image ppcls_cls_demo.JPEG --config_path $CONFIG_PATH

# PaddleDetection
./benchmark_ppdet --model PP-YOLOE+_crn_l_80e --image ppdet_det_img.jpg --config_path $CONFIG_PATH
./benchmark_ppdet --model rt_detr_hgnetv2_l --image ppdet_det_img.jpg --config_path $CONFIG_PATH
./benchmark_ppdet --model dino_r50_4scale --image ppdet_det_img_800x800.jpg --config_path $CONFIG_PATH
./benchmark_ppdet --model PP-PicoDet_s_320_lcnet --image ppdet_det_img.jpg --config_path $CONFIG_PATH
./benchmark_ppdet --model dino_r50_4scale --image ppdet_det_img.jpg --config_path $CONFIG_PATH
./benchmark_ppdet --model PP-PicoDet_s_320_lcnet_with_nms --image ppdet_det_img.jpg --config_path $CONFIG_PATH
./benchmark_ppdet --model PP-PicoDet_s_320_lcnet_without_nms --image ppdet_det_img.jpg --config_path $CONFIG_PATH --no_nms
./benchmark_ppdet --model PP-YOLOE+_crn_l_80e --image ppdet_det_img.jpg --config_path $CONFIG_PATH
./benchmark_ppdet --model PP-YOLOE+_crn_l_80e_with_nms --image ppdet_det_img.jpg --config_path $CONFIG_PATH
./benchmark_ppdet --model PP-YOLOE+_crn_l_80e_with_trt_nms --image ppdet_det_img.jpg --config_path $CONFIG_PATH
./benchmark_ppdet --model PP-YOLOE+_crn_l_80e_without_nms --image ppdet_det_img.jpg --config_path $CONFIG_PATH --no_nms

# PaddleSeg
./benchmark_ppseg --model OCRNet_HRNetW48 --image ppseg_cityscapes_demo.png --config_path $CONFIG_PATH
./benchmark_ppseg --model PP-LiteSeg-STDC1 --image ppseg_cityscapes_demo.png --config_path $CONFIG_PATH
./benchmark_ppseg --model OCRNet_HRNetW48 --image ppseg_cityscapes_demo_512x512.png --config_path $CONFIG_PATH
./benchmark_ppseg --model PP-LiteSeg-STDC1 --image ppseg_cityscapes_demo_512x512.png --config_path $CONFIG_PATH
./benchmark_ppseg --model SegFormer-B0 --image ppseg_cityscapes_demo_512x512.png --config_path $CONFIG_PATH
./benchmark_ppseg --model PP-MobileSeg-Base --image ppseg_ade_val_512x512.png --config_path $CONFIG_PATH
./benchmark_ppseg --model SegFormer-B0 --image ppseg_cityscapes_demo.png --config_path $CONFIG_PATH

# PaddleOCR
./benchmark_ppocr_rec --model PP-OCRv4-mobile-rec --image ppocrv4_word_1.jpg --rec_label_file ppocr_keys_v1.txt --config_path $CONFIG_PATH
Expand All @@ -39,3 +45,5 @@ fi
# PP-StructureV2
./benchmark_structurev2_layout --model PP-Structurev2-layout --image structurev2_layout_val_0002.jpg --config_path $CONFIG_PATH
./benchmark_structurev2_table --model PP-Structurev2-SLANet --image structurev2_table.jpg --table_char_dict_path table_structure_dict_ch.txt --config_path $CONFIG_PATH

set +x
4 changes: 4 additions & 0 deletions benchmark/paddlex/run_gpu.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set -x

export CUDA_VISIBLE_DEVICES='0'
bash benchmark_gpu.sh config/config.gpu.ort.fp32.e2e.txt
bash benchmark_gpu.sh config/config.gpu.ort.fp32.txt
Expand Down Expand Up @@ -30,3 +32,5 @@ bash benchmark_gpu_trt.sh config/config.gpu.trt.fp32.txt
bash benchmark_gpu_trt.sh config/config.gpu.trt.fp32.h2d.txt
# rm all paddle_trt/trt cache
find . -name "trt_serialized*" | xargs rm -rf

set +x
3 changes: 3 additions & 0 deletions benchmark/paddlex/run_x86.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -x

bash benchmark_x86.sh config/config.x86.ort.fp32.e2e.txt
bash benchmark_x86.sh config/config.x86.ort.fp32.txt
Expand All @@ -8,3 +9,5 @@ bash benchmark_x86.sh config/config.x86.ov.fp32.txt

bash benchmark_x86.sh config/config.x86.paddle.fp32.e2e.txt
bash benchmark_x86.sh config/config.x86.paddle.fp32.txt

set +x

0 comments on commit 4aff322

Please sign in to comment.