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

【PaddlePaddle Hackathon 4】No.56 :add fp and bf16 for bernoulli #54232

Merged
merged 3 commits into from
Jun 2, 2023

Conversation

Difers
Copy link
Contributor

@Difers Difers commented May 31, 2023

PR types

Others

PR changes

APIs

Description

add fp16 test and bf16 test for bernoulli
#51281

@paddle-bot
Copy link

paddle-bot bot commented May 31, 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 paddle-bot bot added contributor External developers status: proposed labels May 31, 2023
@paddle-bot
Copy link

paddle-bot bot commented May 31, 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.

@ZzSean
Copy link
Contributor

ZzSean commented Jun 1, 2023

需要补充一下api中的check_dtype

@luotao1
Copy link
Contributor

luotao1 commented Jun 1, 2023

请解决下冲突和ROCM流水线问题

self.x = convert_float_to_uint16(
np.random.uniform(size=(1000, 784)).astype("float32")
)
self.out = np.zeros((1000, 784)).astype("float32")
Copy link
Contributor

Choose a reason for hiding this comment

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

out也需要convert一下?

@Difers
Copy link
Contributor Author

Difers commented Jun 1, 2023

需要补充一下api中的check_dtype

check_dtype如何补充?


def verify_output(self, outs):
hist, prob = output_hist(np.array(outs[0]))
np.testing.assert_allclose(hist, prob, atol=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.

bf16这里的atol是否需要增大?

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.02了,但这需要指定atol=0.01,默认给的1e-7

@luotao1
Copy link
Contributor

luotao1 commented Jun 2, 2023

image

Copy link
Contributor

@ZzSean ZzSean left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 merged commit 85d5f26 into PaddlePaddle:develop Jun 2, 2023
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.

5 participants