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

[PIR] pir onednn add conv_bias_pass #61137

Merged

Conversation

wanghuancoder
Copy link
Contributor

@wanghuancoder wanghuancoder commented Jan 24, 2024

PR types

New features

PR changes

Others

Description

Pcard-67164
PIR-OneDNN的首个Pass。
建立相关机制。完成conv2d_bias_fuse_pass的开发和测试。
conv2d_bias_fuse_pass等同于老静态图中的paddle/fluid/framework/ir/mkldnn/conv_bias_mkldnn_fuse_pass.cc里的conv_bias_mkldnn_fuse_pass。

Copy link

paddle-bot bot commented Jan 24, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

def setUp(self):
self.places.append(paddle.CPUPlace())
# todo(bukejiyu): This pass will support accuracy verification in the future
self.skip_accuracy_verification = True
Copy link
Contributor

Choose a reason for hiding this comment

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

你这里精度验证也是失败的?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

我抄的别人的,这里关掉。我以为全关掉呢。我给打开了。

@@ -0,0 +1,167 @@
# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

2024

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

add_custom_command(
OUTPUT ${onednn_op_creator_file}
COMMAND
${PYTHON_EXECUTABLE} ${op_creator_gen_file} --op_yaml_files
Copy link
Contributor

Choose a reason for hiding this comment

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

onednn op的创建也需要op_yaml_files吗?这里的逻辑和53-69行的逻辑是不是在创建pd op的部分重复了?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

onednn op的创建也需要op_yaml_files。因为ops_onednn_extra.yaml中只有补充信息,主要的OP信息还是在原来的ops.yaml中,需要复用。

pat.Tensor("add_out") = add(pat.Tensor("conv2d_out"), pat.Tensor("bias"));

pat.RequireNativeCall([&](const paddle::drr::MatchContext &match_ctx) {
std::set<std::string> padding_algorithm = {"EXPLICIT", "SAME", "VALID"};
Copy link
Contributor

Choose a reason for hiding this comment

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

unordered_set或者vector是不是就可以?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

我觉得,这里还是set最适合。

Comment on lines +117 to +118
std::set<std::string> padding_algorithm = {"EXPLICIT", "SAME", "VALID"};
std::set<std::string> data_format = {"NCHW", "NHWC", "AnyLayout"};
Copy link
Contributor

Choose a reason for hiding this comment

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

同上

Copy link
Contributor

@yuanlehome yuanlehome left a comment

Choose a reason for hiding this comment

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

LGTM

@wanghuancoder wanghuancoder merged commit 74cdbec into PaddlePaddle:develop Jan 29, 2024
30 checks passed
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

3 participants