← Back to Pull requests

MUSA: re-land the DiffusionGemma /v1/systemone enablement on v0.32 (supersedes #249, #259) #301

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Oct 22, 2026 10:34 UTC
Author

Supersedes #249 (the v0.28 port of upstream vLLM #57250) and #259 (the v0.28 docs). Both are
closed: the port itself is no longer needed, because vLLM v0.32 already carries the feature.

Why this is much smaller than #249

v0.32.0-dev pins VLLM_COMMIT=5df63a7203 (v0.32.0), and that tree already contains
vllm-project/vllm#57250 (merged 2026-09-22 as
1b3b88ec2b74):

  • /v1/systemone is a native endpoint (vllm/entrypoints/generate/structured_decisions/), with

  • DiffusionGemmaCanvasStrategy / JointSchemaStrategy / NextTokenStrategy;
  • the per-request canvas machinery is in-tree (vllm/utils/diffusion.py,

  • vllm/v1/core/sched/diffusion_scheduler.py, vllm/model_executor/models/diffusion_gemma.py);
  • upstream ships the sample interposer as examples/features/structured_diffusion/structured_server.py.
  • The two MUSA fixes that landed on v0.28 through #254 are already on this line too:
    vllm_musa/platform.py::force_triton_attn_for_diffusion() (wired in check_and_update_config,
    so a diffusion model gets TRITON_ATTN instead of a MUSA FlashAttention path that cannot express a
    per-request tensor causal), and the kernel_unified_attention PEP-604 annotation repair inside
    series entry 0001.

    So this PR carries only what is genuinely missing on MUSA.

    What is in here

    | # | Change | Why |
    |---|---|---|
    | 016665e01b | vllm_musa/optimization_contract/resolver.py: read per-layer config attributes through config_attr, and report an ambiguous one as missing | This one is a startup blocker. transformers 5.x keeps per-layer attributes (head counts and dims of a sliding/full hybrid) behind an interception that raises AmbiguousGlobalPerLayerAttributeError, a RuntimeError; getattr's default only covers AttributeError, so the resolver aborted engine creation for DiffusionGemma ('num_key_value_heads' is a per-layer attribute) before it could fail closed to UNKNOWN. A RuntimeError of any other type still propagates. Regression test: tests/test_optimization_contract_per_layer_config.py fails on the previous resolver with exactly that error and passes now. |
    | 32aa414453 | Series entry 0055: the DiffusionGemma read tests gate on current_platform.is_cuda_alike() and take the device from current_platform.device_type | The suite gated on is_cuda() and hardcoded device="cuda", so a MUSA run skipped the whole per-request canvas/pin/read-only state machine. MUSA reports itself is_cuda_alike() while keeping is_cuda() false. 21 cases now run. |
    | f2d91b033e | Cookbook recipe + index, README/README_CN rows | /v1/systemone is an engine endpoint on this line, so the recipe drops the port-18011 interposer and the layered :jev image; it documents --logprobs-mode raw_logprobs and the MUSA TRITON_ATTN pin. |

    Series README updated to 55 patches; tools/musa_sync.py verify and check-series are clean.

    Review rounds 1-3 are folded in on top: eba4405119, 6af327e71c, f2d91b033e,
    ab385652b3, f6c1a95611, 48c8c01179, 2cc3f3db91, e6a89e190f, 725886554f, 64b7f1071b, 63cba40e2b, 5447c1ab72, 1fc8fedbbd, 79d1bdebf3, b4279845b2. No review cycle has
    reported a blocking finding since round 2.

    Evidence (one leased S5000, development pool)

    Environment: host 10.20.34.82, GPU 7 (e83180e0-…), driver 5.2.0-server, MUSA 5.2.0,
    image sh-harbor.mthreads.com/mcctest/vllm:v0.32.0-ph1-5.2.0-torch2.11.0.post2-20261022
    (digest sha256:aba800a8…), torch/torch_musa 2.11.0.post2+musa5.2.0, triton 3.2.0,
    vllm 0.32.0, vllm_musa 0.1.32.

    | Check | Result |
    |---|---|
    | tests/v1/sample/test_diffusion_gemma_reads.py before entry 0055 | 21 skipped |
    | same suite, entry 0055 applied | 21 passed (33.4 s) |
    | tests/test_optimization_contract_per_layer_config.py on the previous resolver | 1 failed — AmbiguousGlobalPerLayerAttributeError: 'num_attention_heads' is a per-layer attribute |
    | same test, this PR | 3 passed (parametrized over the pinned error class and a subclass) |
    | tools/musa_sync.py check-series / verify --repo <pristine pin> | 55/55 clean, 58 clean / 93 total / 0 need attention |
    | tests/test_musa_sync.py (local) | 104 passed |
    | 26B BF16 end to end: vllm serve /models/diffusiongemma-26B-A4B-it --logprobs-mode raw_logprobs --max-logprobs 32 | ready in ~6 min; weights 48.53 GiB; 11.46 GiB KV; TRITON_ATTN selected automatically |
    | POST /v1/systemone — noul + choice + score in one request | 200, three identical reads at 0.17 s warm: noul 0.974, choice platform 1.000, score 2.98 (critical); diagnostics.argmax_is_label true, label_mass 0.998–1.000; 242 in / 6 out tokens |
    | POST /v1/chat/completions | thought\nYes, the sky is blue during a clear day. |

    Logs and the full response JSON are in the MUSA-100086 ticket under
    generated/MUSA-100086/logs/.

    Re-validation at the PR head

    Re-run on the head revision (one leased S5000, GPU 0 cc3be90f-…, same host and driver), with the
    image's baked tree overlaid by this branch's vllm_musa/optimization_contract/, series entry 0055
    and the regression test, so the code under test is exactly this PR:

    | Check | Result |
    |---|---|
    | tests/v1/sample/test_diffusion_gemma_reads.py | 21 passed (68.7 s) |
    | tests/test_optimization_contract_per_layer_config.py | 3 passed (4.9 s) |
    | the same two files with the image's own resolver.py restored | fails at import — policy.py asks for config_attr, which the previous resolver does not export, so the two halves only work together |
    | vllm serve /models/diffusiongemma-26B-A4B-it … (the recipe's line, no --diffusion-config) | ready in ~6 min, 11.46 GiB KV (54,235 tokens), TRITON_ATTN |
    | POST /v1/systemone | 200; three reads returned the same answers, usage (242 in / 6 out) and diagnostics: noul 0.9742, choice platform 0.99982, score 2.9792, label_mass 0.99832 / 0.99995 / 0.99970 |
    | POST /v1/chat/completions | thought\nYes, the sky is blue during a clear day. |
    | the recipe's docker run block, run as written | healthy in ~6.5 min, /dev/shm 1.0 GiB, and a read inside that container returned noul 0.97416 / choice platform / score 2.97922 |

    This run also found a documentation defect: the recipe put vllm serve after the image, but the
    release target's entrypoint already is vllm serve (docker/musa.Dockerfile:469,
    docker/README.md:23), so the container died on unrecognized arguments. b4279845b2 drops the
    prefix, matching the Docker guide's own example. The block also needs neither --ipc=host nor --shm-size: the mthreads runtime gives the container 1.0 GiB of /dev/shm, which is what the run above measured.

    Not covered

  • TP > 1, concurrent reads, vision inputs, canvases other than 256.

  • --enforce-eager: the validated run is the default compiled path (Dynamo 79 s, 52 graph captures).

  • The v0.28 line needed Dynamo to insert a dtype cast on sc_embeds[decode_slots]; upstream v0.32
    carries that cast explicitly (57462), so eager may well work now, but it was not measured.
  • Two upstream test suites that need a Hugging Face download (tests/v1/core/test_scheduler.py -k

  • diffusion
    , tests/entrypoints/generate/structured_decisions/) fail in the offline container at
    ModelConfig(model="facebook/opt-125m") / Qwen/Qwen3-0.6B — an environment limit, not a MUSA
    result. The read suite above is the one that exercises the read state machine directly.
  • The image: the recipe and the README row reuse the vllm-openai:jev tag from the previous

  • recipe. The tag currently carries the v0.28 port, so it has to be rebuilt from this branch after
    merge; the dated daily builds carry a vllm_musa without the per-layer config fix the recipe needs.

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: yeahdongcn Review duration: 3038m
    All Vouch review confidence checks passed
    Residual risk 0.30 = Change Risk (0.57) × (1 − Review Confidence (0.47)). 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%
    46%
    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 #301"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 30.4% · Safe to merge
    30.4%