-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
math API support int tensor autocast to float32 易用性提升 #69252
base: develop
Are you sure you want to change the base?
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
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.
- 之前的功能性能不能下降,见Benchmark CI
- 之前的功能结果不受影响,见PR-CE-Framework
@@ -617,6 +663,15 @@ class {} : public egr::GradNodeBase {{ | |||
}} | |||
""" | |||
|
|||
TYPE_AUTOCAST_LOGIC_TEMPLATE = """ |
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.
只有int情况下会被cast,还是所有情况下会被cast,不能引入不兼容的性能下降问题,只能对于之前不支持会报错的情况去cast
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.
只有在指定的op列表里且输入是int的时候会cast,应该不会不兼容。CE-Framework 的报错可能需要修改 PaddleTest 中的一些单测,因为有一些单测里面包含int输入会报错的case。
在 PaddleTest 中注释掉 paddle.sin 的单测:PaddlePaddle/PaddleTest#2992
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.
你有CE-Framework的合入权限没,先把那个提一个PR修改吧,让这个PR能过CI
@@ -388,11 +430,13 @@ def ceil(x: Tensor, name: str | None = None) -> Tensor: | |||
out = \\left \\lceil x \\right \\rceil | |||
|
|||
Args: | |||
x (Tensor): Input of Ceil operator, an N-D Tensor, with data type float32, float64 or float16. | |||
x (Tensor): Input of Ceil operator, an N-D Tensor, with data type float32, float64, float16, bfloat16, |
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.
有些上面check_dtype里写了complex64,下面文档里似乎没写,这个上下对齐一下吧
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.
好的,我再检查一下文档。 PaddleTest 我没有合入的权限,pr 是这个:PaddlePaddle/PaddleTest#2992
PR Category
User Experience
PR Types
Improvements
Description
以上支持整数类型输入自动提升为float32类型。
其中只有
paddle.ceil
,paddle.floor
也支持反向,梯度类型与输入类型一致。paddle.multigammaln
,paddle.sinc
由于是组合 API 实现,其中的 API 暂不支持 int 和 float 的类型提升,所以paddle.multigammaln
,paddle.sinc
暂不支持整数类型输入