MCPcopy
hub / github.com/deepspeedai/DeepSpeed / _get_cpu_socket_count

Function _get_cpu_socket_count

tests/unit/common.py:67–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65
66
67def _get_cpu_socket_count():
68 import shlex
69 p1 = subprocess.Popen(shlex.split("cat /proc/cpuinfo"), stdout=subprocess.PIPE)
70 p2 = subprocess.Popen(["grep", "physical id"], stdin=p1.stdout, stdout=subprocess.PIPE)
71 p1.stdout.close()
72 p3 = subprocess.Popen(shlex.split("sort -u"), stdin=p2.stdout, stdout=subprocess.PIPE)
73 p2.stdout.close()
74 p4 = subprocess.Popen(shlex.split("wc -l"), stdin=p3.stdout, stdout=subprocess.PIPE)
75 p3.stdout.close()
76 r = int(p4.communicate()[0])
77 p4.stdout.close()
78 return r
79
80
81def set_accelerator_visible():

Callers 1

set_accelerator_visibleFunction · 0.85

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…