Files
FastDeploy/benchmark
DefTruth 30def02a89 [YOLOv8] Add PaddleYOLOv8 models download links (#1152)
* [Model] Support PaddleYOLOv8 model

* [YOLOv8] Add PaddleYOLOv8 pybind

* [Other] update from latest develop (#30)

* [Backend] Remove all lite options in RuntimeOption (#1109)

* Remove all lite options in RuntimeOption

* Fix code error

* move pybind

* Fix build error

* [Backend] Add TensorRT  FP16 support for AdaptivePool2d (#1116)

* add fp16 cuda kernel

* fix code bug

* update code

* [Doc] Fix KunlunXin doc (#1139)

fix kunlunxin doc

* [Model] Support PaddleYOLOv8 model (#1136)

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

* [YOLOv8] add PaddleYOLOv8 pybind11 (#1144) (#31)

* [Model] Support PaddleYOLOv8 model

* [YOLOv8] Add PaddleYOLOv8 pybind

* [Other] update from latest develop (#30)

* [Backend] Remove all lite options in RuntimeOption (#1109)

* Remove all lite options in RuntimeOption

* Fix code error

* move pybind

* Fix build error

* [Backend] Add TensorRT  FP16 support for AdaptivePool2d (#1116)

* add fp16 cuda kernel

* fix code bug

* update code

* [Doc] Fix KunlunXin doc (#1139)

fix kunlunxin doc

* [Model] Support PaddleYOLOv8 model (#1136)

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

* [benchmark] add PaddleYOLOv8 -> benchmark

* [benchmark] add PaddleYOLOv8 -> benchmark

* [Lite] Support PaddleYOLOv8 with Lite Backend

* [Pick] Update from latest develop (#32)

* [Model] Support Insightface model inferenceing on RKNPU (#1113)

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* Update issues.md

* Update fastdeploy_init.sh

* 更新交叉编译

* 更新insightface系列模型的rknpu2支持

* 更新insightface系列模型的rknpu2支持

* 更新说明文档

* 更新insightface

* 尝试解决pybind问题

Co-authored-by: Jason <928090362@qq.com>
Co-authored-by: Jason <jiangjiajun@baidu.com>

* [Other] Add Function For Aligning Face With Five Points (#1124)

* 更新5点人脸对齐的代码

* 更新代码格式

* 解决comment

* update example

* 更新注释

Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com>

* [Lite] Support PaddleYOLOv8 with Lite Backend (#1145)

* [Model] Support PaddleYOLOv8 model

* [YOLOv8] Add PaddleYOLOv8 pybind

* [Other] update from latest develop (#30)

* [Backend] Remove all lite options in RuntimeOption (#1109)

* Remove all lite options in RuntimeOption

* Fix code error

* move pybind

* Fix build error

* [Backend] Add TensorRT  FP16 support for AdaptivePool2d (#1116)

* add fp16 cuda kernel

* fix code bug

* update code

* [Doc] Fix KunlunXin doc (#1139)

fix kunlunxin doc

* [Model] Support PaddleYOLOv8 model (#1136)

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

* [YOLOv8] add PaddleYOLOv8 pybind11 (#1144) (#31)

* [Model] Support PaddleYOLOv8 model

* [YOLOv8] Add PaddleYOLOv8 pybind

* [Other] update from latest develop (#30)

* [Backend] Remove all lite options in RuntimeOption (#1109)

* Remove all lite options in RuntimeOption

* Fix code error

* move pybind

* Fix build error

* [Backend] Add TensorRT  FP16 support for AdaptivePool2d (#1116)

* add fp16 cuda kernel

* fix code bug

* update code

* [Doc] Fix KunlunXin doc (#1139)

fix kunlunxin doc

* [Model] Support PaddleYOLOv8 model (#1136)

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

* [benchmark] add PaddleYOLOv8 -> benchmark

* [benchmark] add PaddleYOLOv8 -> benchmark

* [Lite] Support PaddleYOLOv8 with Lite Backend

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

* [Model] Add Silero VAD example (#1107)

* add vad example

* fix typo

* fix typo

* rename file

* remove model and wav

* delete Vad.cc

* delete Vad.h

* rename and format

* fix max and min

* update readme

* rename var

* format

* add params

* update readme

* update readme

* Update README.md

* Update README_CN.md

Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com>

Co-authored-by: Zheng-Bicheng <58363586+Zheng-Bicheng@users.noreply.github.com>
Co-authored-by: Jason <928090362@qq.com>
Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>
Co-authored-by: Qianhe Chen <54462604+chenqianhe@users.noreply.github.com>

* [YOLOv8] Support PaddleYOLOv8 on Kunlunxin&Ascend

* [YOLOv8] Add PaddleYOLOv8 model download links

* [YOLOv8] Add PaddleYOLOv8 Box AP

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>
Co-authored-by: Zheng-Bicheng <58363586+Zheng-Bicheng@users.noreply.github.com>
Co-authored-by: Jason <928090362@qq.com>
Co-authored-by: Qianhe Chen <54462604+chenqianhe@users.noreply.github.com>
2023-01-16 13:15:24 +08:00
..
2022-12-29 11:09:26 +00:00
2022-12-29 11:09:26 +00:00

FastDeploy Benchmarks

在跑benchmark前需确认以下两个步骤

FastDeploy 目前支持多种推理后端,下面以 PaddleClas MobileNetV1 为例,跑出多后端在 CPU/GPU 对应 benchmark 数据

# 下载 MobileNetV1 模型
wget https://bj.bcebos.com/paddlehub/fastdeploy/MobileNetV1_x0_25_infer.tgz
tar -xvf MobileNetV1_x0_25_infer.tgz

# 下载图片
wget https://gitee.com/paddlepaddle/PaddleClas/raw/release/2.4/deploy/images/ImageNet/ILSVRC2012_val_00000010.jpeg

# CPU
# Paddle Inference
python benchmark_ppcls.py --model MobileNetV1_x0_25_infer --image ILSVRC2012_val_00000010.jpeg --cpu_num_thread 8 --iter_num 2000 --backend paddle

# ONNX Runtime
python benchmark_ppcls.py --model MobileNetV1_x0_25_infer --image ILSVRC2012_val_00000010.jpeg --cpu_num_thread 8 --iter_num 2000 --backend ort

# OpenVINO
python benchmark_ppcls.py --model MobileNetV1_x0_25_infer --image ILSVRC2012_val_00000010.jpeg --cpu_num_thread 8 --iter_num 2000 --backend ov

# GPU
# Paddle Inference
python benchmark_ppcls.py --model MobileNetV1_x0_25_infer --image ILSVRC2012_val_00000010.jpeg --device gpu --iter_num 2000 --backend paddle

# Paddle Inference + TensorRT
python benchmark_ppcls.py --model MobileNetV1_x0_25_infer --image ILSVRC2012_val_00000010.jpeg --device gpu --iter_num 2000 --backend paddle_trt

# Paddle Inference + TensorRT fp16
python benchmark_ppcls.py --model MobileNetV1_x0_25_infer --image ILSVRC2012_val_00000010.jpeg --device gpu --iter_num 2000 --backend paddle_trt --enable_trt_fp16 True

# ONNX Runtime
python benchmark_ppcls.py --model MobileNetV1_x0_25_infer --image ILSVRC2012_val_00000010.jpeg --device gpu --iter_num 2000 --backend ort

# TensorRT
python benchmark_ppcls.py --model MobileNetV1_x0_25_infer --image ILSVRC2012_val_00000010.jpeg --device gpu --iter_num 2000 --backend trt

# TensorRT fp16
python benchmark_ppcls.py --model MobileNetV1_x0_25_infer --image ILSVRC2012_val_00000010.jpeg --device gpu --iter_num 2000 --backend trt --enable_trt_fp16 True

具体参数说明

参数 作用
--model 模型路径
--image 图片路径
--device 选择 CPU 还是 GPU默认 CPU
--cpu_num_thread CPU 线程数
--device_id GPU 卡号
--iter_num 跑 benchmark 的迭代次数
--backend 指定后端类型有ort, ov, trt, paddle, paddle_trt 五个选项
--enable_trt_fp16 当后端为trt或paddle_trt时是否开启fp16
--enable_collect_memory_info 是否记录 cpu/gpu memory信息默认 False

最终txt结果

将当前目录的所有txt汇总并结构化执行下列命令

# 汇总
cat *.txt >> ./result_ppcls.txt

# 结构化信息
python convert_info.py --txt_path result_ppcls.txt --domain ppcls --enable_collect_memory_info True

得到 CPU 结果struct_cpu_ppcls.txt以及 GPU 结果struct_gpu_ppcls.txt如下所示

# struct_cpu_ppcls.txt
model_name	thread_nums	ort_run	ort_end2end	cpu_rss_mb	ov_run	ov_end2end	cpu_rss_mb	paddle_run	paddle_end2end	cpu_rss_mb
MobileNetV1_x0_25	8	1.18	3.27	270.43	0.87	1.98	272.26	3.13	5.29	899.57

# struct_gpu_ppcls.txt
model_name	ort_run	ort_end2end	gpu_rss_mb	paddle_run	paddle_end2end	gpu_rss_mb	trt_run	trt_end2end	gpu_rss_mb	trt_fp16_run	trt_fp16_end2end	gpu_rss_mb
MobileNetV1_x0_25	1.25	3.24	677.06	2.00	3.77	945.06	0.67	2.66	851.06	0.53    2.46	839.06

结果说明

  • _run后缀代表一次infer耗时包括H2D以及D2H_end2end后缀代表包含前后处理耗时
  • cpu_rss_mb代表内存占用;gpu_rss_mb代表显存占用

若有多个PaddleClas模型在当前目录新建ppcls_model目录将所有模型放入该目录即可运行下列命令

sh run_benchmark_ppcls.sh

一键得到所有模型在 CPU 以及 GPU 的 benchmark 数据

添加新设备

如果添加了一种新设备,想进行 benchmark 测试,以ipu为例

在对应 benchmark 脚本--device中加入ipu选项,并通过option.use_ipu()进行开启

输入下列命令,进行 benchmark 测试

python benchmark_ppcls.py --model $model --image ILSVRC2012_val_00000010.jpeg --iter_num 2000 --backend paddle --device ipu