Skip to content

[MUSA] Use MATE Mutlass backend for MAGI-2 FA3 consumer - #7307

Closed
yeahdongcn wants to merge 9 commits into
vllm-project:mainfrom
yeahdongcn:xd/magi2-fa3-consumer
Closed

yeahdongcn wants to merge 9 commits into
vllm-project:mainfrom
yeahdongcn:xd/magi2-fa3-consumer

Conversation

@yeahdongcn

@yeahdongcn yeahdongcn commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

MUSA FA3 consumer for MAGI-2 Preview

Draft child PR for the MUSA consumer side of MAGI-2 attention. This is based on the shared FA3 varlen adapter in #7249. Please merge/review #7249 first, or treat this PR as a stacked Draft. The historical #7156 branch remains unchanged.

Scope

  • On MUSA, use the MATE/torchada wrapper through its default auto backend. Normalize packed LSE to Omni's [H,T] contract before MAGI-2 sink correction.
  • Normalize Omni's negative softcap sentinel to MATE's non-negative convention in the direct-provider compatibility path.
  • Use the exact Torch reference only for query sequences shorter than 32 tokens, where MATE's fast-exp2 approximation accumulates error across repeated tiny layers. Production MAGI-2 sequences remain on FA3; the six operator cases force FA3 independently.
  • Preserve CUDA/ROCm/CPU dispatch. No EP, MoE kernel, mHC, sampler, launch-tile, dependency or performance-tuning changes.

Validation

Published commit: a9921de (full SHA verified on the fork). The current source includes dynamic MATE LSE ABI detection, provider-default selection, FP32 sink correction and the explicit short-sequence policy. Earlier pre-ABI runs are retained only as diagnostic evidence.

  • 17 CPU consumer tests passed; the generic adapter backend-forwarding change has 24 passing CPU tests.
  • Final MUSA run: 7/7 tests passed, 0 skipped. Six sink/LSE operator oracles exercise the provider-default FA3 path; the tiny-transformer case verifies the exact short-sequence fallback and that the provider is not called. Test runtime was 287.62 s, dominated by first-run MATE compilation, and is not a benchmark.
  • Hardware: one60-SM MTT S5000, driver3.3.8-server (not pinned), pinned image registry.mthreads.com/mcconline/inference/vllm-omni@sha256:7f4f2cd83a88979025ef92968334f6e075eb24d45d02e0c30dbb222f7780d58a.
  • Stack: torch/torch_musa2.11.0.post1+musa5.2.0, torchada0.1.83, MATE0.2.6, flash_attn_3 0.2.6+musa, Triton3.2.0, vLLM0.28.0.
  • Targeted pre-commit passed. Source/import and current-lease container checks passed; container exited0 and was removed. No GPU remains leased.

The generic adapter does not expose a mandatory backend parameter. This consumer only adapts installed MATE ABI variants (return_softmax_lse versus return_attn_probs) and LSE layout; backend policy stays with MATE's auto default. The tiny-transformer gate is not relaxed: it uses the documented exact fallback for this short-sequence regime. The six passing operator oracles do not imply full-model FA3 accuracy for long sequences.

Remaining gates

No full272p/10s checkpoint, multi-rank EP, graph/capture, memory-capacity or DiT step performance validation was performed. The historical consumer and #7156 branches remain unchanged. Backend numerical improvement is not a performance claim; full-model accuracy and <=0.7s/step remain open. This PR stays Draft.

Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
(cherry picked from commit c45d685)
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
@hsliuustc0106 hsliuustc0106 added diffusion codes related to diffusion models Hardware Plugin support different hardware beyond cuda labels Sep 9, 2026
@hsliuustc0106

Copy link
Copy Markdown
Collaborator

This PR touches tests/diffusion/, vllm_omni/diffusion/ (4 files). Based on CODEOWNERS coverage of the changed files, the most-related reviewers appear to be:

@wtomin @yenuo26 @NickCao

Could one of you take a look when you get a chance? Thanks!

@yeahdongcn

Copy link
Copy Markdown
Contributor Author

Superseded by #8498. The MUSA FA3 consumer there keeps MATE's default backend selection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

diffusion codes related to diffusion models Hardware Plugin support different hardware beyond cuda

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants