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

Method memory_usage

deepspeed/utils/timer.py:122–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

120
121 @staticmethod
122 def memory_usage():
123 alloc = "mem_allocated: {:.4f} GB".format(get_accelerator().memory_allocated() / (1024 * 1024 * 1024))
124 max_alloc = "max_mem_allocated: {:.4f} GB".format(get_accelerator().max_memory_allocated() /
125 (1024 * 1024 * 1024))
126 cache = "cache_allocated: {:.4f} GB".format(get_accelerator().memory_cached() / (1024 * 1024 * 1024))
127 max_cache = "max_cache_allocated: {:.4f} GB".format(get_accelerator().max_memory_cached() /
128 (1024 * 1024 * 1024))
129 return " | {} | {} | {} | {}".format(alloc, max_alloc, cache, max_cache)
130
131 def log(self, names, normalizer=1.0, reset=True, memory_breakdown=False, ranks=None):
132 """Log a group of timers."""

Callers

nothing calls this directly

Calls 5

get_acceleratorFunction · 0.90
memory_allocatedMethod · 0.45
max_memory_allocatedMethod · 0.45
memory_cachedMethod · 0.45
max_memory_cachedMethod · 0.45

Tested by

no test coverage detected