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

【prim】Maximum grad #51006

Merged
merged 51 commits into from
Mar 13, 2023
Merged

【prim】Maximum grad #51006

merged 51 commits into from
Mar 13, 2023

Conversation

heyanru01
Copy link
Contributor

@heyanru01 heyanru01 commented Feb 28, 2023

PR types

Others

PR changes

Others

Describe

Maximum grad composite rule
close broadcast comp test while with no support for axis != 1

check_prim=False in TestElementwiseBF16Op,
cause bfloat16 is not supported in less_equal

@paddle-bot
Copy link

paddle-bot bot commented Feb 28, 2023

你的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.

Copy link
Contributor

@Charles-hit Charles-hit left a comment

Choose a reason for hiding this comment

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

axis只有为-1或者未设置的时候才可以check_eager和check_prim,可以在TestElementwiseOp中写一个函数判断是否有axis并且axis是否为-1来决定check_eager和check_prim的参数,不需要在每个子类中进行一些逻辑的复制重写。

@heyanru01
Copy link
Contributor Author

axis只有为-1或者未设置的时候才可以check_eager和check_prim,可以在TestElementwiseOp中写一个函数判断是否有axis并且axis是否为-1来决定check_eager和check_prim的参数,不需要在每个子类中进行一些逻辑的复制重写。
done

Copy link
Contributor

@xiaoguoguo626807 xiaoguoguo626807 left a comment

Choose a reason for hiding this comment

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

LGTM

Tensor* y_grad) {
if (x_grad) {
auto x_tmp = cast<T>(greater_than<T>(x, y), out_grad.dtype());
auto dx_res = out_grad * x_tmp;
Copy link
Contributor

Choose a reason for hiding this comment

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

make sure logic the same with kernel when x equal to y

Copy link
Contributor Author

Choose a reason for hiding this comment

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

test x = y in #51568

@Charles-hit Charles-hit merged commit 4a48497 into PaddlePaddle:develop Mar 13, 2023
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.

5 participants