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

[CINN] Use trunc instead of fesetround to avoid affect other calculation precision in same process #70766

Conversation

SigureMo
Copy link
Member

@SigureMo SigureMo commented Jan 10, 2025

PR Category

CINN

PR Types

Bug fixes

Description

std::fesetround1 会影响当前进程浮点舍入规则,后续计算精度都会受到影响(后续 Python、NumPy 浮点数表示都会有问题),包括 #70510 中的 guard 精度问题,因此尝试使用 trunc 解决 #64529 的上界溢出问题

#70510 后续找时间 revert 下

PCard-66972

Footnotes

  1. https://en.cppreference.com/w/cpp/numeric/fenv/feround

Copy link

paddle-bot bot commented Jan 10, 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.

@SigureMo SigureMo merged commit 3fda1a9 into PaddlePaddle:develop Jan 10, 2025
32 checks passed
@SigureMo SigureMo deleted the cinn/use-trunc-instead-of-fesetround-to-avoid-affect-other-calculation-in-process branch January 10, 2025 11:33
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