vllm.utils.cpu_resource_utils ¶
Functions:
-
get_cgroup_memory_limit–Return (limit, usage) in bytes from cgroup, or (None, None).
-
parse_id_list–Parses strings like '0-2,4,7-8' into [0, 1, 2, 4, 7, 8]
_synthesize_cpu_list() cached ¶
Synthesize a flat CPU list: each logical CPU is its own core on NUMA node 0. Used when lscpu output is unavailable or unparsable (e.g. macOS, RISC-V).
Source code in vllm/utils/cpu_resource_utils.py
get_cgroup_memory_limit() cached ¶
Return (limit, usage) in bytes from cgroup, or (None, None).
Supports both cgroup v2 (unified) and v1. Returns (None, None) when not running under a constrained cgroup (e.g. bare metal, or limit reported as max/an unrealistically large value).
Source code in vllm/utils/cpu_resource_utils.py
parse_id_list(raw_str) ¶
Parses strings like '0-2,4,7-8' into [0, 1, 2, 4, 7, 8]