[eagle][cp][bugfix] Fix the bug in eagle and cp enabled (#6981)

### What this PR does / why we need it?
When eagle and cp are enabled at the same time, there is an error in
pcp_allgather due to hidden_states. This PR fixes this issue.

- vLLM version: v0.16.0
- vLLM main:
15d76f74e2
---------
Signed-off-by: lilinsiman <lilinsiman@gmail.com>
This commit is contained in:
lilinsiman
2026-03-06 20:49:49 +08:00
committed by GitHub
parent 1c0ecf806a
commit 01d3515dcf
2 changed files with 13 additions and 3 deletions

View File

@@ -1048,7 +1048,7 @@ class NPUModelRunner(GPUModelRunner):
target_positions = positions
target_hidden_states = hidden_states
if self.use_aux_hidden_state_outputs:
target_hidden_states = torch.cat([h[token_indices] for h in aux_hidden_states], dim=-1)
target_hidden_states = torch.cat([h for h in aux_hidden_states], dim=-1)
else:
target_token_ids = self.input_ids.gpu[token_indices]
target_positions = self._get_positions(token_indices)