Skip to content
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

Fix quantize model deploy bugs when using MKLDNN #45920

Merged
merged 34 commits into from
Oct 13, 2022
Merged

Fix quantize model deploy bugs when using MKLDNN #45920

merged 34 commits into from
Oct 13, 2022

Conversation

yeliang2258
Copy link
Contributor

@yeliang2258 yeliang2258 commented Sep 9, 2022

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

@paddle-bot
Copy link

paddle-bot bot commented Sep 9, 2022

你的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-old paddle-bot-old bot added the contributor External developers label Sep 13, 2022
@yeliang2258 yeliang2258 changed the title Fix immutable op quantize bugs in MKLDNN Fix quantized ppyoloe acc drop bugs in MKLDNN Sep 14, 2022
@yeliang2258 yeliang2258 changed the title Fix quantized ppyoloe acc drop bugs in MKLDNN Fix quantized ppyoloe acc drop bugs when deploy using MKLDNN Sep 14, 2022
@yeliang2258 yeliang2258 changed the title Fix quantized ppyoloe acc drop bugs when deploy using MKLDNN Fix quantize model deploy bugs when using MKLDNN Sep 15, 2022
@paddle-bot-old paddle-bot-old bot removed the contributor External developers label Sep 15, 2022
@yeliang2258 yeliang2258 requested a review from wozna October 8, 2022 03:10
@jiangjiajun jiangjiajun merged commit 561fd8c into PaddlePaddle:develop Oct 13, 2022
ZeyuChen pushed a commit that referenced this pull request Oct 20, 2022
* Fix quantize model deploy bugs when using MKLDNN (#45920)

* fix immutable op quantize bugs

* fix

* fix build bug

* fix test

* notest,test=inference

* fix ppyoloe acc drop bugs

* fix test

* fix test

* add test

* fix

* fix

* fix test

* fix refined name bug

* fix test

* bias fix

* fix matmul weight dequant bug

* re-ci

* fix tester

* fix test

* fix tester

* update weight dequantize func

* update code

* update test for converage

* update test

* update cmake

* update cmakelist

* update code

* rerun ci

* remove useless code

* re-ci

* update code

* update code

* fix header

* update code for log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants