[server_args] Make MoRI per-rank dispatch-token requirement overridable (#29096)
This commit is contained in:
@@ -5548,8 +5548,16 @@ class ServerArgs:
|
|||||||
# Skip validation if disaggregation mode is decode.
|
# Skip validation if disaggregation mode is decode.
|
||||||
if self.chunked_prefill_size > 0 and self.disaggregation_mode != "decode":
|
if self.chunked_prefill_size > 0 and self.disaggregation_mode != "decode":
|
||||||
assert (
|
assert (
|
||||||
self.chunked_prefill_size
|
self._required_mori_dispatch_tokens_per_rank()
|
||||||
) <= envs.SGLANG_MORI_NUM_MAX_DISPATCH_TOKENS_PER_RANK.get(), "SGLANG_MORI_NUM_MAX_DISPATCH_TOKENS_PER_RANK (default 4096) must be larger or equal to chunked_prefill_size"
|
) <= envs.SGLANG_MORI_NUM_MAX_DISPATCH_TOKENS_PER_RANK.get(), (
|
||||||
|
"SGLANG_MORI_NUM_MAX_DISPATCH_TOKENS_PER_RANK (default 4096) "
|
||||||
|
"must be >= the per-rank MoRI dispatch tokens "
|
||||||
|
"(chunked_prefill_size by default)"
|
||||||
|
)
|
||||||
|
|
||||||
|
def _required_mori_dispatch_tokens_per_rank(self) -> int:
|
||||||
|
"""Max tokens a single rank dispatches through MoRI in one forward."""
|
||||||
|
return self.chunked_prefill_size
|
||||||
|
|
||||||
def _handle_eplb_and_dispatch(self):
|
def _handle_eplb_and_dispatch(self):
|
||||||
if self.enable_eplb and (self.expert_distribution_recorder_mode is None):
|
if self.enable_eplb and (self.expert_distribution_recorder_mode is None):
|
||||||
|
|||||||
Reference in New Issue
Block a user