Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions model_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,9 @@ def model_provider(
def oom_observer(device, alloc, device_alloc, device_free):
# snapshot right after an OOM happened
print('saving allocated state during OOM')
snapshot = torch.cuda.memory._snapshot()
from pickle import dump

dump(
snapshot,
open(f"oom_rank-{torch.distributed.get_rank()}_{args.memory_snapshot_path}", 'wb'),
)
filename = f"oom_rank-{torch.distributed.get_rank()}_{args.memory_snapshot_path}"
torch.cuda.memory._dump_snapshot(filename)

torch._C._cuda_attach_out_of_memory_observer(oom_observer)

Expand Down
Loading