← Back to Pull requests

fix(jit): key the JIT cache on arch and mcc version; stop guessing mp_31 #293

Closed
unknown closed this pull request without merging on Oct 22, 2026 08:55 UTC
View on GitHub
unknown unknown commented on Oct 22, 2026 07:07 UTC
Author

The JIT build directory was the kernel name alone (jit.py:124,172), so a .so built for one arch or one compiler was reused by the next. On MUSA that is a correctness hole, not a stale-cache annoyance: a cubin for the wrong arch loads, runs, returns success from musaDeviceSynchronize and leaves the output buffer untouched, so the failure mode is a wrong result with no diagnostic.

Changes

  • Build dir and lock become <kernel>__<arches>__mcc<version>, e.g. vllm_musa_moe__mp_31__mcc5.2.0. Switching arch or mcc now forces a rebuild instead of silently reloading a foreign binary.

  • _musa_arch_flags() no longer falls back to --offload-arch=mp_31 when the device query fails. It raises and names VLLM_MUSA_ARCH_LIST as the way to build without a visible device. Guessing the arch was the one thing turning a loud failure into a silent wrong answer.

  • _mcc_version() anchors on the mcc version X.Y.Z line. mcc --version prints the clang base version first (clang version 14.0.0 ...), so a bare X.Y.Z search tags every build with 14.0.0 and hides real mcc changes.

  • musa_arch_define() replaces the three hardcoded -D__MUSA_ARCH_LIST__=310 in norm.py (x2) and allreduce.py, and refuses a multi-arch build rather than emit one arch's value for a fat binary: tl_templates/musa/*.h compare that macro against a single __MUSA_ARCH__ (== 310, >= 220), so a fat build would silently compile the wrong template branch.
  • Verification

    S5000 (10.20.34.82#1, driver 5.2.0-server, mcc 5.2.0, torch 2.11.0.post2+musa5.2.0):

    build_tag()  ->  mp_31__mcc5.2.0
    real build   ->  /root/.cache/vllm_musa_jit/vllm_musa_moe__mp_31__mcc5.2.0
                     with --offload-arch=mp_31 derived from the device
    pytest tests/test_jit_cache_key.py  ->  8 passed
    pytest (all four suites)            ->  25 passed
    

    New tests pin: explicit arch list wins; a fat list is preserved in the flags but refused by musa_arch_define; no mp_31 fallback when the device query fails; the tag distinguishes both arch and compiler.

    Diff: 256 lines (+192 / -64) across 3 files Reviewer: yeahdongcn Review duration: 107m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.44) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.44 · 256 lines diff across 3 files
    0.44
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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.332
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #293"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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.1% (MEDIUM) · Higher = larger blast radius
    44.1%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 17.4% · Safe to merge
    17.4%