diff --git a/python/sglang/srt/environ.py b/python/sglang/srt/environ.py index b95e9d6ef..f5e7eaf8b 100644 --- a/python/sglang/srt/environ.py +++ b/python/sglang/srt/environ.py @@ -1243,7 +1243,7 @@ class Envs: # DeepGemm Mega MoE SGLANG_OPT_USE_DEEPGEMM_MEGA_MOE = EnvBool(False) - SGLANG_OPT_DEEPGEMM_MEGA_MOE_NUM_MAX_TOKENS_PER_RANK = EnvInt(1024) + SGLANG_OPT_DEEPGEMM_MEGA_MOE_NUM_MAX_TOKENS_PER_RANK = EnvInt(8192) # When set, the mega-MoE x slot is packed E2M1 (FP4) instead of FP8 E4M3. # Halves symm-buffer footprint and unlocks the MXF4 mainloop downstream. diff --git a/python/sglang/srt/server_args.py b/python/sglang/srt/server_args.py index a11b04a34..392f5ef8d 100644 --- a/python/sglang/srt/server_args.py +++ b/python/sglang/srt/server_args.py @@ -266,6 +266,7 @@ MOE_RUNNER_BACKEND_CHOICES = [ "humming", "experimental_sgl_marlin", "hpc_ops", # HPC-Ops (https://github.com/Tencent/hpc-ops), FP8 MoE on Hopper (SM90) only + "megamoe", ] MOE_A2A_BACKEND_CHOICES = [ @@ -3504,6 +3505,7 @@ class ServerArgs: # _handle_model_specific_adjustments never runs. self._resolved_overrides = [] + self._handle_moe_runner_backend_alias() self._handle_return_hidden_states_mode() if self.model_path.lower() in ["none", "dummy"]: return @@ -3672,6 +3674,20 @@ class ServerArgs: materialize_declarations(self) + def _handle_moe_runner_backend_alias(self): + if self.moe_runner_backend != "megamoe": + return + + if self.moe_a2a_backend not in ("none", "megamoe"): + logger.warning( + "--moe-runner-backend megamoe is an alias for " + "--moe-a2a-backend megamoe; overriding " + "--moe-a2a-backend %s.", + self.moe_a2a_backend, + ) + self.moe_runner_backend = "auto" + self.moe_a2a_backend = "megamoe" + def _handle_return_hidden_states_mode(self): if self.return_hidden_states_mode not in (None, "last", "full"): raise ValueError(