Skip to content

[CPU] Fix lscpu NUMA node regex to handle quoted - and null in containers#38681

Open
Monokaix wants to merge 1 commit intovllm-project:mainfrom
Monokaix:dev
Open

[CPU] Fix lscpu NUMA node regex to handle quoted - and null in containers#38681
Monokaix wants to merge 1 commit intovllm-project:mainfrom
Monokaix:dev

Conversation

@Monokaix
Copy link
Copy Markdown

@Monokaix Monokaix commented Apr 1, 2026

Purpose

Fix CPU worker startup crash in Docker containers where NUMA topology is unavailable (e.g., ARM64 on macOS Docker Desktop).

lscpu -J -e=CPU,CORE,NODE outputs "node": "-" (quoted dash) in these environments, but the existing regex only handled "node": - (unquoted dash). This caused all CPUs to be filtered out in get_allowed_cpu_core_node_list(), resulting in:
AssertionError: Not enough allowed NUMA nodes to bind threads of 1 local CPUWorkers. Allowed NUMA nodes are [].

Test Plan

# Reproduce the crash (before fix):
docker run \
    -p 8000:8000 \
    vllm/vllm-openai-cpu:latest-arm64
# Verify lscpu output inside container:
docker run -it --entrypoint /bin/bash vllm/vllm-openai-cpu:latest-arm64
lscpu -J -e=CPU,CORE,NODE
# Confirms "node": "-" (quoted dash)
# Build new image with this fix and re-run the command to make sure it's fixed, and server should start normally
docker run \
    -p 8000:8000 \
    vllm/vllm-openai-cpu:latest-arm64

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

…ners

Signed-off-by: Xavier Chang <xuzhengc@nvidia.com>
@Monokaix Monokaix requested a review from bigPYJ1151 as a code owner April 1, 2026 03:04
@mergify mergify bot added the cpu Related to CPU backends label Apr 1, 2026
@Monokaix Monokaix changed the title [CPU] Fix lscpu NUMA node regex to handle quoted - and null in contai… [CPU] Fix lscpu NUMA node regex to handle quoted - and null in containers Apr 1, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the regular expression used to sanitize the JSON output of the lscpu command in vllm/platforms/cpu.py. The modification improves robustness by correctly identifying and replacing various representations of missing NUMA node values, such as "-", -, or null, with a default value of 0 before the string is parsed. I have no feedback to provide as there were no review comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cpu Related to CPU backends

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant