From 599c5f4922579742a0c65a4c2fb4503dd63f7ae3 Mon Sep 17 00:00:00 2001 From: yinghui <32845984+cicirori@users.noreply.github.com> Date: Thu, 5 Feb 2026 07:59:01 +0700 Subject: [PATCH] fix kimi k2.5's moe gemm config init (#18064) --- python/sglang/srt/managers/scheduler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/sglang/srt/managers/scheduler.py b/python/sglang/srt/managers/scheduler.py index c7c704c1b..1cf897f2d 100644 --- a/python/sglang/srt/managers/scheduler.py +++ b/python/sglang/srt/managers/scheduler.py @@ -485,7 +485,12 @@ class Scheduler( )[0] def init_moe_gemm_config(self): - if hasattr(self.model_config.hf_config, "num_experts_per_tok"): + # For the MM models, check the text_config for MoE settings + config_to_check = getattr( + self.model_config.hf_config, "text_config", self.model_config.hf_config + ) + + if hasattr(config_to_check, "num_experts_per_tok"): initialize_moe_config(self.server_args) # Initialize GEMM-related configuration for FP8 and FP4 backends.