Skip to content

[XPU] add depthwise_conv2d backward unit test #67777

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

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

skywalker2012
Copy link
Contributor

@skywalker2012 skywalker2012 commented Aug 28, 2024

PR Category

Custom Device

PR Types

Improvements

Description

add depthwise_conv2d backward unit test

Copy link

paddle-bot bot commented Aug 28, 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.

Copy link
Contributor

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

@cqulilujia cqulilujia left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -130,6 +131,21 @@ def init_paddings(self):
self.pad = [0, 1, 0, 2]
self.padding_algorithm = "EXPLICIT"

def test_check_grad_no_input(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

这些check_grad是不是应该加在基类里面呢?如果加在子类里面,为啥只加了这一个子类,这样的话其它的子类感觉还是不会跑反向的吧。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

是可以加到基类里。
但这里depthwise_conv2d有两个测试类(用_v2区分),对比了一下其实区别不大,而且每个测试类里不同测试子类的区别在于input_size。为了节省测试时间和代码简化,只选择了一种测试子类添加反向。

Copy link
Contributor

Choose a reason for hiding this comment

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

本来要测试的,就是在不同形状下面的梯度都能算对才行呀。其它算子的测试case也是,不同形状下面都要能跑过才行。
这个修改可以先合,后续再改一把吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好,后续再改

@houj04 houj04 merged commit 4c9041c into PaddlePaddle:develop Aug 29, 2024
29 checks passed
@skywalker2012 skywalker2012 deleted the depthwise_conv2d branch August 29, 2024 10:47
@houj04 houj04 added the XPU label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants