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

Add prim test for elementwise ops #50807

Merged

Conversation

Charles-hit
Copy link
Contributor

@Charles-hit Charles-hit commented Feb 23, 2023

PR types

Others

PR changes

Others

Describe

  1. add prim op test for elementwise_add, elementwise_sub, elementwise_mul, elementwise_div ops.
  2. add 'bfloat16' dtype for full static prim api.

@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.

@Charles-hit Charles-hit reopened this Feb 27, 2023
@Charles-hit Charles-hit force-pushed the add_prim_test_for_elementwise_op branch from a41fa64 to 0b5097a Compare February 28, 2023 15:12
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, OpTest suite related problem can be fixed in next pr


def init_axis(self):
self.axis = 1

def init_check_prim(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

some comments

@@ -150,6 +199,7 @@ class TestBF16ElementwiseAddOp(OpTest):
def setUp(self):
self.op_type = "elementwise_add"
self.python_api = paddle.add
self.prim_op_type = "prim"
Copy link
Contributor

Choose a reason for hiding this comment

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

bad name, is_prim_op? is_composite_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.

it will be modified in next pr.


def init_axis(self):
self.axis = 0

def init_check_prim(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

need_check_prim?

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

@@ -33,9 +33,12 @@ class ElementwiseDivOp(OpTest):
def setUp(self):
self.op_type = "elementwise_div"
self.python_api = paddle.divide
self.prim_op_type = "prim"
Copy link
Contributor

Choose a reason for hiding this comment

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

same

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

@@ -61,6 +64,9 @@ def setUp(self):
self.grad_x = grad_x
self.grad_y = grad_y

def skip_cinn(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

enable_cinn

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

@@ -205,7 +271,7 @@ def setUp(self):
self.init_kernel_type()


class TestElementwiseMulOp_broadcast_2(ElementwiseMulOp):
class TestElementwiseMulOp_broadcast_2(ElementwiseMulOp_broadcast):
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't skip this?

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

JiabinYang
JiabinYang previously approved these changes Mar 2, 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

zhangting2020
zhangting2020 previously approved these changes Mar 2, 2023
Copy link
Contributor

@zhangting2020 zhangting2020 left a comment

Choose a reason for hiding this comment

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

LGTM for skip_check_grad_ci

@phlrain phlrain self-requested a review March 2, 2023 05:56
@Charles-hit Charles-hit merged commit b871330 into PaddlePaddle:develop Mar 2, 2023
@Charles-hit Charles-hit deleted the add_prim_test_for_elementwise_op branch March 2, 2023 11:16
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