You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using BraxEnv with requires_grad=True, there appears to be a memory leak on the CPU side. The memory usage keeps increasing over time, which can be observed using tools like htop. This happens even when explicitly detaching and cloning next_td and backwarding to release the graph.
To Reproduce
Simply run the following code and observe the increasing in memory usage.
>>>print(torchrl.__version__, numpy.__version__, sys.version, sys.platform)
0.7.12.2.33.10.14 (main, May62024, 19:42:50) [GCC11.2.0] linux
Additional context
This issue seems to be related to the way BraxEnv manages memory when requires_grad=True. Even though next_td is detached and cloned, memory continues to accumulate on the CPU.
Reason and Possible fixes
Some list or buffer is accumulating things under the wood?
Checklist
[x ] I have checked that there is no similar issue in the repo (required)
Describe the bug
When using BraxEnv with requires_grad=True, there appears to be a memory leak on the CPU side. The memory usage keeps increasing over time, which can be observed using tools like htop. This happens even when explicitly detaching and cloning next_td and backwarding to release the graph.
To Reproduce
Simply run the following code and observe the increasing in memory usage.
Expected behavior
The memory usage should remain stable over time instead of continuously increasing.
System info
Installation was done with pip.
outputs :
Additional context
This issue seems to be related to the way BraxEnv manages memory when requires_grad=True. Even though next_td is detached and cloned, memory continues to accumulate on the CPU.
Reason and Possible fixes
Some list or buffer is accumulating things under the wood?
Checklist
The text was updated successfully, but these errors were encountered: