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

Implement a pass detect fusion group of elementwise op #19884

Merged
merged 12 commits into from
Oct 29, 2019

Conversation

Xreki
Copy link
Contributor

@Xreki Xreki commented Sep 19, 2019

Two cases are given in fusion_group_pass_tester.

Case 1

  • Before

  • After

Case 2

  • Before

  • After

input_names.push_back(n->Name());
external_nodes.insert(n);
}
op_desc.SetInput("Xs", input_names);
Copy link
Contributor

Choose a reason for hiding this comment

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

Xs可以改成Inputs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

名字需要与fusion_group op的Maker定义一致,我在实现fusion_group op的PR里面改吧。

namespace fusion_group {

struct SubGraph {
int type{-1};
Copy link
Contributor

Choose a reason for hiding this comment

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

SubGraph 有哪几种type 改成enum 方式可以更清晰直观点

Copy link
Contributor Author

Choose a reason for hiding this comment

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

后面肯定要引入不同的type的,但目前我们只支持elementwise类型,所以先用int,后面再改吧。

@Xreki Xreki merged commit b5f3be8 into PaddlePaddle:develop Oct 29, 2019
seiriosPlus pushed a commit to seiriosPlus/Paddle that referenced this pull request Dec 9, 2019
…19884)

* Add fusion_group_pass and elementwise pattern.

* Rewrite the detector of elementwise group.
test=develop

* Add a comment in codegen.

* Add more unittest cases.
test=develop

* Move code_generator related code to fusion_group directory.

* Correct the including path.

* Add the definition of SubGraph and finish the insert of fusion_group op in pass.

* Insert graph_vis_pass in tester to visualize the graph for debug.
seiriosPlus pushed a commit to seiriosPlus/Paddle that referenced this pull request Dec 9, 2019
…19884)

* Add fusion_group_pass and elementwise pattern.

* Rewrite the detector of elementwise group.
test=develop

* Add a comment in codegen.

* Add more unittest cases.
test=develop

* Move code_generator related code to fusion_group directory.

* Correct the including path.

* Add the definition of SubGraph and finish the insert of fusion_group op in pass.

* Insert graph_vis_pass in tester to visualize the graph for debug.
@Xreki Xreki deleted the pass_fusion_group branch January 7, 2020 08:28
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.

None yet

2 participants