Skip to content

[CINN] Fixed arange float16 and bfloat16 support #72669

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

Merged
merged 1 commit into from
May 12, 2025

Conversation

Enigmatisms
Copy link
Contributor

@Enigmatisms Enigmatisms commented May 12, 2025

PR Category

CINN

PR Types

Bug fixes

Description

此前 #72598 中实现的 arange CINN 支持,没有支持 float16 和 bfloat16,本PR已经加上。如下两个简单的测试可以验证 (在test_cinn_arange.py 单测中)。内部计算 shape 时使用 float 计算。

def test_arange_postfuse_float16(self):
    def func():
        return paddle.arange(0, 1024, 2.1, dtype="float16") * 0.2 + 1

    self.eval(func, [])

def test_arange_postfuse_bfloat16(self):
    def func():
        return paddle.arange(0, 128, 8, dtype="bfloat16") * 2 + 1

    self.eval(func, [])

Pcard-89620

Copy link

paddle-bot bot commented May 12, 2025

你的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.

@lshpku lshpku merged commit 387259f into PaddlePaddle:develop May 12, 2025
45 of 48 checks passed
GITD245 pushed a commit to GITD245/Paddle that referenced this pull request May 14, 2025
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.

2 participants