From b7fc51698601b4634a138ba6422c9b38a2e2cb10 Mon Sep 17 00:00:00 2001 From: Cheng Wan <54331508+ch-wan@users.noreply.github.com> Date: Sat, 3 Oct 2026 02:19:19 -0700 Subject: [PATCH] [Fix] EXAONE MoE under DP attention and DeepEP (#42305) --- python/sglang/srt/models/exaone_moe.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/sglang/srt/models/exaone_moe.py b/python/sglang/srt/models/exaone_moe.py index 8462294b76..038ab9f510 100755 --- a/python/sglang/srt/models/exaone_moe.py +++ b/python/sglang/srt/models/exaone_moe.py @@ -406,6 +406,8 @@ class ExaoneMoEAttention(nn.Module): hidden_states: torch.Tensor, forward_batch: ForwardBatch, ) -> torch.Tensor: + if hidden_states.shape[0] == 0: + return hidden_states qkv, _ = self.qkv_proj(hidden_states) q, k, v = qkv.split([self.q_size, self.kv_size, self.kv_size], dim=-1) @@ -532,7 +534,7 @@ class ExaoneMoEDecoderLayer(nn.Module): hidden_states = self.ffn_boundary.prepare(hidden_states, forward_batch) # Fully Connected with self.ffn_boundary.exit(forward_batch) as ffn_exit: - hidden_states = self.mlp(hidden_states) + hidden_states = self.mlp(hidden_states, forward_batch) return ffn_exit.finish(hidden_states)