-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
picodet交叉编译后部署在arm上四核推理,量化后的模型反而推理速度更慢了 #10626
Comments
建议参考文档:https://www.paddlepaddle.org.cn/lite/v2.12/user_guides/profiler.html。 |
文档不存在 |
https://www.paddlepaddle.org.cn/lite/v2.12/user_guides/profiler.html |
谢谢大佬,这个带Profiler工具的推理库在发布的各版本inference_lite_lib里没有吧,得自己编译? |
默认是不开启的,请参考对应的源码编译文档加上--with_profile=ON选项进行编译。 |
@MuShangCC 大佬我用profile看了一下测速,不知道为啥量化训练后反而网络层数更多了,而且有相同层耗时还增加了,能麻烦您看一下吗 |
模型发一下?网络层数没有增加啊 |
无量化模型picodet_xs_320_voc_lcnet 量化后模型picodet_xs_320_voc_lcnet_quant 大佬这个和部署的平台有关系吗?我模型参数都没调整,只是进行了量化训练而已。 |
跟硬件当然有关系,Lite对A53处理器的conv_3x3s2_direct_fp32有优化实现,从四核的 Profiler 结果看,conv2d 算子的 int8 量化收益已经不明显了。量化插入的 calib 算子以及量化之后不能融合的hard-swish算子导致耗时反倒增加了,建议别做量化了。 |
大佬那还有什么方式能进行提速呢?目前最小参数模型xs在arm上四核的速度才15FPS,单核才5FPS,距离发布的四核150FPS还差好远 |
硬件环境说清楚吧,150 FPS 这个是哪来的? |
aarch64 GNU/Linux |
你这硬件环境也不一样,精度也不一样。。。。 |
是的,但是不知道为啥差距这么大。。。。快10倍的差距了 |
至少精度保持一致再比较啊,跑过 FP16 吗?也设置了4个线程吗? |
都是4线程,之前paddle_lite_opt转换时设置为fp16几乎没有太多提升 |
可能就硬件上的差距呗 |
1)配置版本:paddlelite2.14rc
2)系统环境:ubuntu交叉编译,arm上部署
1)模型名称:picodet
1)训练配置:-c configs/picodet/picodet_xs_320_voc_lcnet.yml
2)训练量化:--slim_config configs/slim/quant/picodet_xs_320_lcnet_quant.yml
3)转换量化:paddle_lite_opt --model_dir=infer_model_params/picodet_xs_320_lcnet_quant --optimize_out_type=naive_buffer --quant_model=true --quant_type=QUANT_INT8 --valid_targets=arm --optimize_out=lite_model/model_quant
4)无量化模型部署信息
model.nb文件大小3.0M
单核Prediction time: 196.392800 ms
四核Prediction time: 63.681800 ms
5)量化后模型部署信息
model.nb文件大小1.3M
单核Prediction time: 182.649800 ms
四核Prediction time: 73.184100 ms
量化后模型参数量确实缩小了很多,单核的检测速率也有所提升(提升幅度较小,并没有达到说明文档里提速>30%的效果),但四核的检测速率反而下降了很多,希望大佬解答一下是哪个环节出问题了导致量化后速率没有明显提升。
The text was updated successfully, but these errors were encountered: