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 mul bugs #7964

Merged
merged 9 commits into from
Jan 17, 2022
Merged

fix mul bugs #7964

merged 9 commits into from
Jan 17, 2022

Conversation

xingjing1
Copy link
Collaborator

No description provided.

@paddle-bot-old
Copy link

Thanks for your contribution!

chenjiaoAngel
chenjiaoAngel previously approved these changes Jan 4, 2022
Copy link
Collaborator

@chenjiaoAngel chenjiaoAngel left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -518,7 +518,9 @@ void QuantDequantOpFuser::InsertNewNode(SSAGraph* graph,
op_info.UpdateAllInputs(output_var_name, input_var_name);
op_info.SetAttr<int>("bit_length", bit_length);
#ifndef LITE_WITH_FPGA
op_info.SetAttr("enable_int8", true);
std::string op_type = op_info.Type();
if (op_type == "matmul") op_info.SetAttr("enable_int8", true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个地方建议在头文件定义一个std::vectorstd::string op_types_ 数组,然后判断当前 OP 是否在这个List 里。这样后续有其他OP 支持,只用在vector 添加op_type 即可
*.h : std::vectorstd::string op_types_{"matmul"};
*.cc
if (op_type != op_types_.end()) {
op_info.SetAttr("enable_int8", true);
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

好的

#ifndef LITE_WITH_FPGA
op_info.SetAttr("enable_int8", true);
std::vector<std::string> input_activation_quant_op = {"matmul"};
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个放在头文件,作为私有成员变量使用

Copy link
Collaborator

@chenjiaoAngel chenjiaoAngel left a comment

Choose a reason for hiding this comment

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

LGTM

@chenjiaoAngel chenjiaoAngel merged commit 0349642 into PaddlePaddle:develop Jan 17, 2022
WeiLi233 pushed a commit to WeiLi233/Paddle-Lite that referenced this pull request Mar 29, 2022
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.

2 participants