Closed mfkasim1 closed 3 years ago
Hmm yeah, that should ideally be garbage collected, but it does seem like it's ultimately a problem with PyTorch backend. Thanks for bringing this up. I'll wait for the pytorch issue to get resolved to see if there's any action that needs to be taken.
I have found a memory leak if there si a circular reference (i.e. using
odeint_adjoint
inside atorch.nn.Module
where the ode adjoint takes the module as an input). Here's a minimal example:where it produces:
Here's my spec:
I've raised an issue in PyTorch's github because I think this might be related: https://github.com/pytorch/pytorch/issues/52140