From 7c7b2a8c97816b84c6c90ebe28e7e1a9ea334888 Mon Sep 17 00:00:00 2001 From: Hubert Lu <55214931+hubertlu-tw@users.noreply.github.com> Date: Wed, 25 Mar 2026 16:37:26 -0700 Subject: [PATCH] [Bugfix] Lazy-import CuteDSL KDA kernel to fix AMD/ROCm startup crash (#21428) --- python/sglang/srt/layers/attention/linear/kda_backend.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/sglang/srt/layers/attention/linear/kda_backend.py b/python/sglang/srt/layers/attention/linear/kda_backend.py index a5f9ba2ae..fb27462b0 100644 --- a/python/sglang/srt/layers/attention/linear/kda_backend.py +++ b/python/sglang/srt/layers/attention/linear/kda_backend.py @@ -3,9 +3,6 @@ from typing import Tuple, Union import torch from sglang.srt.layers.attention.hybrid_linear_attn_backend import MambaAttnBackendBase -from sglang.srt.layers.attention.linear.kernels.kda_cutedsl import ( - CuteDSLKDAKernel, -) from sglang.srt.layers.attention.linear.kernels.kda_triton import TritonKDAKernel from sglang.srt.layers.attention.linear.utils import ( LinearAttnKernelBackend, @@ -50,6 +47,10 @@ class KDAKernelDispatcher: elif decode_backend.is_cutedsl(): if not is_cuda(): raise ValueError("KDA CuTe DSL backend requires CUDA") + from sglang.srt.layers.attention.linear.kernels.kda_cutedsl import ( + CuteDSLKDAKernel, + ) + self.decode_kernel = CuteDSLKDAKernel() else: raise ValueError(