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

Memory leak #10

Open
jonwittmer opened this issue May 3, 2023 · 3 comments
Open

Memory leak #10

jonwittmer opened this issue May 3, 2023 · 3 comments

Comments

@jonwittmer
Copy link
Collaborator

I observed a memory leak in the tnet demo. The memory leak only occurs when using the torchfire loss. This was observed on both the original version and the parallelized version of the code.

image

Though I haven't been able to track down the issue yet, I wonder if it is possible that some of the Firedrake variables are not being cleaned up when calling solve_firedrake (line 76 of tnet_heat_equation.py, branch jon/parallelize_demos). I tried commenting out all the physics code in fd_to_torch, both the forward and backward functions, and the issue was greatly reduced. There was still a very small amount of memory growth without the physics calls, but much less than with them.

@rckirby
Copy link
Owner

rckirby commented May 12, 2023

Good question, I'll bring this up on Firedrake to see if they have any ideas where to look.

@rckirby
Copy link
Owner

rckirby commented May 12, 2023

Plausibly an issue with firedrake-adjoint?
firedrakeproject/firedrake#2866
A suggestion is to implement a custom pyadjoint.block to enable re-using the adjoint solver.

@jonwittmer
Copy link
Collaborator Author

@nguyenvanhaibk92

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

No branches or pull requests

2 participants