PaddleNLP
PaddleNLP copied to clipboard
[Bug]: 混合精度类型提升不符合预期
软件环境
- paddlepaddle:
- paddlepaddle-gpu:
- paddlenlp:
重复问题
- [X] I have searched the existing issues
错误描述
类型提升不符合预期
稳定复现步骤 & 代码
import paddle
print(paddle.version.commit)
a = paddle.ones([1], dtype="float32")
with paddle.amp.auto_cast(enable=True, custom_white_list=None, custom_black_list=None, level='O2', dtype='float16', use_promote=True):
o = paddle.outer(a, a)
b = paddle.matmul(a, a)
c = a * a
d = a - a
print(o.dtype)
print(b.dtype)
print(c.dtype)
print(d.dtype)
print("\n")
with paddle.amp.auto_cast(enable=True, custom_white_list=None, custom_black_list=None, level='O2', dtype='float16', use_promote=False):
o = paddle.outer(a, a)
b = paddle.matmul(a, a)
c = a * a
d = a - a
print(o.dtype)
print(b.dtype)
print(c.dtype)
print(d.dtype)
2fbebfd87839a9512f8b82fe2e012aa756ab3012
paddle.float16
paddle.float16
paddle.float32
paddle.float32
paddle.float16
paddle.float16
paddle.float16
paddle.float16
This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。
This issue was closed because it has been inactive for 14 days since being marked as stale. 当前issue 被标记为stale已有14天,即将关闭。