Skip to content

Conversation

@wanghuancoder
Copy link
Contributor

@wanghuancoder wanghuancoder commented Jan 25, 2024

PR types

New features

PR changes

Others

Description

Pcard-67164
pir onednn 支持conv2d_transpose,conv2d_transpose_bias。
并支持conv2d_transpose_bias_fuse_pass。

#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"
Copy link
Contributor

Choose a reason for hiding this comment

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

build前缀需要删去

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的好的,感谢感谢。现在每次从icoding里复制文件路径都带build,汗

Comment on lines +77 to +86
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());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

ArrayAttribute转普通vector有没有提供一些工具函数,用公共函数能省不少行

Copy link
Contributor

Choose a reason for hiding this comment

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

这一块我觉得可以放在pattern实现里的

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个是从生成的代码里copy过来的。这样的工具函数暂时没有。先写成这样吧。

Copy link
Contributor Author

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(),
Copy link
Contributor

@winter-wang winter-wang Mar 7, 2024

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

@wanghuancoder wanghuancoder merged commit b90de4d into PaddlePaddle:develop Mar 7, 2024
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.

7 participants