Skip to content

[Perf] [XPU] server_args: Enable fused QK-norm + RoPE by default - #43345

Merged
mingfeima merged 6 commits into
sgl-project:mainfrom
mehersai07:xpu-fused-qk-norm-rope-default
Oct 19, 2026
Merged

mingfeima merged 6 commits into
sgl-project:mainfrom
mehersai07:xpu-fused-qk-norm-rope-default

Conversation

@mehersai07

@mehersai07 mehersai07 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

#40190 wired the fused QK-norm + RoPE kernel (sgl_kernel.fused_inplace_qknorm_rope) into Qwen3-MoE on XPU behind the existing opt-in --enable-fused-qk-norm-rope. Its A/B on Qwen3-30B-A3B (TP=4, 4x Arc Pro B60) showed +4.7-7.0% output throughput, -60% q/k-norm + RoPE stage device time, and no accuracy change (GSM8K 0.9414 vs 0.9460).
The flag is opt-in on CUDA for a reason that does not apply to XPU: on CUDA the unfused path already fuses RoPE with the KV-cache write (fused_set_kv_buffer), and the fused QK-norm path gives that up. enable_fused_set_kv_buffer is CUDA/HIP-only, so the XPU unfused path has nothing to lose. This PR makes the fused path the XPU default; everything else is unchanged.

Modifications

  • arg_groups/fields/exec_.py: enable_fused_qk_norm_rope becomes a tri-state (Optional[bool] = None, BooleanOptionalAction, resolvable=True), the same shape as enable_dsa_fused_indexer. --enable-fused-qk-norm-rope keeps working; --no-enable-fused-qk-norm-rope is the new opt-out.
  • arg_groups/platform_hook.py: handle_xpu_backends declares enable_fused_qk_norm_rope=True when the device is XPU and the user did not choose, next to the existing XPU sampling_backend default.
  • Docs: the flag's rows in server_arguments.mdx and the Ascend support table.

On every other platform the field stays None. Its two readers (qwen3_moe.py, mellum.py) use it only in and chains and truthiness checks, so None behaves exactly like the old False. No model code changes.

One visible difference: off XPU, /get_server_info now reports enable_fused_qk_norm_rope: null instead of false, matching how enable_dsa_fused_indexer reports.

Accuracy Tests

No new numerics: the kernel and call site are the ones #40190 measured (GSM8K above). The nightly test/registered/xpu/llm_models/test_xpu_qwen3_30b_a3b.py (TP=4 GSM8K, threshold 0.90) now runs the fused path by default.

Resolution, checked through prepare_server_args + resolve_once():

device flag resolved
xpu none True
xpu --enable-fused-qk-norm-rope True
xpu --no-enable-fused-qk-norm-rope False
non-XPU none None (off)
non-XPU --enable-fused-qk-norm-rope / --no-enable-fused-qk-norm-rope True / False

Speed Tests and Profiling

Checklist

Review and Merge Process

  1. Ping Merge Oncalls to start the process. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • Common commands include /tag-and-rerun-ci, /tag-run-ci-label, /rerun-failed-ci
  4. After green CI and required approvals, ask Merge Oncalls or people with Write permission to merge the PR.

CI States

Latest PR Test (Base): 🚫 Run #38838489630
Latest PR Test (Extra): ❌ Run #38838489477
Latest PR Test (AMD ROCm 10): ❌ Run #38838489627

cc: @rahulvijayaraghavan @rbabukv

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 9, 2026
@mehersai07
mehersai07 marked this pull request as ready for review October 9, 2026 10:27
@polisettyvarma

Copy link
Copy Markdown
Contributor

/tag-run-ci-label

@github-actions github-actions Bot added the run-ci CI: run the baseline test suite on this PR label Oct 9, 2026
@mingfeima

Copy link
Copy Markdown
Collaborator

@gaopengff could you please help review this one?

@gaopengff gaopengff left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

@mingfeima mingfeima added intel xpu intel gpu with device `torch.xpu` labels Oct 14, 2026
@mingfeima mingfeima changed the title [XPU] Enable fused QK-norm + RoPE by default [Perf][XPU] Enable fused QK-norm + RoPE by default Oct 15, 2026
@mingfeima

Copy link
Copy Markdown
Collaborator

/rerun-failed-ci

@mehersai07 mehersai07 changed the title [Perf][XPU] Enable fused QK-norm + RoPE by default [Perf] [XPU] Enable fused QK-norm + RoPE by default Oct 15, 2026
@mehersai07 mehersai07 changed the title [Perf] [XPU] Enable fused QK-norm + RoPE by default [Perf] [XPU] server_args: Enable fused QK-norm + RoPE by default Oct 15, 2026
@mingfeima
mingfeima merged commit 7f96dc6 into sgl-project:main Oct 19, 2026
158 of 182 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation intel run-ci CI: run the baseline test suite on this PR xpu intel gpu with device `torch.xpu`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants