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

Correct MultipleQuantizeSquash #40717

Merged
merged 2 commits into from
Mar 24, 2022

Conversation

wozna
Copy link
Contributor

@wozna wozna commented Mar 18, 2022

PR types

Bug fixes

PR changes

Others

Describe

This fixed the problem with running the yolov3_darknet model.

This PR corrects MultipleQuantizeSquash in cpu_quantize_squash_pass.cc.
It turned out that this mechanism didn't support the situation when under one input name are many inputs (eg. concat, sum).
Before new inputs for the next operators were created, now we just updating the next operator input.

Moreover, I added setting mkldnn_data_type to float32 if the operator is not quantised, because before even if the operator wasn't quantized this attribute was set to int8.

@paddle-bot-old paddle-bot-old bot added contributor External developers status: proposed labels Mar 18, 2022
@paddle-bot-old
Copy link

你的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.

@lidanqing-intel
Copy link
Contributor

lidanqing-intel commented Mar 21, 2022

@wozna Hi, Does all daily CI models could all pass? Or the coverage CI should test all the models?

@@ -45,6 +45,7 @@ void LogCannotQuantizeOp(Node* op, const char* details = nullptr) {
<< " (type: " << op->Op()->Type() << ", id: " << op->id() << ").";
if (details) msg_ss << " " << details;
PrettyLogDetail(msg_ss.str().c_str());
op->Op()->SetAttr("mkldnn_data_type", std::string("float32"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Later on, could we refactor these log functions? It looks VLOG(4) is enough for these log functions?

Copy link
Contributor

Choose a reason for hiding this comment

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

Does function below void LogQuantizationDisabled(Node* op) maybe also need to set "mkldnn_data_type", std::string("float32") ?

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.

LGTM!

Copy link
Contributor

@lidanqing-intel lidanqing-intel left a comment

Choose a reason for hiding this comment

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

LGTM

@lidanqing-intel
Copy link
Contributor

Hi, @jczaja please review. This PR need one more approval to merge. Thanks

Copy link
Contributor

@jczaja jczaja left a comment

Choose a reason for hiding this comment

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

LGTM

@lidanqing-intel lidanqing-intel merged commit 753964a into PaddlePaddle:develop Mar 24, 2022
@paddle-bot-old
Copy link

你的PR已合入Paddle库,请关注后续测试结果。
Your PR has been merged into the repository. An official integration test will be conducted later. Stay tuned.

piotrekobi pushed a commit to piotrekobi/Paddle that referenced this pull request Mar 29, 2022
* Correct MultipleQuantizeSquash

* Correct logging
@paddle-bot-old paddle-bot-old bot removed the contributor External developers label Oct 17, 2022
@wozna wozna deleted the yolov3_darknet_fix branch February 24, 2023 16:09
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.

4 participants