Skip to content

Fix get_head_size() when config materializes head_dim as 0 - #1072

Open
zohaibm-amd wants to merge 1 commit into
gfx11from
zohaibm/aiesw-39871-head-dim-zero
Open

Fix get_head_size() when config materializes head_dim as 0#1072
zohaibm-amd wants to merge 1 commit into
gfx11from
zohaibm/aiesw-39871-head-dim-zero

Conversation

@zohaibm-amd

@zohaibm-amd zohaibm-amd commented Jul 30, 2026

Copy link
Copy Markdown

Summary

Cherry-picks the get_head_size() portion of upstream commit ceae5bcbda (vllm-project/vllm#45219) to fix the nightly DeepSeek-VL2-tiny_VLM and DeepSeek-VL2-tiny_4096 regressions (AIESW-39871).

Root cause

DeepseekVLV2TextConfig materializes a missing head_dim as 0 rather than leaving it unset. The existing guard in get_head_size() only rejected None, so 0 passed straight through as the architecture head size — while the true head size is hidden_size / num_attention_heads = 1280 / 10 = 128.

Confirmed directly against the model config, no GPU needed:

is_deepseek_mla      -> False
BUGGY get_head_size  -> 0
true (hidden/heads)  -> 128

The resulting zero-sized KV cache is what aborts the engine on the first inference request with hipErrorLaunchFailure / CUDA error: unspecified launch failure.

This is a latent bug being exposed, not a stack regression — the guard has only ever tested for None.

Verification

Run on gfx1151 (Strix Halo) with the nightly's own benchmark arguments, before vs after, identical args:

Config Before After
DeepSeek-VL2-tiny_4096 exit 1, 0 successful requests, 5x unspecified launch failure exit 0, 2 successful requests, prefill 22084 tok/s, decode 138 tok/s
DeepSeek-VL2-tiny_VLM engine dead, 0 tok/s prefill 5167 tok/s, decode 154 tok/s

Unit test (upstream's, included here) is non-vacuous — it fails assert 0 == 128 against unpatched code and passes with the fix:

tests/config/test_model_arch_config.py::test_head_size_falls_back_when_head_dim_is_zero PASSED

ruff check and ruff format --check both clean.

Scope note

The upstream commit also carries nixl/CI test changes unrelated to this crash. Only the get_head_size() fix and its regression test are taken here, to keep the later upstream merge (AIESW-37860) conflict-free.

DeepSeek-VL2-tiny_VLM still fails its multimodal sanity check after this fix (answers '100.' instead of 'red'), but that check was already failing on the Jun 26 nightly while the benchmark itself passed — a separate, pre-existing issue, tracked independently of this crash.

🤖 Generated with Claude Code

Cherry-pick of the get_head_size() portion of upstream commit ceae5bc
("[ROCm][CI] Fix nixl tests", vllm-project#45219).

DeepseekVLV2TextConfig materializes a missing head_dim as 0 rather than
leaving it unset. The existing guard only rejected None, so 0 was passed
through as the architecture head size while the true head size is
hidden_size / num_attention_heads = 1280 / 10 = 128. The resulting
zero-sized KV cache made the first inference request abort the engine
with hipErrorLaunchFailure ("CUDA error: unspecified launch failure").

This is a latent bug rather than a recent stack regression: the guard has
only ever tested for None, and the DeepSeek-VL2-tiny configs happened to
survive earlier because different code consumed the head size.

Verified on gfx1151 with the nightly's own benchmark arguments, before vs
after, identical args:

  DeepSeek-VL2-tiny_4096  before: exit 1, 0 successful requests,
                                  5x "unspecified launch failure"
                          after:  exit 0, 2 successful requests,
                                  prefill 22084 tok/s, decode 138 tok/s

  DeepSeek-VL2-tiny_VLM   before: engine dead, 0 tok/s
                          after:  prefill 5167 tok/s, decode 154 tok/s

Changes:
- The upstream commit also carries nixl/CI test changes that are unrelated
  to this crash; only the get_head_size() fix and its regression test are
  taken here to keep the later upstream merge (AIESW-37860) conflict-free.
- DeepSeek-VL2-tiny_VLM still fails its multimodal sanity check after this
  fix, but that check was already failing on the Jun 26 nightly while the
  benchmark itself passed, so it is a separate pre-existing issue.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@zohaibm-amd
zohaibm-amd requested a review from mgehre-amd July 30, 2026 19:17
@zohaibm-amd
zohaibm-amd marked this pull request as ready for review July 30, 2026 19:18
@zohaibm-amd
zohaibm-amd requested a review from roberteg16 July 31, 2026 13:58
Comment thread vllm/transformers_utils/model_arch_config_convertor.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants