Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

Fix quantize model deploy bugs when using MKLDNN

Open yeliang2258 opened this issue 3 years ago • 1 comments

PR types

Bug fixes

PR changes

Others

Describe

Fix ppyoloe、MobileNetV3_large、Ernie 3.0-Medium and bert acc drop bugs.

  1. Avoid the problem that the weights are quantize and dequantized multiple times when multiple conv2d share the same weight. Weight names in the picodet model: conv2d_160.w_0.quantized.dequantized

  2. Fix immutable op quantize bugs in MKLDNN. Similar to the following combination, the output of shape is int32 type, if the slice is quantized, an error will be reported. Therefore, I add a judgment, If the input of the OP to be quantized is not float32 type, the OP will not be quantized.

image

  1. Fix the bug of OP's weight dequantization such as matmul and fc in MobileNetV3_large and Ernie 3.0-Medium.

The model is: https://bj.bcebos.com/v1/paddle-slim-models/act/ppyoloe_crn_l_300e_coco_quant.tar

yeliang2258 avatar Sep 09 '22 07:09 yeliang2258

你的PR提交成功,感谢你对开源项目的贡献! 请关注后续CI自动化测试结果,详情请参考Paddle-CI手册。 Your PR has been submitted. Thanks for your contribution! Please wait for the result of CI firstly. See Paddle CI Manual for details.

paddle-bot[bot] avatar Sep 09 '22 07:09 paddle-bot[bot]