MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / report_memory

Function report_memory

DeepSpeedExample/megatron/utils.py:41–52  ·  view source on GitHub ↗

Simple GPU memory report.

(name)

Source from the content-addressed store, hash-verified

39
40
41def report_memory(name):
42 """Simple GPU memory report."""
43 mega_bytes = 1024.0 * 1024.0
44 string = name + ' memory (MB)'
45 string += ' | allocated: {}'.format(
46 torch.cuda.memory_allocated() / mega_bytes)
47 string += ' | max allocated: {}'.format(
48 torch.cuda.max_memory_allocated() / mega_bytes)
49 string += ' | reserved: {}'.format(torch.cuda.memory_reserved() / mega_bytes)
50 string += ' | max reserved: {}'.format(
51 torch.cuda.max_memory_reserved() / mega_bytes)
52 print_rank_0(string)
53
54
55def print_params_min_max_norm(optimizer, iteration):

Callers 1

training_logFunction · 0.90

Calls 5

print_rank_0Function · 0.90
memory_allocatedMethod · 0.45
max_memory_allocatedMethod · 0.45
memory_reservedMethod · 0.45
max_memory_reservedMethod · 0.45

Tested by

no test coverage detected