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

[ Dy2static ] select input fix and while_op memory bug fixed. #45380

Merged
merged 7 commits into from Aug 26, 2022

Conversation

2742195759
Copy link
Contributor

PR types

Others

PR changes

Others

Describe

select input fix + while_loop risky assign warning

@paddle-bot
Copy link

paddle-bot bot commented Aug 24, 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.

@@ -1190,6 +1190,13 @@ def assign_skip_lod_tensor_array(input, output):
"""
Assign input to output, but skip the process of copying LoDTensorArray unless it's created in while_block.
"""

def _shape_diff(vara, varb):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def _shape_diff(vara, varb):
def has_shape_diff(x, y):


def _shape_diff(vara, varb):
if len(vara.shape) != len(varb.shape): return True
for sa, sb in zip(vara.shape, varb.shape):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
for sa, sb in zip(vara.shape, varb.shape):
for a, b in zip(x.shape, y.shape):

1. a bug in while_op no_need_copy_var, which causes gpu memory leakage
2. a bug in undefined_var where the stop_gradient should be False.
Copy link
Contributor

@Aurelius84 Aurelius84 left a comment

Choose a reason for hiding this comment

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

LGTM

@2742195759 2742195759 changed the title [ Dy2static ] select input fix [ Dy2static ] select input fix and while_op memory bug fixed. Aug 26, 2022
@2742195759 2742195759 merged commit 9129888 into PaddlePaddle:develop Aug 26, 2022
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.

None yet

2 participants