Skip to content

[Perf] [AMD] Qwen3-Next: fused QK Gemma RMSNorm + partial RoPE on gfx950 - #45739

Merged
HaiShaw merged 2 commits into
sgl-project:mainfrom
karverma-amd:karverma/qwen3-next-fused-prologue
Oct 27, 2026
Merged

HaiShaw merged 2 commits into
sgl-project:mainfrom
karverma-amd:karverma/qwen3-next-fused-prologue

Conversation

@karverma-amd

@karverma-amd karverma-amd commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Route the Qwen3-Next full-attention prologue — the per-head [Q||gate] split, Q/K Gemma RMSNorm (x*(1+w)), and partial NeoX RoPE (rotary_dim 64) — through the fused aiter op fused_attention_qk_norm_rope on gfx950, replacing three small launches with one.

Gating

  • Gated on SGLANG_USE_AITER + is_hip() — no bespoke per-kernel flag.
  • The aiter import is lazy and only reached on HIP, so the NVIDIA common path never imports or touches the AMD-only code.
  • Support is probed (fused_attention_qk_norm_rope_supported), not asserted, so any uncovered shape (dtype/width/arch) falls back to the native split + GemmaRMSNorm + RoPE. The attention backend still writes the KV cache.

Dependencies

Test results

E2E on Qwen3-Next-80B-A3B-Instruct-FP8, MI355X 2×TP4, latest nightly (v0.5.22-rocm724-mi35x-20261021) with Triton 3.8.0:

  • Median TPOT −2.3 to −3.0% at concurrency 1/8/32 (throughput +2.3 to +7.9%); stable through cuda-graph capture and sustained conc-8/32/64 load.
  • GSM8K 1319-question 5-shot: parity (fused 0.941 / native 0.948, 0 invalid).
  • Engagement confirmed on the fused arm; fail-closed to native verified on the control arm.
  • The same nightly on stock Triton 3.7 and v0.5.21 + Triton 3.8 reproduce the same −2.5 to −3.0% TPOT and GSM8K parity.

CI States

Latest PR Test (Base): ✅ Run #40387799828
Latest PR Test (Extra): ❌ Run #40387799898
Latest PR Test (AMD ROCm 10): ⏳ Run #40387799746

@github-actions

This comment has been minimized.

@karverma-amd
karverma-amd force-pushed the karverma/qwen3-next-fused-prologue branch from 5aff2db to 9062146 Compare October 22, 2026 18:41
@github-actions

This comment has been minimized.

@karverma-amd karverma-amd changed the title [AMD] Qwen3-Next: fused QK Gemma RMSNorm + partial RoPE on gfx950 [Perf] [AMD] Qwen3-Next: fused QK Gemma RMSNorm + partial RoPE on gfx950 Oct 22, 2026
@karverma-amd
karverma-amd force-pushed the karverma/qwen3-next-fused-prologue branch from 9062146 to bb16153 Compare October 22, 2026 18:54
@karverma-amd

Copy link
Copy Markdown
Contributor Author

Aiter PR - ROCm/aiter#6835

Rebased onto current main to resolve the merge conflict. The stacked
smallm_fp8_blockscale_gfx950 import fix (sgl-project#45738) is now redundant -- main
already imports the renamed hipcc helpers -- so this drops to the fused
prologue wiring in qwen3_next.py alone. Verified get_bool_env_var /
is_gfx95_supported and the model attrs the wiring uses still exist on main.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@karverma-amd
karverma-amd force-pushed the karverma/qwen3-next-fused-prologue branch from bb16153 to 8f7bae0 Compare October 26, 2026 17:29

@HaiShaw HaiShaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HIP/AITER specific optimization

@HaiShaw HaiShaw added the run-ci CI: run the baseline test suite on this PR label Oct 26, 2026
@HaiShaw
HaiShaw merged commit db90f58 into sgl-project:main Oct 27, 2026
180 of 190 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jit-kernel run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants