Skip to content

[MUSA] add platform capability support and skip CUDA-only dtype fallback - #35855

Closed
froststeam wants to merge 1 commit into
sgl-project:mainfrom
froststeam:musa-platform-capability-main
Closed

froststeam wants to merge 1 commit into
sgl-project:mainfrom
froststeam:musa-platform-capability-main

Conversation

@froststeam

@froststeam froststeam commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add in-tree MUSA platform support to SGLang's SRT platform layer:

  • add MusaSRTPlatform with CUDA-compatible device operations and MUSA platform identity
  • make platform auto-discovery select MUSA before CUDA when torch.version.musa is present and torch.musa.is_available() is true
  • call the legacy GPU dtype fallback through maybe_downgrade_dtype_for_legacy_gpu() for all non-CPU devices, while gating the fallback itself on current_platform.is_cuda()
  • bump the srt_musa torchada dependency to >=0.1.84

Dependency

Requires torchada 0.1.84, which contains the MUSA graph-safe operator overrides and Inductor heuristic mapping used by downstream SGLang-Omni graph-enabled paths.

Scope

This keeps the MUSA integration at the platform/capability layer:

  • no model-specific MUSA logic
  • no fake CUDA availability patching
  • no torch.load map-location rewrite
  • no flash-attention import shim
  • non-CUDA platforms skip CUDA-only torch.cuda.get_device_capability() checks

Verification

Rebased onto the latest upstream main.

uvx pre-commit run --files \
  python/pyproject_other.toml \
  python/sglang/srt/model_executor/model_runner.py \
  python/sglang/srt/model_executor/model_runner_components/load_model_utils.py \
  python/sglang/srt/platforms/__init__.py \
  python/sglang/srt/platforms/musa.py

Result: passed.

MUSA runtime checks with torchada 0.1.84 confirmed:

current_platform resolves to the MUSA platform
current_platform.is_musa() == True
torch.musa.is_available() == True
legacy CUDA sm80 dtype fallback is skipped on non-CUDA platforms
CUDA still owns the legacy dtype fallback path

SGLang-Omni integration smoke with latest SGLang, SGLang-Omni, and torchada changes:

Model Request Result
Qwen/Qwen3-ASR-1.7B /v1/audio/transcriptions with a WAV input Passed; returned text transcription
Qwen/Qwen3-TTS-12Hz-0.6B-Base /v1/audio/speech with graph enabled and reduced capture range Passed; generated WAV audio
Qwen/Qwen3-Omni-30B-A3B-FP8 image chat completion with graph enabled Passed; returned the expected image answer
MiniMaxAI/MiniMax-Music3 /v1/audio/speech music generation Passed; generated stereo WAV audio

CI States

Latest PR Test (Base): ❌ Run #32960915709
Latest PR Test (Extra): ❌ Run #32960915567
Latest PR Test (AMD ROCm 7.2): ❌ Run #32960915729

@github-actions github-actions Bot added dependencies Pull requests that update a dependency file mthreads labels Aug 21, 2026
@froststeam
froststeam force-pushed the musa-platform-capability-main branch from 7cb8cfc to 56ae7db Compare August 21, 2026 11:10
@froststeam froststeam changed the title Add MUSA platform capability support [MUSA] add platform capability support and skip CUDA-only dtype fallback Aug 21, 2026
@froststeam
froststeam force-pushed the musa-platform-capability-main branch 2 times, most recently from ff6c233 to df3e21a Compare August 24, 2026 01:49
Comment thread python/pyproject_other.toml Resolved
@froststeam
froststeam force-pushed the musa-platform-capability-main branch 3 times, most recently from 31069f8 to c9b55c4 Compare August 24, 2026 04:46
@yeahdongcn

Copy link
Copy Markdown
Collaborator

/tag-and-rerun-ci

@github-actions github-actions Bot added the run-ci CI: run the baseline test suite on this PR label Aug 24, 2026
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 25, 2026
@froststeam
froststeam force-pushed the musa-platform-capability-main branch 7 times, most recently from 9eccce3 to 773170f Compare August 26, 2026 10:57
@froststeam froststeam closed this Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation mthreads run-ci CI: run the baseline test suite on this PR sgl-kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants