← Back to Pull requests

build: move the MUSA image to Python 3.12 and torch 2.13.0.post1 #336

Open
unknown opened this pull request with 450 lines diff across 5 files
View on GitHub
unknown unknown commented on Nov 09, 2026 10:58 UTC
Author

Summary

Move the v0.32.0-dev MUSA image to system CPython 3.12 and the torch 2.13 MUSA stack:

| Package | Before | After |
|---|---|---|
| Python | 3.10 | 3.12 |
| torch, torch_musa | 2.11.0.post2+musa5.2.0 | 2.13.0.post1+musa5.2.0 |
| torchvision | 0.26.0.post2+musa5.2.0 | 0.28.0.post1+musa5.2.0 |
| torchaudio | 2.11.0.post2+musa5.2.0 | unchanged, the release paired with torch 2.13 |
| torchada | 0.1.105 | 0.1.106 |
| deep_ep | ...torch2.11.0.post2 | ...torch2.13.0.post1 (not published yet) |

The torch 2.13 MUSA wheels are published for cp312 only, and upstream vLLM v0.32 requires Python 3.11 or newer. This replaces the Python 3.12 work in #119, which targets v0.24.0-dev.

Other changes:

  • Install Python 3.12 from the Deadsnakes PPA, with a configurable mirror, and bootstrap pip as the system interpreter.

  • Install the MUSA wheels with --only-binary so a missing cp312 wheel fails the build.

  • Cap setuptools below 81 in build.txt. setup.py installs vLLM's build requirements during the native build, and the downgrade from a newer setuptools breaks the running process on Python 3.12.

  • Build _C_stable_libtorch with torch_musa's stable headers ahead of torchada's torch 2.9 forwards, and map TORCH_CHECK to STD_TORCH_CHECK for stable kernels.

  • Install mcp-types, soundfile and av, which the --no-deps vLLM install drops, and import them in the image self-check.
  • Blocked on

    This stays a draft until both wheels exist. The image cannot build from this branch before then.

  • deep_ep for torch 2.13.0.post1 / cp312. The pin uses the expected name and will be corrected if the published version differs. The torch 2.11 wheel fails to import on torch 2.13 with an undefined c10::impl::cow::materialize_cow_storage.

  • mooncake-transfer-engine-musa cp312. PyPI has cp310 only.
  • Validation

    Tested 2d801da102 on 4x MTT S5000, driver 5.2.0-server, in an image built with a validation overlay that removes only deep_ep and the Mooncake install, with BUILD_VLLM_RS=0 and the Python frontend. Normal compiled serving path, no eager flags.

  • Image build: all native extensions compile against torch 2.13; docker/verify_installed_dependencies.py passes.

  • torch.mm / torch.bmm with out_dtype=torch.float32 on bf16 and fp16: non-zero, max relative error about 1e-7 against the fp32 product.

  • Offline: 203 tests pass on Python 3.12 (contract, dependency, series and manifest tests); tools/musa_sync.py check-series passes.
  • | Model | TP | Backend | Result |
    |---|---:|---|---|
    | Qwen3-8B | 1 | FLASH_ATTN | Beijing |
    | DeepSeek-V2-Lite | 2 | FLASHMLA | Beijing |
    | Qwen3.5-35B-A3B | 4 | FLASH_ATTN | Beijing, with the serve line from docs/cookbook/qwen/qwen3.5-35b-a3b-bf16.md |

    Not run or open

  • DeepEP and Mooncake paths: waiting on the wheels above.

  • vllm-rs: BUILD_VLLM_RS=1 fails on the current base branch because third_party/vllm/tools/install_protoc.sh is not in the pinned upstream commit. Not addressed here.

  • Qwen3.5-35B-A3B with default compilation settings (TP4, --gpu-memory-utilization 0.85) ran out of memory during CUDA graph memory profiling. The same settings were not compared on torch 2.11.

  • FP8 checkpoints were not run; the three models above are BF16.

  • No performance comparison against the torch 2.11 stack.

  • Patch 0202 (Python 3.10 shim) is a no-op on 3.12 and is kept for now: removing it renumbers the later patches and conflicts with open series PRs.
  • AI assistance: Claude Code drafted these changes and ran the MUSA validation listed above.

    Diff: 450 lines (+337 / -113) across 5 files Reviewer: yeahdongcn Review duration: 39m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.50) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 450 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%
    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.366
    Shallow Review Depth shallow_review_depth
    0.344
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #336"
    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: 50.4% (MEDIUM) · Higher = larger blast radius
    50.4%
    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: 26.9% · Safe to merge
    26.9%