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 fp16 test and bf16 for poisson #51662

Merged
merged 22 commits into from
Jul 31, 2023

Conversation

longranger2
Copy link
Contributor

@longranger2 longranger2 commented Mar 14, 2023

PR types

Others

PR changes

APIs

Description

  • add fp16 test and bf16 test for poisson

相关链接:

英文文档:

中文文档:

@paddle-bot
Copy link

paddle-bot bot commented Mar 14, 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.

or not core.is_bfloat16_supported(core.CUDAPlace(0)),
"core is not complied with CUDA and not support the bfloat16",
)
class TestSearchSortedBF16(OpTest):
Copy link
Contributor

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):
Copy link
Contributor

Choose a reason for hiding this comment

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

TestPoissonBF16改为TestPoissonBF16Op

@Vvsmile
Copy link
Contributor

Vvsmile commented Mar 28, 2023

Almost LGTM

@Vvsmile
Copy link
Contributor

Vvsmile commented Apr 3, 2023

LGTM,Rerun一下Build相关的测试

@longranger2
Copy link
Contributor Author

longranger2 commented Apr 3, 2023

@Vvsmile 已经rerun了,但还是报错,应该如何修复这个报错呢?

image

@longranger2 longranger2 requested a review from Vvsmile April 4, 2023 03:48
@longranger2 longranger2 changed the title 【PaddlePaddle Hackathon 4】No.56 : add fp16 test and bf16 for poisson and searchsorted 【PaddlePaddle Hackathon 4】No.56 : add fp16 test and bf16 for poisson Apr 22, 2023
@longranger2
Copy link
Contributor Author

@ZzSean @Vvsmile 辛苦帮忙review下~,
PR-CI-Windows-Inference这里报错,但我反复检查过代码,没有发现是哪里出现了问题
image

@paddle-ci-bot
Copy link

paddle-ci-bot bot commented May 24, 2023

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.

@paddle-bot
Copy link

paddle-bot bot commented Jul 11, 2023

很抱歉,经过我们的反复讨论,你的PR暂未达到合入标准,请阅读飞桨原生算子开发规范,你可以重新提交新的PR,我们先将此PR关闭,感谢你的贡献。
Sorry to inform you that through our discussion, your PR fails to meet the merging standard (Reference: Paddle Custom Operator Design Doc). You can also submit an new one. Thank you.

@longranger2
Copy link
Contributor Author

@zhangting2020 辛苦帮忙review下~,
PR-CI-Windows-Inference这里报错,但我反复检查过代码,没有发现是哪里出现了问题
image

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))
Copy link
Contributor

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

self.dtype = np.uint16

def verify_output(self, outs):
hist, prob = output_hist(np.array(outs[0]), self.lam, self.a, self.b)
Copy link
Contributor

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)

@longranger2
Copy link
Contributor Author

@zhangting2020 修改好了,辛苦review下~

@zhangting2020
Copy link
Contributor

LGTM,记得更新文档

@longranger2
Copy link
Contributor Author

@zhangting2020 文档已经更新,辛苦reveiw~

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.

6 participants