Skip to content

llama : fix KV shift for qwen2vl #13870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 28, 2025

Conversation

ngxson
Copy link
Collaborator

@ngxson ngxson commented May 28, 2025

Fix #13865

Provided a model with 3 mrope sections, a rotated vector looks like this: [time, time+x, time+y]

This works with the assumption that mrope with x == y == 0 is identical to doing a neox rope with theta = +time

For example, when we want to shift the time to time-1, that mean we shift from [time, time+x, time+y] to [time-1, time-1+x, time-1+y] ; We can simply apply neox rope with theta = -1 to archive the same effect

@ngxson ngxson requested a review from ggerganov May 28, 2025 18:14
Copy link
Member

@ggerganov ggerganov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪄

@ngxson ngxson merged commit 763d06e into ggml-org:master May 28, 2025
41 of 46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eval bug: KV cache shifting does not work for Qwen2.5VL
2 participants