diff --git a/python/sglang/srt/model_executor/model_runner.py b/python/sglang/srt/model_executor/model_runner.py index 11c69a309..a0272029a 100644 --- a/python/sglang/srt/model_executor/model_runner.py +++ b/python/sglang/srt/model_executor/model_runner.py @@ -597,9 +597,12 @@ class ModelRunner: ) moe_tp_size = self.tp_size // self.moe_ep_size - moe_intermediate_size = ( - self.model_config.hf_text_config.moe_intermediate_size + moe_intermediate_size = getattr( + self.model_config.hf_text_config, "moe_intermediate_size", None ) + if moe_intermediate_size is None: + return + if moe_intermediate_size % moe_tp_size != 0: raise ValueError( f"moe_intermediate_size {moe_intermediate_size} must be divisible by moe_tp_size ({moe_tp_size}) which is tp_size ({self.tp_size}) divided by moe_ep_size ({self.moe_ep_size})."