← Back to Pull requests

fix(musa): build the rope store-hint variants during warmup #327

Open
unknown opened this pull request with 420 lines diff across 5 files
View on GitHub
unknown unknown commented on Nov 06, 2026 23:10 UTC
Author

Summary

Stacked on #326 (base xd/musa-arch-infra); retarget to v0.32.0-dev after #326 merges.

The MUSA rotary-embedding kernel picks its cache-store hint from the runtime token count: stcg for 512..2048 tokens at rotary width 64, stwb otherwise. Each hint is its own JIT module, so a server that had only seen short batches built the other module the first time a batch crossed 512 tokens, in the middle of serving.

The DeepGEMM warmup runs before graph capture for every model. It now loads every hint the kernel can pick, for each rotary width a live call path hands the kernel. It builds nothing a live path cannot reach:

  • MusaRotaryEmbedding: counts when CustomOp dispatches it to forward_oot, VLLM_MUSA_CUSTOM_OP_USE_NATIVE is unset, and the config does not prefer the Qwen3 QK-RoPE-KV pre-split.

  • - The pre-split replaces the rotary calls (default Qwen3 compiled servers), so those models build no rope module.
    - The width comes from the module's cos_sin_cache, so partial-rotary models use the rotated width.
  • MusaVisionApplyRotaryEmb: counts unless VLLM_MUSA_CUSTOM_OP_USE_NATIVE is set.

  • Failures only log a warning.
  • A separate docs commit, unrelated to the rope change, removes export VLLM_DISABLE_COMPILE_CACHE=1 from the two Qwen3.5-27B recipes (docs/cookbook/qwen/qwen3.5-27b-bf16.md, qwen3.5-27b-fp8.md). Both run with compilation mode NONE, where vLLM never compiles the model and never reads or writes its compile cache, so the variable has no effect.

    Test plan

    On 2x MTT S5000, driver 5.2.0-server, image vllm:v0.32.0-ph1-5.2.0-torch2.11.0.post2-20261106 (digest-pinned), this branch built from source with torchada 0.1.107 (MooreThreads/torchada#146):

  • tests/test_rope_store_hint_prewarm.py: 53 passed. It needs no device.

  • Width-64 MusaRotaryEmbedding on the device:

  • - dispatch is forward_oot;
    - warmup builds vllm_musa_rope_stwb and vllm_musa_rope_stcg;
    - 700-token and 100-token calls build nothing new and match forward_native within bf16 tolerance.
  • Qwen3-8B, default compiled server: the Qwen3 QK-RoPE-KV pre-split applies to all 36 layers, no rope module is built, and there is no prewarm. 4/4 requests pass, including a prompt of several hundred tokens.

  • Qwen3-8B, --enforce-eager (rope kernel live): warmup logs Loaded MUSA rotary-embedding kernels: vllm_musa_rope_stwb. The requests build no new module, and 4/4 pass.

  • Qwen2-VL-2B-Instruct (vision rotary, width 80): warmup loads vllm_musa_rope_stwb, and 4/4 requests pass.

  • Second leased run, this branch rebuilt on #326's current head:

  • - tests/test_rope_store_hint_prewarm.py passed on the device, inside the focused set listed on #326.
  • Qwen3.5-27B recipes without the variable, run as written apart from the model path (2x S5000, TP2, MTP1), BF16 and FP8:

  • - BF16 was ready in 543 s and FP8 (quantization=fp8) in 282 s.
    - Each answered 3/3 requests correctly, including a 1479-token prompt, and MTP accepted its drafted tokens.
    - Both logs say "Inductor compilation was disabled by user settings" and contain no compile-cache or AOT load/save lines. Neither run wrote a torch_compile_cache file under its fresh VLLM_CACHE_ROOT.

    AI assistance: Claude Code drafted this change and ran the MUSA validation listed above.

    Diff: 420 lines (+315 / -105) across 5 files Reviewer: yeahdongcn Review duration: 3626m
    All Vouch review confidence checks passed
    Residual risk 0.29 = Change Risk (0.50) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 420 lines diff across 5 files
    0.50
    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.362
    Shallow Review Depth shallow_review_depth
    0.344
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #327"
    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: 50% (MEDIUM) · Higher = larger blast radius
    50%
    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: 28.5% · Safe to merge
    28.5%