-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 fp16 test and bf16 for poisson #51662
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
or not core.is_bfloat16_supported(core.CUDAPlace(0)), | ||
"core is not complied with CUDA and not support the bfloat16", | ||
) | ||
class TestSearchSortedBF16(OpTest): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TestSearchSortedBF16改为TestSearchSortedBF16Op
or not core.is_bfloat16_supported(core.CUDAPlace(0)), | ||
"core is not complied with CUDA and not support the bfloat16", | ||
) | ||
class TestPoissonBF16(OpTest): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TestPoissonBF16改为TestPoissonBF16Op
Almost LGTM |
fix function name
fix function name
LGTM,Rerun一下Build相关的测试 |
@Vvsmile 已经rerun了,但还是报错,应该如何修复这个报错呢? |
Sorry to inform you that 2f9ffc0's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
很抱歉,经过我们的反复讨论,你的PR暂未达到合入标准,请阅读飞桨原生算子开发规范,你可以重新提交新的PR,我们先将此PR关闭,感谢你的贡献。 |
@zhangting2020 辛苦帮忙review下~, |
test/legacy_test/test_poisson_op.py
Outdated
x = np.full([2048, 1024], self.lam, dtype="float32") | ||
out = np.ones([2048, 1024], dtype="float32") | ||
x = convert_uint16_to_float(convert_float_to_uint16(x)) | ||
out = convert_uint16_to_float(convert_float_to_uint16(out)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
397和398不用加,因为400~401行,你要把float转uint16
test/legacy_test/test_poisson_op.py
Outdated
self.dtype = np.uint16 | ||
|
||
def verify_output(self, outs): | ||
hist, prob = output_hist(np.array(outs[0]), self.lam, self.a, self.b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这一行错误原因是outs[0]是op的输出,由于输出是bf16类型,np.array后变成了uint16。所以为了得到正确的计算结果,这里要将转为uint16的numpy数据,转回float32
hist, prob = output_hist(convert_uint16_to_float(np.array(outs[0])), self.lam, self.a, self.b)
@zhangting2020 修改好了,辛苦review下~ |
LGTM,记得更新文档 |
@zhangting2020 文档已经更新,辛苦reveiw~ |
PR types
Others
PR changes
APIs
Description
相关链接:
英文文档:
中文文档: