-
-
Notifications
You must be signed in to change notification settings - Fork 986
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
Fix memory leak in TraceEnumELBO #3131
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great sleuthing! How did you find the offending line? Did you log tensor count or use any detective tooling code?
Hi Fritz, I used your trick here to check for memory leaks in this example. After removing some gpu codes, I found that the leak also happens in CPU. Then I first copied the TraceEnum_ELBO implementation and removed line by line to see where is the offending code. That leads to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your debugging story!
Thank you @fehiepsi for the detailed fixing history! |
Fixes #3068 and fixes #3014. I'm not sure what changes in PyTorch caused the issue but replacing
x[...]
withx.clone()
fixes the memory leak.