[Bugfix] Guard merge_state sgl_kernel import on non-CUDA platforms (#42682)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user