Fused QSA prepare to MUSA (Qwen4Exp / Qwen3.8-Flash-Next) #367
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.48) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 376 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.355
Shallow Review Depth
shallow_review_depth
0.344
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #367"
general
weight: 0.35
yeahdongcn
Summary
Enables the existing fused QSA prepare path on MUSA instead of forcing the
unfused reference chain. One Triton kernel now performs indexer prepare
(Q/K norm + RoPE), compression group pooling, raw/compressed cache row writes,
and the main-attention QK-norm/RoPE/gate/KV write in a single launch per QSA
layer per step.
Previously
use_fused_qk_norm_rope_gaterequiredcurrent_platform.is_cuda(),so
use_fused_qsa_preparewas always false on MUSA and every QSA layer ran~16 launches (
2x gemma_rmsnorm,2x apply_qsa_rope,qsa_compress_groups_with_ratio,2x qsa_store_cache_rows, plus themain-attention q/k norm, RoPE and
do_kv_cache_update).Changes
vllm_musa/kernels/qsa_prepare.py: MUSA port of the CUDA fused preparekernel (same launch signature, so the upstream model code is unchanged).
models/qwen4_exp/nvidia/qsa.py: allow the fused gate on MUSA, guarded byVLLM_MUSA_QSA_FUSED_PREPARE(default on,=0restores the old chain).models/qwen4_exp/nvidia/indexer_qsa.py: dispatch to the MUSA kernel whencurrent_platform.is_musa().model_executor/warmup/qwen4_exp_qsa_warmup.py: pre-warm the fusedspecializations before graph capture, so no JIT happens on the capture stream.
Results (MTT S5000 80 GiB x8, driver 5.2.0, vLLM 0.32.0, TP8 + EP8)
Qwen3.8-Flash-Next BF16, 1024-token inputs, warm JIT, 3 runs per leg, only
VLLM_MUSA_QSA_FUSED_PREPAREtoggled:| Metric | OFF | ON | Delta |
| --- | --- | --- | --- |
| TTFT, 24 req x 1024 in / 1 out | 1388 ms | 1355 ms | -2.4% |
| TTFT, 16 req x 1024 in / 128 out | 1181.5 ms | 1128.7 ms | -4.5% |
| TPOT / ITL, batch 16 | 40.72 ms | 36.78 ms | -9.7% |
| Output throughput, 128-out leg | 322.0 tok/s | 352.7 tok/s | +9.5% |
| Wall duration, 128-out leg | 6.36 s | 5.80 s | -9.4% |
Kernel launches per QSA layer per step: 16 -> 1 (12 QSA layers).
Run-to-run spread: TPOT +-0.24 ms, TTFT +-27 ms, so the TPOT gain is well
outside noise; the TTFT gain is small but consistently in the same direction.
Correctness
positions, aligned and cross-chunk; max abs diff <= 3.1e-2 for indexer
q/main q, <= 1.6e-2 for compressed/main outputs, gate and raw ring buffers
bit-exact, no NaN.
/health200,coherent Chinese answer, no failed requests in any benchmark run.
Test configuration