Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion python/sglang/kernels/ops/moe/moe_fused_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
import triton.language as tl
from triton.language.extra import libdevice

from sglang.kernels.jit.utils import cache_once, is_arch_support_pdl, load_jit
from sglang.kernels.jit.utils import (
cache_once,
get_jit_cuda_arch,
is_arch_support_pdl,
load_jit,
)
from sglang.kernels.kernel_api_logging import debug_kernel_api
from sglang.kernels.ops.moe import moe_route_radix

Expand Down Expand Up @@ -442,6 +447,12 @@ def moe_fused_gate(
num_warps = 1 if BLOCK_N <= 512 else 4
grid = (triton.cdiv(M, BLOCK_M),)
use_pdl = is_arch_support_pdl()
if use_pdl and scoring_func_int == 1 and N == 384 and K == 6 and M <= 8:
# On SM103, early-launching the small DSV4.1 target router increases
# latency when it overlaps with mHC/shared-expert work. Use ordinary
# stream dependencies; keep PDL for the draft router and larger batches.
arch = get_jit_cuda_arch()
use_pdl = (arch.major, arch.minor) != (10, 3)
extra = {"launch_pdl": True} if use_pdl else {}
# Never alias an output as the fallback for an unused pointer arg: when
# Dynamo cannot analyze the kernel (PDL inline asm) it treats every pointer
Expand Down
Loading