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

support auto generate for prelu #51913

Merged

Conversation

Ainavo
Copy link
Contributor

@Ainavo Ainavo commented Mar 21, 2023

PR types

Others

PR changes

Others

Describe

@paddle-bot paddle-bot bot added the contributor External developers label Mar 21, 2023
@Ainavo Ainavo changed the title [仅测试]support auto generate for prelu support auto generate for prelu Mar 22, 2023
paddle/phi/api/yaml/op_compat.yaml Outdated Show resolved Hide resolved
paddle/phi/api/yaml/ops.yaml Show resolved Hide resolved
paddle/phi/api/yaml/backward.yaml Show resolved Hide resolved
@heavyrain-lzy
Copy link
Contributor

rerun一下相关CI,关注一下test_prelu_mkldnn_op单测,可以在build目录下执行ctest -R test_prelu_mkldnn_op -V@Ainavo

@@ -1089,6 +1089,16 @@
data_type : x
backward : pow_grad

- op : prelu
Copy link
Contributor

Choose a reason for hiding this comment

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

查看ci-coverage, 这个错误可能是由test_dropout_nd_op.py引入的,目前已经屏蔽了这个单测,可以再rerun一下相关CI

Copy link
Contributor Author

@Ainavo Ainavo Mar 28, 2023

Choose a reason for hiding this comment

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

查看ci-coverage, 这个错误可能是由test_dropout_nd_op.py引入的,目前已经屏蔽了这个单测,可以再rerun一下相关CI

您好,之前 ci-coverage 的报错
我直接重新 re-run 也 ci-coverage 会有同样报错,然后在本地 develop 分支使用 git pull 拉取了最新的代码,并在本地该分支使用 git merge develop 命令,自动触发 ci, 得到同样报错

Copy link
Contributor

Choose a reason for hiding this comment

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

查看ci-coverage, 这个错误可能是由test_dropout_nd_op.py引入的,目前已经屏蔽了这个单测,可以再rerun一下相关CI

您好,之前 ci-coverage 的报错 我直接重新 re-run 也 ci-coverage 会有同样报错,然后在本地 develop 分支使用 git pull 拉取了最新的代码,并在本地该分支使用 git merge develop 命令,自动触发 ci, 得到同样报错

随后我会在本地调试协助解决bug,你可以继续认领其他任务

Copy link
Contributor Author

Choose a reason for hiding this comment

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

查看ci-coverage, 这个错误可能是由test_dropout_nd_op.py引入的,目前已经屏蔽了这个单测,可以再rerun一下相关CI

您好,之前 ci-coverage 的报错 我直接重新 re-run 也 ci-coverage 会有同样报错,然后在本地 develop 分支使用 git pull 拉取了最新的代码,并在本地该分支使用 git merge develop 命令,自动触发 ci, 得到同样报错

随后我会在本地调试协助解决bug,你可以继续认领其他任务

好的

args : (Tensor x, Tensor alpha, Tensor out_grad, str data_format, str mode)
output : Tensor(x_grad), Tensor(alpha_grad)
infer_meta :
func : GeneralBinaryGradInferMeta
Copy link
Contributor

Choose a reason for hiding this comment

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

mkldnn失败的原因已确定,这里的不能直接使用GeneralBinaryGradInferMeta,需要新增函数。建议如下:

  1. 这里修改为PreluGradInferMeta
  2. paddle/phi/infermeta/backward.cc文件的PixelUnshuffleGradInferMeta函数后面增加函数
void PreluGradInferMeta(const MetaTensor& x,
                        const MetaTensor& y,
                        MetaTensor* dx,
                        MetaTensor* dy) {
  if (dx) {
    dx->share_dims(x);
  }
  if (dy) {
    dy->share_dims(y);
  }
}
  1. 在头文件paddle/phi/infermeta/backward.hPixelUnshuffleGradInferMeta函数后面增加函数声明
void PreluGradInferMeta(const MetaTensor& x,
                        const MetaTensor& y,
                        MetaTensor* dx,
                        MetaTensor* dy);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

2. PixelUnshuffleGradInferMeta

收到,已添加

@Ainavo
Copy link
Contributor Author

Ainavo commented Mar 30, 2023

ci 已过,辛苦 @heavyrain-lzy review 一下~

Copy link
Contributor

@heavyrain-lzy heavyrain-lzy left a comment

Choose a reason for hiding this comment

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

LGTM。这个难度较大,能够完成十分优秀 👍

@luotao1 luotao1 merged commit d1c7b38 into PaddlePaddle:develop Mar 30, 2023
@Ainavo Ainavo deleted the support_auto_generate_for_prelu branch March 30, 2023 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants