Skip to content

[II] fix(ds4): use B12X DeepSeek attention namespaces - #485

Open
voipmonitor wants to merge 2 commits into
local-inference-lab:dev/infernal-invocationfrom
voipmonitor:fix/ii-b12x-compressed-sparse-namespace-20260826
Open

[II] fix(ds4): use B12X DeepSeek attention namespaces#485
voipmonitor wants to merge 2 commits into
local-inference-lab:dev/infernal-invocationfrom
voipmonitor:fix/ii-b12x-compressed-sparse-namespace-20260826

Conversation

@voipmonitor

@voipmonitor voipmonitor commented Aug 26, 2026

Copy link
Copy Markdown

Purpose

DeepSeek V4 serving must import the public attention namespaces declared by B12X master.

B12X commit 3ae0bf3a443047997d625d44ca24da8bd78904d5 exposes compressed sparse MLA as b12x.attention.compressed_sparse_mla. B12X commit 429a971340ed12e564e07e10ce1f2dbef65bcc7f exposes the DeepSeek Sparse Attention indexer as b12x.attention.dsa_indexer. Both commits intentionally remove the former namespaces without compatibility aliases.

Infernal Invocation still imported the removed module paths during scratch planning, memory profiling, indexer warmup, and decode. A source-locked installation therefore failed before CUDA graph capture.

Resulting behavior

  • Compressed sparse MLA scratch planning, split-contract queries, and decode dispatch use b12x.attention.compressed_sparse_mla.
  • DeepSeek Sparse Attention planning, metadata construction, top-k dispatch, warmup, and tests use b12x.attention.dsa_indexer.
  • Workspace sizing, tensor contracts, launch policy, and numerical operations are unchanged.
  • Integration tests install fake modules under the public paths, so a B12X namespace change cannot be hidden by testing a removed module.

Compatibility

The integration requires the public B12X API at or after commits 3ae0bf3a and 429a9713. It does not restore removed aliases in B12X.

Validation

  • Commit hooks: passed, including Ruff, formatting, mypy, SPDX, and import checks.
  • tests/models/deepseek_v4/test_b12x_compressed_mla_workspace.py: 24 passed with B12X master plus PR [GG] chore(b12x): port integration to renamed package #246; two pin-memory cases require an NVIDIA driver and were excluded from the CPU-only run.
  • Public DSA API import gate: passed for planner, paged metadata, contiguous logits, tiled top-k, row top-k, and fused-indexer warmup symbols.
  • Python bytecode compilation: passed for all changed production and test modules.
  • Source-locked runtime gate: model weights load successfully with compressed_sparse_mla; the unpatched DSA import fails at memory profiling. Full TP2 runtime qualification will be attached after the release composition includes both commits.

Duplicate check

No open pull request matching the B12X compressed sparse MLA or DSA indexer namespace migration exists in vllm-project/vllm or local-inference-lab/vllm as of 2026-08-26.

AI assistance was used to inspect the source-lock failures, update the namespace contract, and run the listed checks. Every changed line and the runtime evidence were reviewed by the submitter.

Summary by CodeRabbit

  • Bug Fixes
    • Updated B12X sparse attention and compressed MLA integration to use the current backend interfaces.
    • Improved compatibility for DeepSeek V4 execution, scheduling, warmup, and workspace management.
    • Updated validation coverage to reflect the current B12X attention components, helping prevent regressions.

Bind DeepSeek V4 scratch planning and decode to the public compressed_sparse_mla namespace introduced by B12X commit 3ae0bf3a. The operation contract and workspace geometry remain unchanged.

Assisted-by: OpenAI Codex <noreply@openai.com>

Signed-off-by: Martin Vit <martin@voipmonitor.org>
@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e0aa777-6c44-4cb2-aa71-16bd73358e97

📥 Commits

Reviewing files that changed from the base of the PR and between b5f995e and 93be798.

📒 Files selected for processing (6)
  • tests/model_executor/layers/test_sparse_attn_indexer_b12x.py
  • tests/models/deepseek_v4/test_b12x_compressed_mla_workspace.py
  • vllm/model_executor/layers/sparse_attn_indexer.py
  • vllm/model_executor/warmup/b12x_sparse_indexer_warmup.py
  • vllm/models/deepseek_v4/nvidia/b12x.py
  • vllm/v1/attention/backends/mla/indexer.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

B12X runtime code now imports sparse indexer functionality from dsa_indexer and compressed MLA functionality from compressed_sparse_mla. Tests update their fake and optional module paths to match.

Changes

B12X module path updates

Layer / File(s) Summary
Sparse indexer and scheduling imports
vllm/model_executor/layers/sparse_attn_indexer.py, vllm/model_executor/warmup/b12x_sparse_indexer_warmup.py, vllm/v1/attention/backends/mla/indexer.py, tests/model_executor/layers/test_sparse_attn_indexer_b12x.py
B12X sparse indexer execution, top-k merging, warmup, scratch reservation, scheduling, and test fakes now use b12x.attention.dsa_indexer modules.
Compressed sparse MLA integration
vllm/models/deepseek_v4/nvidia/b12x.py, tests/models/deepseek_v4/test_b12x_compressed_mla_workspace.py
Compressed MLA runtime imports, fake module registration, and optional test imports now use b12x.attention.compressed_sparse_mla.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 93be7

The PR updates DeepSeek serving imports to the required public B12X namespaces while preserving tensor contracts and launch behavior; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: lukealonso

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.75% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: updating DeepSeek V4 B12X attention integrations to use the correct attention namespaces.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

B12X exposes the DeepSeek sparse-attention indexer through attention.dsa_indexer and does not retain the former NSA namespace. Route runtime planning, decode, warmup, and their module fixture through the declared public API without changing indexer behavior.

Co-authored-by: OpenAI Codex <codex@openai.com>

Signed-off-by: Festr <festr@users.noreply.github.com>

Signed-off-by: Martin Vit <martin@voipmonitor.org>
@voipmonitor voipmonitor changed the title [II] fix(ds4): use B12X compressed sparse MLA API [II] fix(ds4): use B12X DeepSeek attention namespaces Aug 26, 2026
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.

1 participant