From 97e4022c6ccb7b2cf1a1fc0a13a17a2a06d74f0d Mon Sep 17 00:00:00 2001 From: Yubo Wang Date: Tue, 26 May 2026 00:46:10 -0700 Subject: [PATCH] [Bugfix] Apply fc_norm in Eagle3DeepseekV2 combine_hidden_states (#43482) Signed-off-by: Yubo Wang Co-authored-by: Claude --- vllm/model_executor/models/deepseek_eagle3.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vllm/model_executor/models/deepseek_eagle3.py b/vllm/model_executor/models/deepseek_eagle3.py index 4d26a9e009..9b96cdec83 100644 --- a/vllm/model_executor/models/deepseek_eagle3.py +++ b/vllm/model_executor/models/deepseek_eagle3.py @@ -407,6 +407,12 @@ class Eagle3DeepseekV2ForCausalLM(DeepseekV2ForCausalLM): hidden_states: torch.Tensor, ) -> torch.Tensor: # Combine multiple auxiliary hidden states returned by Eagle3 + if self.model.fc_norm is not None: + chunks = hidden_states.chunk(self.model.num_aux_hidden_states, dim=-1) + hidden_states = torch.cat( + [norm(chunk) for norm, chunk in zip(self.model.fc_norm, chunks)], + dim=-1, + ) return self.model.fc(hidden_states) def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]):