Repository navigation
[Perf] [XPU] server_args: Enable fused QK-norm + RoPE by default - #43345
Merged
mingfeima merged 6 commits intoOct 19, 2026
Merged
Conversation
rahulvijayaraghavan
approved these changes
Oct 9, 2026
mehersai07
marked this pull request as ready for review
October 9, 2026 10:27
mehersai07
requested review from
JustinTong0323,
sogalin,
wisclmy0611 and
zijiexia
as code owners
October 9, 2026 10:27
Contributor
|
/tag-run-ci-label |
Collaborator
|
@gaopengff could you please help review this one? |
mingfeima
requested changes
Oct 14, 2026
mingfeima
approved these changes
Oct 15, 2026
Collaborator
|
/rerun-failed-ci |
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_bufferis 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_ropebecomes a tri-state (Optional[bool] = None,BooleanOptionalAction,resolvable=True), the same shape asenable_dsa_fused_indexer.--enable-fused-qk-norm-ropekeeps working;--no-enable-fused-qk-norm-ropeis the new opt-out.arg_groups/platform_hook.py:handle_xpu_backendsdeclaresenable_fused_qk_norm_rope=Truewhen the device is XPU and the user did not choose, next to the existing XPUsampling_backenddefault.server_arguments.mdxand the Ascend support table.On every other platform the field stays
None. Its two readers (qwen3_moe.py,mellum.py) use it only inandchains and truthiness checks, soNonebehaves exactly like the oldFalse. No model code changes.One visible difference: off XPU,
/get_server_infonow reportsenable_fused_qk_norm_rope: nullinstead offalse, matching howenable_dsa_fused_indexerreports.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():True--enable-fused-qk-norm-ropeTrue--no-enable-fused-qk-norm-ropeFalseNone(off)--enable-fused-qk-norm-rope/--no-enable-fused-qk-norm-ropeTrue/FalseSpeed Tests and Profiling
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): 🚫 Run #38838489630
Latest PR Test (Extra): ❌ Run #38838489477
Latest PR Test (AMD ROCm 10): ❌ Run #38838489627
cc: @rahulvijayaraghavan @rbabukv