Skip to content

Fix dygraph unique name bug #17592

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

Merged
merged 2 commits into from
May 24, 2019

Conversation

sneaxiy
Copy link
Collaborator

@sneaxiy sneaxiy commented May 23, 2019

unique_name.ids increases as batch increases, which make memory leak in dygraph mode since dygraph mode creates new variables across batches. This bug makes ptb model run slower as batch increases. This PR fixes this bug.

@sneaxiy sneaxiy requested review from JiabinYang and chengduoZH May 23, 2019 09:24
@sneaxiy sneaxiy closed this May 24, 2019
@sneaxiy sneaxiy reopened this May 24, 2019
chengduoZH
chengduoZH previously approved these changes May 24, 2019
Copy link
Contributor

@chengduoZH chengduoZH left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@JiabinYang JiabinYang left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -58,6 +58,14 @@ def generate(key):
return generator(key)


def generate_tmp(key):
Copy link
Contributor

Choose a reason for hiding this comment

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

Add Comment to explain why we need generate_tmp

Copy link
Collaborator Author

@sneaxiy sneaxiy May 24, 2019

Choose a reason for hiding this comment

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

Done.

@sneaxiy sneaxiy merged commit 887a39f into PaddlePaddle:develop May 24, 2019
@sneaxiy sneaxiy deleted the fix_unique_name_growth_bug branch October 17, 2019 07:04
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.

3 participants