Fix/qwen3 5 amd rope cutedsl fallback (#18753)

Co-authored-by: seungrokj <seungrok.jung@amd.com>
This commit is contained in:
andyluo7
2026-02-14 22:09:44 -08:00
committed by GitHub
co-authored by seungrokj
parent 91230dcca8
commit 944a9f6fcf
2 changed files with 24 additions and 4 deletions
@@ -45,9 +45,14 @@ from sglang.srt.utils.common import rank0_log
if not is_cpu() and not is_npu():
# fix import error on CPU device, no impacts when non-CPU path
from sglang.jit_kernel.cutedsl_gdn import (
cutedsl_fused_sigmoid_gating_delta_rule_update,
)
try:
from sglang.jit_kernel.cutedsl_gdn import (
cutedsl_fused_sigmoid_gating_delta_rule_update,
)
except ModuleNotFoundError:
# CuTe DSL path requires cuda-python (cuda.bindings.*). Keep runtime usable
# by falling back to non-CuTe kernels when it's unavailable.
cutedsl_fused_sigmoid_gating_delta_rule_update = None
from sglang.srt.layers.attention.fla.chunk import chunk_gated_delta_rule
from sglang.srt.layers.attention.fla.chunk_delta_h import (
CHUNK_SIZE as FLA_CHUNK_SIZE,
@@ -830,6 +835,12 @@ class GDNAttnBackend(MambaAttnBackendBase):
), f"{self.conv_states_shape[-1]=} should be less than {FLA_CHUNK_SIZE}"
use_cutedsl = Envs.SGLANG_USE_CUTEDSL_GDN_DECODE.get()
if use_cutedsl and cutedsl_fused_sigmoid_gating_delta_rule_update is None:
rank0_log(
"CuTe DSL GDN decode requested but unavailable "
"(missing cuda.bindings). Falling back to FLA decode kernel."
)
use_cutedsl = False
rank0_log(f"CuTe DSL GDN decode enabled: {use_cutedsl}")
self._kernel_func = (
cutedsl_fused_sigmoid_gating_delta_rule_update