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

[Optimizer]: add quick gelu fusion pass for ViT model. #9718

Closed

Conversation

stevenshen36
Copy link
Contributor

No description provided.

@paddle-bot
Copy link

paddle-bot bot commented Nov 18, 2022

Thanks for your contribution!

@CLAassistant
Copy link

CLAassistant commented Nov 18, 2022

CLA assistant check
All committers have signed the CLA.

@stevenshen36 stevenshen36 force-pushed the quick_gelu_passes_new branch 3 times, most recently from a2a25a4 to 45b5712 Compare November 21, 2022 02:50
@stevenshen36 stevenshen36 force-pushed the quick_gelu_passes_new branch 2 times, most recently from 5a95eb8 to 94a0e00 Compare November 21, 2022 06:06
zhupengyang
zhupengyang previously approved these changes Nov 21, 2022
Copy link
Collaborator

@zhupengyang zhupengyang left a comment

Choose a reason for hiding this comment

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

LGTM

@linwei210
Copy link
Contributor

LGTM

Copy link
Collaborator

@zhupengyang zhupengyang left a comment

Choose a reason for hiding this comment

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

LGTM

其它问题后面一个PR一起改下吧

Comment on lines +39 to +40
bool has_act = const_cast<Node*>(node)->AsStmt().op_info()->HasAttr(
"activation_type");
Copy link
Collaborator

Choose a reason for hiding this comment

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

node->stmt()
尽量不要用 const_cast

}

cpp::OpDesc GenOpDesc(const key2nodes_t& matched) {
auto op_desc = *matched.at("scale")->stmt()->op_info();
Copy link
Collaborator

Choose a reason for hiding this comment

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

两个算子的定义完全不同,没必要复用 op_info。更好的做法是新建一个 OpInfo

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