Skip to content

Conversation

@hong19860320
Copy link
Contributor

PR types

New features

PR changes

OPs

Describe

support batch_norm and layer_norm on Baidu Kunlun

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@hong19860320
Copy link
Contributor Author

@QingshuChen 麻烦帮忙review下哈


def test_check_grad(self):
self.check_grad_with_place(
paddle.XPUPlace(0), ['X'], 'Y', max_relative_error=0.02)
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

pass

def test_check_output(self):
self.check_output_with_place(paddle.XPUPlace(0), atol=1e-4)
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

for id, name in enumerate(fetch_list):
self.assertEqual(
np.allclose(
outputs[name], outs[id], atol=1e-4), True)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

如果使用默认值,则输出Y存在diff:
image

Copy link
Contributor

@QingshuChen QingshuChen left a comment

Choose a reason for hiding this comment

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

@QingshuChen 麻烦帮忙review下哈

LGTM


def test_check_grad(self):
self.check_grad_with_place(
paddle.XPUPlace(0), ['X'], 'Y', max_relative_error=0.02)
Copy link
Contributor

Choose a reason for hiding this comment

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

这边用默认值可以不?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

不行的,超过了默认值0.005,具体可以见我的comments中的截图

Copy link
Contributor

@Xreki Xreki 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 the change of atol and max_relative_error.

@hong19860320 hong19860320 merged commit c90d355 into PaddlePaddle:develop Oct 13, 2020
chen-zhiyu pushed a commit to chen-zhiyu/Paddle that referenced this pull request Oct 15, 2020
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