-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[Accuracy diff No.15] Fix accuracy diff for cumprod API #72897
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
[Accuracy diff No.15] Fix accuracy diff for cumprod API #72897
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
|
/re-run build |
|
/re-run xpu |
|
API-benchmark一直没过 |
python/paddle/tensor/math.py
Outdated
| converted_x_dtype = convert_dtype(x.dtype) | ||
| # use the default platform integer when integer dtype with a precision less than that of the default platform integer | ||
| if converted_x_dtype in { | ||
| "bool", | ||
| "uint16", | ||
| "int8", | ||
| "int16", | ||
| "int32", | ||
| "uint8", | ||
| }: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段代码涉及几次dict查找,比较耗时,过不了API性能监控(这个CI查得很严,python性能也要管),建议你可以在文件的适当地方定义一个纯DataType的set,像这样:
_supported_int_like_types = {
DataType.BOOL,
DataType.INT8,
DataType.INT16,
DataType.INT32,
DataType.INT64,
DataType.UINT8
}然后在这里直接判断:
if x.dtype in _supported_int_like_types:
x = cast(x, "int64")当然能不能过CI还要你自己试一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!我试一下~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样改了发现还是不能过耶,其实我们也可以通过手动设置 dtype 来达到 paddle 和 torch api 之间的切换,这样看起来也不算是精度问题吧,属于 api 设计的考量?目前可能去 paddleAPITest 仓库进行修改更加合适~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
提交了 PaddleAPITest 的修改 pr : PFCCLab/PaddleAPITest#212
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #72897 +/- ##
===========================================
Coverage ? 100.00%
===========================================
Files ? 1
Lines ? 8
Branches ? 0
===========================================
Hits ? 8
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Sorry to inform you that 7ed04a4's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
|
Sorry to inform you that 9ade7fb's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
PR Category
Execute Infrastructure
PR Types
Improvements
Description