diff --git a/python/sglang/srt/layers/attention/merge_state.py b/python/sglang/srt/layers/attention/merge_state.py index ac73b84401..26a393e57e 100644 --- a/python/sglang/srt/layers/attention/merge_state.py +++ b/python/sglang/srt/layers/attention/merge_state.py @@ -1,13 +1,15 @@ from typing import Optional, Tuple import torch -from sgl_kernel import merge_state_v2 from sglang.kernels.ops.attention.merge_state import merge_state_triton from sglang.srt.utils import is_cuda _is_cuda = is_cuda() +if _is_cuda: + from sgl_kernel import merge_state_v2 + # Automatically fallback to the Triton kernel in some cases # (e.g., for AMD GPUs, when the head dimension is not a multiple