vllm.utils.ompmultiprocessing ¶
OMP Aware Multiprocessing manager for running multiprocessing.Process() Copyright (c) 2026 Red Hat Inc Copyright (c) 2026 Cambridge Greys Ltd
OMPProcessManager ¶
OMP aware wrapper to run mp Process()
Source code in vllm/utils/ompmultiprocessing.py
run ¶
Run arg with correct OMP environment
Source code in vllm/utils/ompmultiprocessing.py
_get_cpu_topology_json ¶
_get_cpu_topology_json() -> bytes
Get CPU topology as JSON.
On Linux this uses lscpu -Je. On other platforms (e.g. macOS) we synthesize a simple topology where every logical CPU is its own core on NUMA node 0, which is sufficient for the OMP place-list builder.
Source code in vllm/utils/ompmultiprocessing.py
_get_default_affinity ¶
Get the set of CPUs the process is allowed to run on.
Source code in vllm/utils/ompmultiprocessing.py
_int ¶
Relaxed parsing of ints which handles a - instead of a number. The lscpu json may contain that for nodes in some cases. If that is the case we parse it to zero
Source code in vllm/utils/ompmultiprocessing.py
create_omp_places ¶
Parse CPU topology and generate possible CPU masks
Source code in vllm/utils/ompmultiprocessing.py
enumerate_resources ¶
Enumerate system resources
Source code in vllm/utils/ompmultiprocessing.py
parse_mask ¶
Expand a X-Y,Z list
Source code in vllm/utils/ompmultiprocessing.py
produce_cpu_list ¶
Produce a CPU list with/without SMT pairs - main cpu list case
Source code in vllm/utils/ompmultiprocessing.py
produce_cpu_sublist ¶
Produce a CPU list with/without SMT pairs - resource leaf case