[Intel GPU] DeepSeek V4 15/N: Add silu_and_mul_clamp support to triton fused_moe for XPU (#33808)

Signed-off-by: P V R K Jyothendra Varma <polisetty.v.r.k.jyothendra.varma@intel.com>
This commit is contained in:
Polisetty V R K Jyothendra Varma
2026-08-09 21:22:05 -07:00
committed by GitHub
parent 5a8e360e70
commit 449f0da78f
@@ -619,7 +619,9 @@ def _fused_moe_kernel_sequence(
# fusion=False: explicit clamp_ on intermediate_cache1 (path checker)
assert swiglu_limit == 10
assert intermediate_cache1.shape == (total_tokens, N)
assert _is_cuda or _is_hip, "DeepSeek V4 only supports CUDA/HIP downstream"
assert (
_is_cuda or _is_hip or _is_xpu
), "DeepSeek V4 only supports CUDA/HIP/XPU downstream"
swiglu_limit_for_triton: Optional[float] = None
swiglu_limit_for_silu_and_mul_clamp: Optional[float] = None
@@ -629,8 +631,8 @@ def _fused_moe_kernel_sequence(
swiglu_limit_for_triton = swiglu_limit
else:
assert (
_is_cuda
), "fused silu_and_mul_clamp kernel is CUDA-only; HIP must disable SWIGLU_CLAMP_FUSION"
_is_cuda or _is_xpu
), "fused silu_and_mul_clamp kernel is CUDA/XPU only; HIP must disable SWIGLU_CLAMP_FUSION"
swiglu_limit_for_silu_and_mul_clamp = swiglu_limit
else:
half = N // 2