Skip to content

llama-graph : fix text position for mrope #13159

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 3 commits into from
Apr 29, 2025

Conversation

ngxson
Copy link
Collaborator

@ngxson ngxson commented Apr 28, 2025

Cont #13138

I misunderstood the original code:

        // TODO: add mrope pos ids somewhere else
        pos.resize(batch.n_tokens * 4);
        std::fill(pos.begin(), pos.end(), 0);
        for (int j = 0; j < batch.n_tokens * 3; j ++) {
            pos[j] = *st_pos_id + (j % batch.n_tokens);
        }
        batch.pos = pos.data();

Which means 3 first dims are the same, and 4th dim is 0, something like this:

1234...1234...1234...0000...

Thanks @mattjcly for spotting this!

@mattjcly
Copy link
Contributor

Can confirm this fixes bugs we observed! Thanks @ngxson :)

@ggerganov ggerganov merged commit b6ce743 into ggml-org:master Apr 29, 2025
48 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.

3 participants