diff --git a/python/sglang/srt/model_executor/model_runner.py b/python/sglang/srt/model_executor/model_runner.py index b95759af489d..473ba6dd2acf 100644 --- a/python/sglang/srt/model_executor/model_runner.py +++ b/python/sglang/srt/model_executor/model_runner.py @@ -592,9 +592,12 @@ def check_quantized_moe_compatibility(self): ) 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})."