Skip to content

mtmd: add batching support for internvl#24775

Merged
ngxson merged 2 commits into
ggml-org:masterfrom
ngxson:xsn/internvl_batching
Jun 18, 2026
Merged

mtmd: add batching support for internvl#24775
ngxson merged 2 commits into
ggml-org:masterfrom
ngxson:xsn/internvl_batching

Conversation

@ngxson

@ngxson ngxson commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Overview

This PR is mostly serves as a demo on how to adapt model's cgraph from non-batching to batching support.

InternVL cgraph seems to be very simple, a good starting point

Requirements

@ngxson ngxson requested a review from a team as a code owner June 18, 2026 18:29
@ngxson

ngxson commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator Author

Tested with the new script from #24778 --> batching up to 3 images OK:

[vision] OK:   ggml-org/InternVL2_5-1B-GGUF:Q8_0
0.17.024.664 I encoding mtmd batch, n_chunks = 3 (done = 145, total = 161)
0.17.224.927 I mtmd batch encoding done in 200 ms
0.17.502.190 I encoding mtmd batch, n_chunks = 3 (done = 149, total = 161)
0.17.703.914 I mtmd batch encoding done in 201 ms
0.17.982.876 I encoding mtmd batch, n_chunks = 3 (done = 153, total = 161)
0.18.184.286 I mtmd batch encoding done in 202 ms
0.18.473.397 I encoding mtmd batch, n_chunks = 3 (done = 157, total = 161)
0.18.675.175 I mtmd batch encoding done in 202 ms

The publisher's name on the newspaper is 'KAPPERZASZAK'.
[vision] OK:   ggml-org/InternVL3-1B-Instruct-GGUF:Q8_0
0.17.143.834 I encoding mtmd batch, n_chunks = 3 (done = 145, total = 161)
0.17.346.677 I mtmd batch encoding done in 202 ms
0.17.617.924 I encoding mtmd batch, n_chunks = 3 (done = 149, total = 161)
0.17.823.393 I mtmd batch encoding done in 205 ms
0.18.101.736 I encoding mtmd batch, n_chunks = 3 (done = 153, total = 161)
0.18.307.555 I mtmd batch encoding done in 206 ms
0.18.597.972 I encoding mtmd batch, n_chunks = 3 (done = 157, total = 161)
0.18.803.980 I mtmd batch encoding done in 206 ms

The newspaper is called 'Kaperejszak'.

@ngxson ngxson merged commit db52540 into ggml-org:master Jun 18, 2026
23 of 25 checks passed
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.

1 participant