MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / _read_memory_stat

Function _read_memory_stat

accelerator/cpu_accelerator.py:45–54  ·  view source on GitHub ↗
(path, key)

Source from the content-addressed store, hash-verified

43
44
45def _read_memory_stat(path, key):
46 try:
47 with open(path) as f:
48 for line in f:
49 name, _, value = line.partition(" ")
50 if name == key:
51 return int(value)
52 except (OSError, ValueError):
53 pass
54 return 0
55
56
57def _path_parts(path):

Callers 1

_cgroup_memoryFunction · 0.85

Calls 1

partitionMethod · 0.80

Tested by

no test coverage detected