8000 mtmd-helper : bug fix to token batching in mtmd by l3utterfly · Pull Request #13650 · ggml-org/llama.cpp · GitHub
[go: up one dir, main page]

Skip to content

mtmd-helper : bug fix to token batching in mtmd #13650

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 20, 2025

Conversation

l3utterfly
Copy link
Contributor

From my understanding, we should be setting each field in the tokens batch using the current text_batch.n_tokens counter, instead of the outer i counter.

If the outer n_tokens > n_batch, the original code gives a segmentation fault because each batch is only initialised with n_batch number of spaces, but i will increase to the number of overall n_tokens.

Copy link
Collaborator
@ngxson ngxson left a comment

Choose a reason for hiding this comment

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

Hmm yeah thanks for noticing, I think I mistakenly left the i variable there from the non-batching code

@ngxson ngxson changed the title bug fix to token batching in mtmd mtmd-helper : bug fix to token batching in mtmd May 20, 2025
Co-authored-by: Xuan-Son Nguyen <thichthat@gmail.com>
@ngxson ngxson merged commit b7a1746 into ggml-org:master May 20, 2025
83 of 86 checks passed
infil00p pushed a commit to baseweight/llama.cpp that referenced this pull request May 22, 2025
* Update mtmd-helper.cpp

* Update tools/mtmd/mtmd-helper.cpp

Co-authored-by: Xuan-Son Nguyen <thichthat@gmail.com>

---------

Co-authored-by: Xuan-Son Nguyen <thichthat@gmail.com>
@l3utterfly l3utterfly deleted the patch-1 branch May 23, 2025 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0