Skip to content

Commit

Permalink
[Bugfix] Fix mrope_position_delta in non-last prefill chunk (vllm-pro…
Browse files Browse the repository at this point in the history
…ject#10403)

Signed-off-by: imkero <[email protected]>
  • Loading branch information
imkero authored Nov 17, 2024
1 parent 76aab90 commit 80d85c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vllm/model_executor/layers/rotary_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,9 +922,9 @@ def get_input_positions(
torch.arange(text_len).view(1, -1).expand(3, -1) + st_idx)

llm_positions = torch.cat(llm_pos_ids_list, dim=1).reshape(3, -1)
llm_positions = llm_positions[:, context_len:seq_len]
mrope_position_delta = (llm_positions.max() + 1 -
len(input_tokens)).item()
llm_positions = llm_positions[:, context_len:seq_len]

return llm_positions.tolist(), mrope_position_delta

Expand Down

0 comments on commit 80d85c5

Please sign in to comment.