diff --git a/python/sglang/srt/layers/moe/cutlass_w4a8_moe.py b/python/sglang/srt/layers/moe/cutlass_w4a8_moe.py index 0bf89b2d0..bed37dd78 100644 --- a/python/sglang/srt/layers/moe/cutlass_w4a8_moe.py +++ b/python/sglang/srt/layers/moe/cutlass_w4a8_moe.py @@ -3,7 +3,18 @@ from typing import Optional import torch -from sgl_kernel import cutlass_w4a8_moe_mm, get_cutlass_w4a8_moe_mm_data, silu_and_mul + +from sglang.srt.utils import is_cuda_alike + +_is_cuda_alike = is_cuda_alike() + +if _is_cuda_alike: + from sgl_kernel import ( + cutlass_w4a8_moe_mm, + get_cutlass_w4a8_moe_mm_data, + ) + +from sgl_kernel import silu_and_mul from sglang.jit_kernel.per_tensor_quant_fp8 import per_tensor_quant_fp8 from sglang.srt.distributed import get_moe_expert_parallel_world_size