[XPU] Use a fused GDN kernel from sgl-kernel for Qwen3.5 - #33354
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
/tag-and-rerun-ci |
|
Hi @mingfeima @airMeng Can you please review? Thanks. |
| core_attn_out = z = None | ||
| from sglang.srt.model_executor.forward_context import get_attn_backend | ||
|
|
||
| backend = get_attn_backend() | ||
| backend = getattr(backend, "linear_attn_backend", backend) | ||
| if hasattr(backend, "forward_fused_gdn") and backend.supports_fused_gdn( | ||
| self.attn, forward_batch | ||
| ): |
There was a problem hiding this comment.
doing such a backend chosen in a forward seems not appropriate.
how does the original code choose the backend? when it is settled?
There was a problem hiding this comment.
The original path does not use a fused kernel (CUDA, CPU, etc.). So, they just go to the else branch. We need to intercept here because we call a fused kernel.
There was a problem hiding this comment.
Updated. Now we use a separate _forward_xpu.
… of a runtime flag
mingfeima
left a comment
There was a problem hiding this comment.
some minor issues to address.
|
@Xia-Weiwen could you please check with validation team why xpu ci failed again? |
CI should be good now. |
…n-transport1 * 'main' of https://github.com/sgl-project/sglang: (326 commits) [diffusion] feat: cache LoRA-merged weights in files the page cache can hold (sgl-project#36062) [diffusion] Speed up LingBot high-quality VAE decode (sgl-project#36024) [diffusion] Honor XDG cache for model overlays (sgl-project#36019) Support streaming session on NPU (sgl-project#32597) fix(xpu): read enable_deterministic_inference from the config bag (sgl-project#36149) xeon ci fail fast strategy change (sgl-project#36146) [diffusion] Fix Hunyuan QKV pack indexing at production video shapes (sgl-project#36009) [diffusion] Refresh quality and BCG benchmark skills (sgl-project#36016) [MoE] Gather the cutlass MoE activation and its scales in one launch (sgl-project#34915) [diffusion] feat: add plain component weight overrides (sgl-project#36086) [diffusion] feat: support loading mixed w4a8 text encoders (sgl-project#36037) [diffusion] Default Hunyuan VAE to tiled decode (sgl-project#36012) fix(xpu): enable compressed-tensors FP8 W8A8 on XPU (RedHatAI FP8-dynamic models) (sgl-project#33057) chore: move cuda_vmm_utils.py under srt/utils/ (sgl-project#36053) [Intel XPU] Add xpu pass for biased_topk and hash_topk (sgl-project#33323) [CPU] Fix NUMA/core binding for DP ranks (sgl-project#32856) [Fix] Harden FlashAttention CUDA graph metadata bounds (sgl-project#35454) [XPU] Use a fused GDN kernel from sgl-kernel for Qwen3.5 (sgl-project#33354) [diffusion] Fuse LongCat-Image QKNorm and interleaved RoPE (sgl-project#35995) [diffusion] Keep LongLive2 components resident on large GPUs (sgl-project#35993) ... # Conflicts: # python/sglang/srt/multimodal/processors/base_processor.py # python/sglang/srt/server_args.py
Motivation
To use a fused GDN kernel provided by sgl-kernel-xpu for better performance than what the existing triton kernels in SGLang produce.
Modifications
GDNAttnBackendfor XPU, which does some checks and calls the fused GDN kernel.Accuracy Tests
Qwen3.5-9B, GSM8K, 200 samples
Fused GDN kernel from sgl-kernel-xpu
Triton GDN in SGLang
Speed Tests and Profiling
Qwen3.5-9B on a Intel Arc BMG60 machine
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ❌ Run #32383609683
Latest PR Test (Extra): ⏳ Run #32688872423
Latest PR Test (AMD ROCm 7.2): ❌ Run #32383610036