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

[XPU] add bfloat16 support for CastKernel #58456

Merged
merged 2 commits into from
Oct 30, 2023

Conversation

houj04
Copy link
Contributor

@houj04 houj04 commented Oct 27, 2023

PR types

New features

PR changes

OPs

Description

给XPU下面的CastKernel增加对bfloat16的支持。

由于XDNN里面bfloat16只能和float进行互转,所以先走兜底实现,即遇到需要bfloat和非float类型转换的时候,中间垫一层和float的转换。

会有精度问题吗:例如从double转bfloat16,按照现有的实现先转float再转bfloat16,反正都是“砍bit”。反过来也一样,例如从bfloat16转double,那么先转float再转double,反正都是“补bit”。

@paddle-bot
Copy link

paddle-bot bot commented Oct 27, 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 the contributor External developers label Oct 27, 2023
Copy link
Contributor

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

@RuohengMa RuohengMa left a comment

Choose a reason for hiding this comment

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

LGTM

@QingshuChen QingshuChen merged commit 64211ba into PaddlePaddle:develop Oct 30, 2023
@paddle-bot paddle-bot bot removed the contributor External developers label Nov 3, 2023
zeroRains pushed a commit to zeroRains/Paddle that referenced this pull request Nov 8, 2023
* [XPU] add bfloat16 support for CastKernel

* fix unittest.
danleifeng pushed a commit to danleifeng/Paddle that referenced this pull request Nov 14, 2023
* [XPU] add bfloat16 support for CastKernel

* fix unittest.
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