Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/docs/advanced_features/server_arguments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2823,9 +2823,9 @@ Combining `--enable-response-store` with `--disaggregation-mode=prefill` or `dec
</tr>
<tr>
<td style={{padding: "9px 12px", fontWeight: 500, backgroundColor: "rgba(255,255,255,0.02)"}}>`--enable-fused-qk-norm-rope`</td>
<td style={{padding: "9px 12px", backgroundColor: "rgba(255,255,255,0.05)"}}>Enable fused qk normalization and rope rotary embedding.</td>
<td style={{padding: "9px 12px", backgroundColor: "rgba(255,255,255,0.02)"}}>`False`</td>
<td style={{padding: "9px 12px", backgroundColor: "rgba(255,255,255,0.05)"}}>bool flag (set to enable)</td>
<td style={{padding: "9px 12px", backgroundColor: "rgba(255,255,255,0.05)"}}>Fuse q/k normalization and rope rotary embedding into one kernel. Enabled by default on XPU and disabled elsewhere; `--no-enable-fused-qk-norm-rope` disables it.</td>
<td style={{padding: "9px 12px", backgroundColor: "rgba(255,255,255,0.02)"}}>`None`</td>
<td style={{padding: "9px 12px", backgroundColor: "rgba(255,255,255,0.05)"}}>Type: bool</td>
</tr>
<tr>
<td style={{padding: "9px 12px", fontWeight: 500, backgroundColor: "rgba(255,255,255,0.02)"}}>`--enable-precise-embedding-interpolation`</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2378,8 +2378,8 @@ If the value is int8, you must also set the environment variable:DEEP_NORMAL_MOD
</tr>
<tr>
<td style={{padding: "9px 12px", fontWeight: 500, backgroundColor: "rgba(255,255,255,0.02)"}}>`--enable-fused-qk-norm-rope`</td>
<td style={{padding: "9px 12px", backgroundColor: "rgba(255,255,255,0.05)"}}>`False`</td>
<td style={{padding: "9px 12px", backgroundColor: "rgba(255,255,255,0.02)"}}>bool flag<br/> (set to enable)</td>
<td style={{padding: "9px 12px", backgroundColor: "rgba(255,255,255,0.05)"}}>`None`</td>
<td style={{padding: "9px 12px", backgroundColor: "rgba(255,255,255,0.02)"}}>Type: bool</td>
<td style={{padding: "9px 12px", backgroundColor: "rgba(255,255,255,0.05)"}}>Special for GPU</td>
</tr>
<tr>
Expand Down
12 changes: 10 additions & 2 deletions python/sglang/srt/arg_groups/fields/exec_.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,16 @@ class ExecKernel(msgspec.Struct):
bool, "Not using ragged prefill wrapper when running flashinfer mla"
] = False
enable_fused_qk_norm_rope: A[
bool, "Enable fused qk normalization and rope rotary embedding."
] = False
Optional[bool],
Arg(
help="Fuse q/k normalization and rope rotary embedding into one "
"kernel. By default this is enabled on XPU and disabled elsewhere. "
"Pass --enable-fused-qk-norm-rope or --no-enable-fused-qk-norm-rope "
"to force it either way.",
action=argparse.BooleanOptionalAction,
resolvable=True,
),
] = None
Comment thread
mehersai07 marked this conversation as resolved.
Resolved
enable_precise_embedding_interpolation: A[
bool,
"Enable corner alignment for resize of embeddings grid to ensure more accurate(but slower) evaluation of interpolated embedding values.",
Expand Down
7 changes: 7 additions & 0 deletions python/sglang/srt/arg_groups/platform_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ def handle_xpu_backends(server_args: Any):
"_handle_xpu_backends",
sampling_backend="intel_xpu",
)
# Enable the fused qknorm + rope by default as the fused q/k-norm + RoPE kernel is a pure win here.
if cfg.enable_fused_qk_norm_rope is None:
declare_resolution(
server_args,
"_handle_xpu_backends",
enable_fused_qk_norm_rope=True,
)
# Decode graph is opt-in on XPU: unless the user explicitly set
# --cuda-graph-backend-decode (or --cuda-graph-config), keep it
# disabled so the default startup doesn't require graph capture.
Expand Down
1 change: 1 addition & 0 deletions test/registered/unit/test_model_overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def test_server_args_whitelist_is_exactly_the_migrated_fields(self):
"dsv4_attn_backend",
"dsa_topk_backend",
"enable_dsa_fused_indexer",
"enable_fused_qk_norm_rope",
"prefill_attention_backend",
"decode_attention_backend",
"flashinfer_allreduce_fusion_backend",
Expand Down
Loading