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.