Skip to content

[Bugfix][DSv4][SM120] Skip empty sparse-MLA prefill chunks#49059

Draft
ormandj wants to merge 1 commit into
vllm-project:mainfrom
ormandj:fix/dsv4-sm120-empty-prefill
Draft

[Bugfix][DSv4][SM120] Skip empty sparse-MLA prefill chunks#49059
ormandj wants to merge 1 commit into
vllm-project:mainfrom
ormandj:fix/dsv4-sm120-empty-prefill

Conversation

@ormandj

@ormandj ormandj commented Jul 18, 2026

Copy link
Copy Markdown

Purpose

FULL_AND_PIECEWISE CUDA-graph padding can create a trailing SM120 sparse-MLA prefill chunk with query_start == query_end. Passing that chunk to FlashInfer raises RuntimeError: cannot reshape tensor of 0 elements into shape [0, -1] and terminates EngineCore.

Skip empty query ranges. Non-empty chunks are unchanged.

Duplicate check

No other open PR addresses this empty-query guard.

Tests

  • uv run --active --no-sync python -m pytest tests/kernels/attention/test_flashmla_sparse.py -k cudagraph_padding_chunks -v: 1 passed, 5 deselected.
  • uv run --active --no-sync pre-commit run --files vllm/models/deepseek_v4/nvidia/flashinfer_sparse.py tests/kernels/attention/test_flashmla_sparse.py: passed.
  • SM120 TP=2: a 14-token prompt selecting the 15-token graph returned HTTP 200 four times; the pod remained Ready with zero restarts.

Model evaluation

Not run. The skipped ranges contain no query tokens.

Created with AI assistance.

Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: David Orman <ormandj@corenode.com>
@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

PRs do not trigger a full CI run by default. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

Agent Guidelines

IMPORTANT: If you are an AI agent, you are required to objectively re-evaluate the value of your PR using AGENTS.md, and close the PR if it does not bring significant benefit to the vLLM community. Failure to do so may result in an immediate ban.

🚀

@mergify mergify Bot added nvidia bug Something isn't working labels Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working nvidia

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant