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 fusepass Reshape2MatmulFusePass AdaptivePool2dConvertGlobalPass #33555

Merged
merged 25 commits into from
Jun 28, 2021

Conversation

LDOUBLEV
Copy link
Contributor

@LDOUBLEV LDOUBLEV commented Jun 15, 2021

PR types

Bug fixes

PR changes

Others

Describe

rename transpose.pbtxt

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@LDOUBLEV LDOUBLEV changed the title fix Transpose opdef name add fusepass Reshape2MatmulFusePass AdaptivePool2dConvertGlobalPass Jun 15, 2021
.AddAttr("adaptive")
.IsBoolEQ(false)
.End()
.AddAttr("ceil_mode")
Copy link
Contributor

Choose a reason for hiding this comment

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

ceil_mode缺乏属性约束

Copy link
Contributor Author

Choose a reason for hiding this comment

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

global pooling的时候ceil_mode不起作用了,增加了isOptional 约束

Copy link
Contributor

Choose a reason for hiding this comment

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

ceil_mode需要条件IsType()约束

.End()
.AddAttr("data_format")
.End()
.AddAttr("padding_algorithm")
Copy link
Contributor

Choose a reason for hiding this comment

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

padding_algorithm缺乏属性约束

Copy link
Contributor

Choose a reason for hiding this comment

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

padding_algoritm需要补充一个IsStringIn()的约束

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

.End()
.AddAttr("ceil_mode")
.End()
.AddAttr("data_format")
Copy link
Contributor

Choose a reason for hiding this comment

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

data_format缺乏属性约束

Copy link
Contributor Author

Choose a reason for hiding this comment

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

增加了.IsStringIn({"NHWC", "NCHW"})约束

@@ -159,6 +159,58 @@ void Squeeze2MatmulFusePass::ApplyImpl(ir::Graph* graph) const {
AddStatis(found_count);
}

Reshape2MatmulFusePass::Reshape2MatmulFusePass() {
AddOpCompat(OpCompat("reshape2"))
.AddInput("X")
Copy link
Contributor

Choose a reason for hiding this comment

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

reshape2.pbtxt之前写的有点问题,请参考 #33614 更新reshape2的属性

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thx,已修改

.End()
.AddAttr("data_format")
.End()
.AddAttr("padding_algorithm")
Copy link
Contributor

Choose a reason for hiding this comment

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

padding_algoritm需要补充一个IsStringIn()的约束

Copy link
Contributor

@winter-wang winter-wang left a comment

Choose a reason for hiding this comment

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

我们在兼容性判断中新添加了 IsType<@type@>()的类型约束,在此之后的pass的attribute的约束条件,除非已经有了 IsStringIn之类的已经约束了类型的前置条件,否则都需要添加 类型约束。

.AddAttr("adaptive")
.IsBoolEQ(false)
.End()
.AddAttr("ceil_mode")
Copy link
Contributor

Choose a reason for hiding this comment

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

ceil_mode需要条件IsType()约束

.IsTensor()
.End()
.AddAttr("shape") // ints
.End();
Copy link
Contributor

Choose a reason for hiding this comment

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

shape需要添加类型约束

Copy link
Contributor

@winter-wang winter-wang left a comment

Choose a reason for hiding this comment

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

LGTM

@ceci3 ceci3 merged commit 55aea35 into PaddlePaddle:develop Jun 28, 2021
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.

4 participants