MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / _num_cpu_cores

Function _num_cpu_cores

test/general/lm_eval/tasks/scrolls.py:118–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

116
117
118def _num_cpu_cores():
119 # https://stackoverflow.com/questions/1006289/how-to-find-out-the-number-of-cpus-using-python/55423170#55423170
120 try:
121 import psutil
122 return psutil.cpu_count(logical=False)
123 except ImportError:
124 import os
125 return len(os.sched_getaffinity(0))
126
127
128class _SCROLLSTask(Task):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected