-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[Accuracy diff No.16] Fix accuracy diff for paddle.cumsum、paddle.logcumsumexp API
#73658
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
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
|
/re-run all-failed |
|
/re-run all-failed |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #73658 +/- ##
===========================================
Coverage ? 100.00%
===========================================
Files ? 1
Lines ? 4
Branches ? 0
===========================================
Hits ? 4
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
PR Category
Operator Mechanism
PR Types
Improvements
Description
错误定位:
ThrustCumsumKernel自身的精度误差就极大解决方案:
ThrustCumsumKernel分支处理,继续使用 CUDAcub计算BlockPrefixCallbackOp采用 Kahan 算法,参考:https://en.wikipedia.org/wiki/Kahan_summation_algorithmLogAddExp的Identity从std::numeric_limits<T>::lowest()改为-std::numeric_limits<T>::infinity(),使其在理论上更准确其他修改:
paddle/phi/kernels/cpu/cum_kernel.cc、test/legacy_test/test_logcumsumexp_op.py、paddle/fluid/primitive/decomp_rule/decomp_vjp/details.hpaddle/phi/kernels/impl/logcumsumexp_grad_impl.h,添加注释测试:
Pcard-85711