-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[PIR] pir onednn support conv2d_transpose #61165
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
[PIR] pir onednn support conv2d_transpose #61165
Conversation
… pir_onednn_conv2d_transpose
…e/Paddle into pir_onednn_conv2d_transpose
… pir_onednn_conv2d_transpose
| #include "paddle/pir/include/core/operation.h" | ||
| #include "paddle/pir/include/core/value.h" | ||
| #ifdef PADDLE_WITH_DNNL | ||
| #include "build/paddle/fluid/pir/dialect/operator/ir/onednn_op.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build前缀需要删去
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的好的,感谢感谢。现在每次从icoding里复制文件路径都带build,汗
| std::vector<int> strides; | ||
| for (size_t i = 0; | ||
| i < attrs.at("strides").dyn_cast<pir::ArrayAttribute>().size(); | ||
| i++) { | ||
| strides.push_back(attrs.at("strides") | ||
| .dyn_cast<pir::ArrayAttribute>() | ||
| .at(i) | ||
| .dyn_cast<pir::Int32Attribute>() | ||
| .data()); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ArrayAttribute转普通vector有没有提供一些工具函数,用公共函数能省不少行
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这一块我觉得可以放在pattern实现里的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是从生成的代码里copy过来的。这样的工具函数暂时没有。先写成这样吧。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这一块我觉得可以放在pattern实现里的
pattern是负责匹配的。匹配阶段好像只有“描述”信息,没有实例化Operation。pattern能实现承载这个逻辑吗?
| .data()); | ||
| } | ||
|
|
||
| IR_ENFORCE(attrs.find("padding_algorithm") != attrs.end(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
禁止使用IR_ENFORCE, 这儿需要改成PADDLE_ENFORCE_EQ。其它地方类似。具体参考https://github.com/PaddlePaddle/Paddle/wiki/PADDLE_ENFORCE-Rewriting-Specification
PR types
New features
PR changes
Others
Description
Pcard-67164
pir onednn 支持conv2d_transpose,conv2d_transpose_bias。
并支持conv2d_transpose_bias_fuse_pass。