Skip to content

Conversation

@zhangbo9674
Copy link
Contributor

@zhangbo9674 zhangbo9674 commented Nov 12, 2021

PR types

Bug fixes

PR changes

APIs

Describe

PR 36862 重构了Layer.to的逻辑,解决了做数据类型转换时,存在的显存增长问题。
原始layer.to存在一个bug:同时修改place和dtype将存在bug,例如:在框架的device设置为place1,通过copy_to()得到place2上的数据new_t,则在place1上对place2上的new_t调用cast操作存在bug。
本pr修复了上述bug:
图片

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhiqiu zhiqiu merged commit 706a789 into PaddlePaddle:develop Nov 18, 2021
zhangbo9674 added a commit to zhangbo9674/Paddle that referenced this pull request Dec 12, 2021
zhangbo9674 added a commit to zhangbo9674/Paddle that referenced this pull request Dec 13, 2021
lanxianghit pushed a commit that referenced this pull request Dec 13, 2021
优化layer.to实现逻辑,相关pr: Remove additional warnning in layer.to ( #36700) Refine param conversion logic in layer.to ( #36862) Fix Layer.to() of device bug ( #37156)
@zhangbo9674 zhangbo9674 deleted the dev/fix_layer_to_bug branch March 2, 2023 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants