← Back to Pull requests

fix(startup): pre-build both rope store-hint variants; drop the stale cache switch #300

Open
unknown opened this pull request with 272 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 22, 2026 09:58 UTC
Author

What this fixes

The rotary-embedding store hint (stwb / stcg) is a compile-time constant in
the JIT module name, so each value is its own .so. The auto policy picks
stcg for 512..2048 tokens and stwb otherwise, so a server that only ever saw
short batches builds the other variant the first time a batch crosses 512
tokens
— an mcc build in the middle of serving.

This prewarms both variants from the warmup that runs before graph capture, and
drops VLLM_DISABLE_COMPILE_CACHE=1 from the two Qwen3.5-27B recipes, where it
turned off the compile cache to work around a safelist gap the in-tree patch
already fixes.

Stacked on #299

Rebased onto dsh/pr-musa-multiarch-foundation (#299), because rope.py reads
the arch from vllm_musa.device_spec. The earlier revision imported that module
from a base that did not have it, so the first prefill raised
ModuleNotFoundError while the warmup's own except turned it into a boot
warning. Merge #299 first.

Review follow-ups in this revision

  • prewarm_rope_modules(rot_dim) builds one variant when the model's rotary

  • width is not 64: _store_hint only returns stcg at rot_dim == 64, so a
    model with another width was paying for a build it could never load. The
    warmup passes head_dim, and None (unreadable) keeps both — the safe
    direction.
  • The docstring says the prewarm runs from the warmup before graph capture, not

  • at plugin registration.
  • The warmup test now asserts the rotary width reaches the prewarm instead of

  • only that the stub was called, and a new test pins
    reachable_store_hints() per width.
  • The two cookbook recipes state the current fact in one line instead of

  • narrating what the removed switch used to work around.

    Verification

    Tests are pure Python with the JIT layer stubbed (tests/test_startup_prewarm.py).

    Not run: an mcc build of the two variants on hardware, and a serving run that
    crosses 512 tokens. The earlier Built MUSA rotary-embedding kernels: mp31_stwb,
    mp31_stcg
    line in this PR could not have come from the previous revision, whose
    base had no device_spec; the claim is withdrawn until a leased run produces it.

    Diff: 272 lines (+204 / -68) across 3 files Reviewer: yeahdongcn Review duration: 3075m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.44) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.44 · 272 lines diff across 3 files
    0.44
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.336
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #300"
    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: 44.5% (MEDIUM) · Higher = larger blast radius
    44.5%
    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: 23.7% · Safe to merge
    23.7%