Add DeepSeekV4 fused MoE Triton autotune support (#25569)

Co-authored-by: undefined <zhouchen.arrebol@jd.com>
Co-authored-by: xq25478 <xq25478@qq.com>
Co-authored-by: xieminghe.simon <xieminghe.simon@jd.com>
This commit is contained in:
xieminghe1
2026-05-18 21:35:32 +08:00
committed by GitHub
co-authored by undefined xq25478 xieminghe.simon
parent f04c522534
commit ba2ffcf156
2 changed files with 6 additions and 0 deletions
@@ -85,6 +85,7 @@ def get_model_config(
"DeepseekV2ForCausalLM",
"DeepseekV3ForCausalLM",
"DeepseekV32ForCausalLM",
"DeepseekV4ForCausalLM",
"Glm4MoeForCausalLM",
"GlmMoeDsaForCausalLM",
"MistralLarge3ForCausalLM",
@@ -35,6 +35,7 @@ from sglang.srt.server_args import (
set_global_server_args_for_scheduler,
)
from sglang.srt.utils import get_device, is_hip, is_xpu
from sglang.srt.utils.hf_transformers_utils import get_config
_is_hip = is_hip()
_is_xpu = is_xpu()
@@ -174,8 +175,12 @@ def benchmark_config(
topk_output.router_logits.copy_(new_topk_output.router_logits)
def run():
model_config = get_config(args.model, trust_remote_code=True)
architecture = model_config.architectures[0]
is_dsv4 = architecture == "DeepseekV4ForCausalLM"
moe_runner_config = MoeRunnerConfig(
inplace=True,
swiglu_limit=10.0 if is_dsv4 else None,
)
with override_config(config):