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

Add unsigned int8 scale propagation #46378

Merged
merged 5 commits into from
Oct 13, 2022

Conversation

wozna
Copy link
Contributor

@wozna wozna commented Sep 21, 2022

PR types

New features

PR changes

Others

Describe

I found out that in cpu_quantize_squash_pass there was check to prevent squashing dequantize and quantize with different data type (int8/uint8) but it was not working correctly. In compute_propagate_scales_mkldnn_pass we have scale propagation so eg. scale before reshape2 is applied after reshape var but the type (uint8 or int8) weren't applied.
This PR fixes picodet int8 acc drop #44075 and fixes concat error in #45970

@paddle-bot
Copy link

paddle-bot bot commented Sep 21, 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.

@wozna wozna requested a review from sfraczek September 23, 2022 07:21
@wozna
Copy link
Contributor Author

wozna commented Sep 26, 2022

@sfraczek @zuzg Can I ask you for a review?

zuzg
zuzg previously approved these changes Sep 28, 2022
Copy link
Contributor

@sfraczek sfraczek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few small suggestions

for (auto& var_name : variable_names) {
auto iter = var_quant_scales->find(var_name);
ASSERT_NE(iter, var_quant_scales->end());
ASSERT_EQ((*var_quant_scales)[var_name].first, true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could perhaps reuse iter here but it's okay.

paddle/fluid/framework/ir/mkldnn/mkldnn_pass_util.h Outdated Show resolved Hide resolved
paddle/fluid/framework/ir/mkldnn/mkldnn_pass_util.h Outdated Show resolved Hide resolved
Copy link
Contributor

@yeliang2258 yeliang2258 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yeliang2258 yeliang2258 requested review from sfraczek and zuzg and removed request for zuzg October 12, 2022 09:48
@yeliang2258
Copy link
Contributor

@wozna Hello, does this PR still need to be updated? do you need us to merge

@wozna
Copy link
Contributor Author

wozna commented Oct 12, 2022

@wozna Hello, does this PR still need to be updated? do you need us to merge

@yeliang2258 It is ready to be merged.

@wozna wozna requested review from jczaja and removed request for zuzg October 12, 2022 13:32
@jiangjiajun jiangjiajun merged commit c72b3bf into PaddlePaddle:develop Oct 13, 2022
@paddle-bot-old paddle-bot-old bot removed the contributor External developers label Oct 17, 2022
ZeyuChen pushed a commit that referenced this pull request Oct 19, 2022
* Add unsigned int8 propagation

* Add or modify unit tests

* Correct concat scale checking

* Apply review suggestions

* Corrections

Co-authored-by: joanna.wozna.intel <[email protected]>
@wozna wozna deleted the concat_acc_fix branch February 24, 2023 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants