Skip to content
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

[Eager] fix recompute for stop_gradient and inpalce #48471

Merged
merged 3 commits into from
Nov 30, 2022
Merged

[Eager] fix recompute for stop_gradient and inpalce #48471

merged 3 commits into from
Nov 30, 2022

Conversation

sljlp
Copy link
Contributor

@sljlp sljlp commented Nov 28, 2022

PR types

Bug fixes

PR changes

Others

Describe

Fix recompute for stop_gradient and inpalce.

In some cases a subset of outputs is identity to the subset of inputs, which is inplace operating. When the inputs' stop_gradient is True, an error will occurs because the stop_gradient=True and inpalce-op are not supported at the same time. The solution is to mark the inputs non_differentiable if its stop_gradient is True.

@paddle-bot
Copy link

paddle-bot bot commented Nov 28, 2022

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@sljlp sljlp changed the title fix recompute for stop_gradient and inpalce [Eager] fix recompute for stop_gradient and inpalce Nov 29, 2022
Copy link
Contributor

@LiYuRio LiYuRio left a comment

Choose a reason for hiding this comment

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

LGTM

@LiYuRio LiYuRio merged commit 31e380c into PaddlePaddle:develop Nov 30, 2022
lxsbupt pushed a commit to lxsbupt/Paddle that referenced this pull request Dec 17, 2022
* fix recompute for stop_gradient and inpalce

* fix ut

* update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants