From d708969f68b0bdc040a6b37894350fc999915984 Mon Sep 17 00:00:00 2001 From: xdtbynd <231153518+xdtbynd@users.noreply.github.com> Date: Wed, 22 Jul 2026 10:51:15 +0800 Subject: [PATCH] [bugfix][NPU] Fix startup bug in olmoe 1b 7b (#31782) --- python/sglang/srt/layers/moe/token_dispatcher/ascend_tp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/sglang/srt/layers/moe/token_dispatcher/ascend_tp.py b/python/sglang/srt/layers/moe/token_dispatcher/ascend_tp.py index d7c80e153..96921d995 100644 --- a/python/sglang/srt/layers/moe/token_dispatcher/ascend_tp.py +++ b/python/sglang/srt/layers/moe/token_dispatcher/ascend_tp.py @@ -95,6 +95,7 @@ class AscendTPDispatcher(BaseDispatcher): topk_weights, topk_ids, _ = topk_output topk_weights = topk_weights.to(hidden_states.dtype) topk_ids = topk_ids.to(torch.int32) + top_k = topk_weights.shape[-1] ( permuted_hidden_states, @@ -105,7 +106,7 @@ class AscendTPDispatcher(BaseDispatcher): hidden_states, topk_ids, self.num_experts, - self.top_k, + top_k, ) self._dispatch_output = AscendTPDispatchOutput(