From d6c837489a902fae9ef48ff847013800a2c724d0 Mon Sep 17 00:00:00 2001 From: jiayisunx Date: Tue, 18 Aug 2026 10:42:58 +0800 Subject: [PATCH] [XPU] Enable fused GDN QKV split Triton kernel on XPU (#30144) Co-authored-by: Ma Mingfei --- python/sglang/srt/layers/attention/linear/gdn_backend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/sglang/srt/layers/attention/linear/gdn_backend.py b/python/sglang/srt/layers/attention/linear/gdn_backend.py index 8fdec861a..7a0d1ee2c 100644 --- a/python/sglang/srt/layers/attention/linear/gdn_backend.py +++ b/python/sglang/srt/layers/attention/linear/gdn_backend.py @@ -29,7 +29,7 @@ if not is_cpu(): CHUNK_SIZE as FLA_CHUNK_SIZE, ) -if is_cuda() or is_hip(): +if is_cuda() or is_hip() or is_xpu(): from sglang.kernels.ops.attention.triton_gdn_fused_proj import ( fused_qkv_split_gdn_prefill, ) @@ -595,7 +595,7 @@ class GDNAttnBackend(MambaAttnBackendBase): actual_seq_len = mixed_qkv.shape[0] qkv_dim = layer.q_dim + layer.k_dim + layer.v_dim - if (is_cuda() or is_hip()) and qkv_dim <= MAX_FUSED_QKV_SPLIT_DIM: + if (is_cuda() or is_hip() or is_xpu()) and qkv_dim <= MAX_FUSED_QKV_SPLIT_DIM: query, key, value = fused_qkv_split_gdn_prefill( mixed_qkv, layer.num_q_heads,