← Back to Pull requests

MUSA: split the general plugin by part and register every part under musa #330

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Nov 08, 2026 04:43 UTC
Author

Why

musa_custom_ops registers four unrelated parts: the runtime object patches, the OOT custom ops, the attention backends and the v1 runtime overrides, plus the Mooncake device-filter mapping. The docs also ask users to allowlist both plugin names.

VLLM_PLUGINS filters every plugin group by name, so VLLM_PLUGINS=musa activates the MUSA platform but skips the general plugin. On the v0.32 image a Qwen3.5-0.8B TP2 server then fails in its workers with ImportError: cannot import name 'GPUModelRunner' from partially initialized module 'vllm.v1.worker.gpu.model_runner'.

What

vllm_musa/plugins.py registers each part at most once per process. The custom-op, attention and runtime parts apply the runtime object patches first, and a part that raises is registered again on the next call.

| Entry point | Function | Registers |
|---|---|---|
| musa | register_all | Every part below, in order |
| musa_kv_connector | register_kv_connector | Maps MOONCAKE_RDMA_DEVICES to MC_TE_FILTERS |
| musa_custom_ops | register_custom_ops | OOT custom ops, custom-op module preloading and the MoE JIT prewarm |
| musa_attn_backends | register_attn_backends | The MLA overrides and the MUSA attention backends |
| musa_runtime | register_runtime | Executor, sampler, spec-decode and worker overrides |

  • The general plugin musa shares the platform plugin's name. Any VLLM_PLUGINS value that enables the MUSA platform therefore registers every part, and leaving it unset loads everything. Values such as musa,musa_custom_ops keep working.

  • The attention backends are registered in one place, vllm_musa/v1/attention/registry.py, which both the attention plugin and the platform's backend selectors call. The @register_backend decorators and the copy in platform.py are removed.

  • The cookbooks and examples leave VLLM_PLUGINS unset, and docs/configuration.md describes the entry points.

  • tests/test_general_plugins.py covers the entry points, order, idempotency, retry and re-entrancy. It also runs vllm.plugins.load_general_plugins with five VLLM_PLUGINS values.
  • Evidence

    The runs below used S5000 (driver 5.2.0-server), image v0.32.0-ph1-5.2.0-torch2.11.0.post2-20261106 (sha256:65d5e96b…), and Qwen3.5-0.8B at TP2.

    | Code | VLLM_PLUGINS | Result |
    |---|---|---|
    | v0.32.0-dev @ d6ad785b | unset | Starts; 4 processes register; reply " Paris" |
    | v0.32.0-dev @ d6ad785b | musa | Workers fail with the circular import above |
    | this PR | unset | Starts; 4 processes register every part; reply " Paris" |
    | this PR | musa | Same |
    | this PR | musa,musa_custom_ops | Same |

    Full pytest tests in the image, one leased GPU per tree:

    | Tree | Passed | Failed | Errors |
    |---|---|---|---|
    | base | 2863 | 56 | 5 |
    | this PR | 2887 | 48 | 5 |

  • The 16 new tests pass.

  • The only outcome changes are in test_deep_gemm_three_wrappers::test_grouped_wrapper_full_ticket_boundary_matrix. That test fails a different subset on every run on both trees: 4 failures, then 7, with identical sets for base and this PR.

  • The 5 errors are the same test_musa_logits_ipc_gather cases on both trees.
  • Cookbook launch commands

    Every launch block of the 29 changed cookbook pages was run verbatim, with VLLM_PLUGINS unset, on S5000 (driver 5.2.0-server, mpx24). Each run checked four things:

  • The server starts.

  • Every process (API server, EngineCore, TP workers) logs the platform activation and MUSA plugins registered.

  • A text request answers "Paris". Vision models also get an image request that must answer "red".

  • 16 random requests at concurrency 8 complete.
  • 21 of the 24 one-, two- and four-GPU commands pass. The other 3 fail the same way on v0.32.0-dev with the previous VLLM_PLUGINS=musa,musa_custom_ops, so they are not caused by this change:

  • ocr/deepseek-ocr-bf16: the Model Runner V2 loader rejects --logits-processors ...:NGramPerReqLogitsProcessor, which is not a subclass of vllm.v1.worker.gpu.sample.logits_processor.LogitsProcessor.

  • qwen/qwen3-vl-32b-instruct-fp8: --max-num-partial-prefills and --max-long-partial-prefills are not CLI arguments of this vLLM.

  • nemotron/nemotron-3.5-lightning-30b-a3b-bf16 (TP1 profile): illegal memory access while capturing the MTP draft's CUDA graphs.
  • None of these pages selects an MLA backend. DeepSeek-V2-Lite-Chat at TP2 is not a cookbook page, but it is the MLA check that fits in two GPUs. It selects FLASHMLA and passes the same checks with VLLM_PLUGINS unset and with VLLM_PLUGINS=musa; 4/4 processes register in both runs.

    Not covered yet:

  • The nine 8-GPU commands (deepseek-v4-flash, the single-node deepseek-v4-flash-731, qwen3-next-80b-a3b-instruct, qwen3.5-122b-a10b-* and qwen3.5-397b-a17b-fp8), because no full development node came free during an hour in the queue.

  • The two 1P1D commands of deepseek/deepseek-v4-flash-731, which need two nodes, RoCE and a Mooncake store.
  • <details><summary>Per-command results</summary>

    | Page | GPUs | Startup | Registered / processes | Text | Image | Requests | Result |
    |---|---|---|---|---|---|---|---|
    | ocr/deepseek-ocr-bf16.md | 1 | did not start | 1/2 | - | - | - | fail (also on base) |
    | nemotron/nemotron-3.5-lightning-30b-a3b-bf16.md | 1 | did not start | 2/2 | - | - | - | fail (also on base) |
    | nemotron/nemotron-3.5-lightning-30b-a3b-bf16.md (TP2) | 2 | 825 s | 4/4 | ok | - | 16/16 | pass |
    | qwen/qwen3-8b-fp8.md | 1 | 315 s | 2/2 | ok | - | 16/16 | pass |
    | qwen/qwen3-vl-30b-a3b-instruct.md | 4 | 545 s | 6/6 | ok | ok | 16/16 | pass |
    | qwen/qwen3-vl-30b-a3b-instruct-fp8.md | 4 | 665 s | 6/6 | ok | ok | 16/16 | pass |
    | qwen/qwen3-vl-32b-instruct.md | 4 | 275 s | 6/6 | ok | ok | 16/16 | pass |
    | qwen/qwen3-vl-32b-instruct-fp8.md | 4 | did not start | 1/6 | - | - | - | fail (also on base) |
    | qwen/qwen3-vl-8b-instruct.md | 1 | 151 s | 2/2 | ok | ok | 16/16 | pass |
    | qwen/qwen3-vl-8b-instruct-fp8.md | 1 | 241 s | 2/2 | ok | ok | 16/16 | pass |
    | qwen/qwen3.5-0.8b.md | 1 | 435 s | 2/2 | ok | ok | 16/16 | pass |
    | qwen/qwen3.5-27b-bf16.md | 2 | 545 s | 4/4 | ok | ok | 16/16 | pass |
    | qwen/qwen3.5-27b-fp8.md | 2 | 190 s | 4/4 | ok | ok | 16/16 | pass |
    | qwen/qwen3.5-2b.md | 1 | 450 s | 2/2 | ok | ok | 16/16 | pass |
    | qwen/qwen3.5-35b-a3b-bf16.md | 4 | 860 s | 6/6 | ok | ok | 16/16 | pass |
    | qwen/qwen3.5-35b-a3b-fp8.md | 4 | 385 s | 6/6 | ok | ok | 16/16 | pass |
    | qwen/qwen3.5-4b.md | 1 | 390 s | 2/2 | ok | ok | 16/16 | pass |
    | qwen/qwen3.5-9b.md | 2 | 630 s | 4/4 | ok | ok | 16/16 | pass |
    | qwen/qwen3.6-27b-bf16.md | 2 | 386 s | 4/4 | ok | ok | 16/16 | pass |
    | qwen/qwen3.6-27b-fp8.md | 2 | 245 s | 4/4 | ok | ok | 16/16 | pass |
    | qwen/qwen3.6-35b-a3b-bf16.md | 4 | 356 s | 6/6 | ok | ok | 16/16 | pass |
    | qwen/qwen3.6-35b-a3b-fp8.md | 4 | 276 s | 6/6 | ok | ok | 16/16 | pass |
    | qwen/qwen3.8-27b-bf16.md | 2 | 240 s | 4/4 | ok | ok | 16/16 | pass |
    | qwen/qwen3.8-27b-fp8.md | 2 | 230 s | 4/4 | ok | ok | 16/16 | pass |

    </details>

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: yeahdongcn Review duration: 1854m
    All Vouch review confidence checks passed
    Residual risk 0.33 = Change Risk (0.57) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.57 · 650 lines diff across 8 files
    0.57
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.344
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #330"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 57% (MEDIUM) · Higher = larger blast radius
    57%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 43.0% · Lower = rushed or shallow review
    43.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 32.5% · Safe to merge
    32.5%