{"record":{"id":"3e2e2313c5d0bf4d","repo":"vllm-project/vllm","slug":"numa-bind-cpus-ranges-must-be-ascending-but-got","errorCode":null,"errorMessage":"numa_bind_cpus ranges must be ascending, but got '{cpuset}'.","messagePattern":"numa_bind_cpus ranges must be ascending, but got '(.+?)'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/config/parallel.py","lineNumber":446,"sourceCode":"        if value is None:\n            return None\n        if not value:\n            raise ValueError(\"numa_bind_cpus must not be empty.\")\n\n        for cpuset in value:\n            if not cpuset:\n                raise ValueError(\"numa_bind_cpus entries must not be empty.\")\n            if not _NUMACTL_CPUSET_PATTERN.fullmatch(cpuset):\n                raise ValueError(\n                    \"numa_bind_cpus entries must use numactl CPU list syntax, \"\n                    \"for example '0-3' or '0,2,4-7'.\"\n                )\n            for part in cpuset.split(\",\"):\n                if \"-\" not in part:\n                    continue\n                start_str, end_str = part.split(\"-\", 1)\n                if int(start_str) > int(end_str):\n                    raise ValueError(\n                        f\"numa_bind_cpus ranges must be ascending, but got '{cpuset}'.\"\n                    )\n        return value\n\n    @model_validator(mode=\"after\")\n    def _validate_parallel_config(self) -> Self:\n        if self._api_process_rank >= self._api_process_count:\n            raise ValueError(\n                \"Invalid value of `_api_process_rank`. \"\n                f\"Expected to be `-1` or `[0, {self._api_process_count})`, \"\n                f\"but found: {self._api_process_rank}\"\n            )\n\n        if self.enable_fault_tolerance and self._api_process_count > 1:\n            raise ValueError(\n                \"Fault tolerance requires a single API server process \"\n                f\"(--api-server-count=1), but got {self._api_process_count}. \"\n                \"The FT system assumes one AsyncMPClient manages all engines.\"","sourceCodeStart":428,"sourceCodeEnd":464,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/config/parallel.py#L428-L464","documentation":"ParallelConfig validates each entry of numa_bind_cpus against numactl CPU-list syntax. A range segment like '3-0' whose start CPU number is greater than its end CPU number is rejected because numactl itself requires ascending ranges. The check runs per-entry inside the field validator before the model-level cross-field validation.","triggerScenarios":"Setting --numa-bind-cpus with a descending or reversed range, e.g. 'vllm serve ... --numa-bind-cpus 3-0' or '0,7-4'. Any comma-separated part containing '-' where int(start) > int(end) triggers it.","commonSituations":"Typing a CPU range backwards when mirroring a NUMA topology; copying a cpuset from /proc or taskset output that lists CPUs in a different order and hand-editing it into a range.","solutions":["Rewrite the range in ascending order, e.g. replace '3-0' with '0-3'.","If the intent is an unordered CPU set, list single CPUs comma-separated ('0,3,7') instead of ranges.","Verify the final string against numactl syntax: run `numactl --show` or `numactl -C <cpuset> true` to confirm the kernel accepts it before passing it to vLLM."],"exampleFix":"# before\n--numa-bind-cpus 3-0\n# after\n--numa-bind-cpus 0-3","handlingStrategy":"validation","validationCode":"import re\n\nNUMACTL = re.compile(r\"^\\d+(-\\d+)?(,\\d+(-\\d+)?)*$\")\n\ndef cpusets_valid(entries: list[str]) -> bool:\n    return all(\n        NUMACTL.fullmatch(c) and all(\n            \"-\" not in p or int(p.split(\"-\")[0]) <= int(p.split(\"-\")[1])\n            for p in c.split(\",\")\n        )\n        for c in entries\n    )\n\nassert cpusets_valid([\"0-3\", \"0,2,4-7\"])","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate numactl strings with `numactl -C <cpuset> true` before feeding them to vLLM.","Generate ranges programmatically (f\"{lo}-{hi}\" with lo < hi) instead of typing them by hand."],"tags":["numa","cpu-affinity","configuration","parallelism"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}