diff --git a/python/sglang/kernels/ops/attention/mla_output_gate.py b/python/sglang/kernels/ops/attention/mla_output_gate.py index 30634a3c4b..9b0ca7c2a7 100644 --- a/python/sglang/kernels/ops/attention/mla_output_gate.py +++ b/python/sglang/kernels/ops/attention/mla_output_gate.py @@ -12,11 +12,13 @@ from sglang.kernels.jit.utils import ( load_jit, make_cpp_args, ) +from sglang.srt.utils import is_npu if TYPE_CHECKING: from tvm_ffi.module import Module _THREADS: int = 256 +_is_npu = is_npu() @cache_once @@ -35,6 +37,7 @@ def covered(x: torch.Tensor, gate: torch.Tensor) -> bool: return ( x.is_cuda and gate.is_cuda + and not _is_npu and x.dtype == torch.bfloat16 and gate.dtype == torch.bfloat16 and x.shape == gate.shape diff --git a/python/sglang/srt/layers/moe/moe_runner/ascend.py b/python/sglang/srt/layers/moe/moe_runner/ascend.py index 082276784d..dfdef7b113 100644 --- a/python/sglang/srt/layers/moe/moe_runner/ascend.py +++ b/python/sglang/srt/layers/moe/moe_runner/ascend.py @@ -36,6 +36,8 @@ def _uses_fused_gmm1(kernel, config: MoeRunnerConfig) -> bool: # applied (NPUSwigluMxfp8Quant / NPUSwigluStepAndMul below). has_clamp = config.swiglu_limit is not None and config.swiglu_limit > 0 + if config.activation == "situ": + return False if not isinstance(kernel, (NPUMXFP8MoEMethod, NPUW4A8MXFP4MoEMethod)): return False if has_clamp: