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

feat: add relu composite #50819

Merged
merged 13 commits into from
Mar 8, 2023
Merged

Conversation

Miracle2333
Copy link
Contributor

@Miracle2333 Miracle2333 commented Feb 23, 2023

PR types

New features

PR changes

APIs

Describe

add composite rule of relu

@paddle-bot
Copy link

paddle-bot bot commented Feb 23, 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.

@paddle-bot
Copy link

paddle-bot bot commented Feb 23, 2023

❌ The PR is not created using PR's template. You can refer to this Demo.
Please use PR's template, it helps save our maintainers' time so that more developers get helped.

@REGISTER_COMPOSITE('relu')
def relu_composite(x):
"""define composite rule of op relu"""
# # /* relu(x) = max(x, 0) */ copy from relu-kernel.cc
Copy link
Contributor

Choose a reason for hiding this comment

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

polish comment

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

@Miracle2333 Miracle2333 marked this pull request as draft February 23, 2023 10:28
@Miracle2333 Miracle2333 marked this pull request as ready for review February 23, 2023 10:30
Copy link
Contributor

@JiabinYang JiabinYang left a comment

Choose a reason for hiding this comment

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

some comments

def relu_composite(x):
"""define composite rule of op relu"""
# relu(x) = max(x, 0)
return maximum(0, x)
Copy link
Contributor

Choose a reason for hiding this comment

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

using commit hook?

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

@@ -1540,8 +1540,10 @@ def init_shape(self):
class TestRelu(TestActivation):
def setUp(self):
self.op_type = "relu"
self.prim_op_type = "comp"
Copy link
Contributor

Choose a reason for hiding this comment

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

no python api used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

python api of relu added

JiabinYang
JiabinYang previously approved these changes Feb 23, 2023
Copy link
Contributor

@JiabinYang JiabinYang left a comment

Choose a reason for hiding this comment

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

LGTM

@Miracle2333 Miracle2333 reopened this Mar 6, 2023
cyber-pioneer
cyber-pioneer previously approved these changes Mar 7, 2023
Copy link
Contributor

@cyber-pioneer cyber-pioneer left a comment

Choose a reason for hiding this comment

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

LGTM

cyber-pioneer
cyber-pioneer previously approved these changes Mar 7, 2023
Copy link
Contributor

@cyber-pioneer cyber-pioneer left a comment

Choose a reason for hiding this comment

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

LGTM

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.

relu fp16单测请打开组合测试

@Charles-hit Charles-hit merged commit 079f41c into PaddlePaddle:develop Mar 8, 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.

4 participants