Skip to content

Commit 5e25038

Browse files
author
dmoi
committed
fix memory leak problems on gpu
1 parent f5fbec0 commit 5e25038

3 files changed

Lines changed: 1659 additions & 1440 deletions

File tree

foldtree2/learn_lightning.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# learn_lightning.py - PyTorch Lightning training with multi-GPU support
2+
import os
3+
# Set CUDA memory allocator to use expandable segments to reduce fragmentation
4+
os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'expandable_segments:True'
5+
26
import torch
37
from torch_geometric.data import DataLoader
48
import numpy as np

foldtree2/learn_monodecoder.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# coding: utf-8
22
# learn_monodecoder.py - Training script for MultiMonoDecoder
33

4+
import os
5+
# Set CUDA memory allocator to use expandable segments to reduce fragmentation
6+
os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'expandable_segments:True'
7+
48
import torch
59
from torch_geometric.data import DataLoader
610
import numpy as np

0 commit comments

Comments
 (0)