-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
False
-
-
False
-
-
-
Important
Description of problem:
Memory leak is observed when you do reapeted ops
Version numbers (base image, wheels, builder, etc):
Steps to Reproduce:
1. Build and install torch
2. Repro code https://gist.github.com/sumantro93/d62b8a576cdeae9a6dbeb80a185edc19
Actual results:
Memory leak is observed
Expected results:
It should be handling
Additional info:
import torch
... import gc
... def get_memory_mb():
... import resource
... return resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / 1024
... initial_mem = get_memory_mb()
... print(f"Initial memory: {initial_mem:.2f} MB")
... # Repeated operations cause memory leak
... for i in range(10000):
... t = torch.randn(2, 3, 4, 5, 6) # 5 dims
... t = t.view(1, 2, 3, 4, 5, 6) # 6 dims - triggers leak
... gc.collect() # This is OUTSIDE the loop
... final_mem = get_memory_mb()
... print(f"Final memory: {final_mem:.2f} MB")
... print(f"Memory leaked: {final_mem - initial_mem:.2f} MB")
...
Initial memory: 224.51 MB
Final memory: 226.14 MB
Memory leaked: 1.62 MB
- blocks
-
AIPCC-4625 Fixing security issues for PyTorch
-
- New
-