Repository navigation
Conversation
Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Patryk Mikulski <7378686+patrk@users.noreply.github.com>
patrk
requested review from
AndreasKaratzas,
DarkLight1337,
LucasWilkinson,
MatthewBonanni,
WoosukKwon,
bigPYJ1151,
mgoin,
tlrmchlsmth,
xuechendi,
yewentao256,
ywang96 and
zyongye
as code owners
October 24, 2026 18:26
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Fixes #63507. The CPU platform now rejects attention head sizes its kernel can't run, at backend selection instead of on the first request.
Claims
ValueError: Head size N is not supported by the CPU attention backend. Supported head sizes: [...]. Before this, the engine reported ready and died on the first request.CPUAttentionBackend.get_supported_head_sizes(). The kernel already supports it (HEAD_DIMS_16), and without it the new check would reject a working model.Validation
macOS arm64 (Apple M4 Pro), CPU source build, on main @ e7473bf.
pytest tests/kernels/attention/test_cpu_attn.py -k "head_size or kv_cache_dtype_validation or rejects_quantized"test_cpu_attn.py,tests/platforms/test_cpu.py,test_attention_selector.py,tests/config/test_kv_cache_dtype.pypytest -m cpu_model tests/models/language/generation/test_cpu_attn_head_size.py(new,vllm_runner)RuntimeError: Unsupported CPU attention configuration: head_dim=56at the first requesttest_cpu_attn.py -k "vec16 and -48-"(kernel test for the newly listed 48)pre-commit run --files <changed files>EngineDeadErroron first requestValueErrorat startup, before weights loadI could not test the zentorch exemption: it needs a Zen CPU with zentorch. Its test uses the file's existing
_skip_no_zentorch_sdpamarker, so it only runs on such hosts. If you'd rather fail closed there, I can drop it.New tests on main
Details
CpuPlatform.get_attn_backend_clsnever checkedsupports_head_size, soget_supported_head_sizes()was never enforced on CPU. The kernel dispatch falls through toTORCH_CHECK(false, "Unsupported CPU attention configuration ...")at the first forward.supports_head_sizeinstead of the fullvalidate_configuration, which also checks block size and would change behaviour for configs that work today.test_attention_selector.py: the CPU cases used head size 16, which is in neitherHEAD_DIMS_32norHEAD_DIMS_16, so those tests selected a backend that can't run. I changed them to 64. The ROCm case intest_fp32_fallbackalready notes that 16 is unsupported there.HEAD_SIZES_VEC16so the kernel test covers it.test_cpu_attn.pyruns in the CPU kernel tests job, which this PR triggers because it changes that file. Thevllm_runnertest runs in the CPU language model tests job (-m cpu_modelovertests/models/language/generation). It uses dummy weights because the error is raised before weights load. I checked the models in the CPU CI jobs (language, pooling, multimodal, quantization, distributed, spec decode, Arm). All use head sizes 32–256; vision and audio towers go throughMMEncoderAttention, not this selector._get_attn_isa. That is a separate check.This PR was written with AI assistance (Claude Code). I reviewed every changed line and ran the checks above myself.
Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.