Make sure to use no more than 61 cpus on windows (#17958)

* Make sure to use no more than 61 cpus on windows

* Type fix
This commit is contained in:
Earle Lowe
2024-05-07 23:02:30 -05:00
committed by GitHub
parent 6b678168bf
commit 61e22fea87
+6 -1
View File
@@ -417,7 +417,12 @@ def available_logical_cores() -> int:
assert count is not None
return count
return len(psutil.Process().cpu_affinity())
cores = len(psutil.Process().cpu_affinity())
if sys.platform == "win32":
cores = min(61, cores) # https://github.com/python/cpython/issues/89240
return cores
def caller_file_and_line(distance: int = 1, relative_to: Iterable[Path] = ()) -> Tuple[str, int]: