]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
mtmd : fix padding of n_tokens (#19930)
authorGeorgi Gerganov <redacted>
Thu, 26 Feb 2026 16:39:49 +0000 (18:39 +0200)
committerGitHub <redacted>
Thu, 26 Feb 2026 16:39:49 +0000 (18:39 +0200)
tools/mtmd/mtmd-helper.cpp

index 902a4b456d9ca96de4a9ab8ce77c3be24fe2c628..c75f90730f1fc055d41f700ed8bf895e19911bf6 100644 (file)
@@ -248,7 +248,7 @@ int32_t mtmd_helper_decode_image_chunk(
 
     int32_t n_tokens = mtmd_input_chunk_get_n_tokens(chunk);
     int32_t i_batch = 0;
-    int32_t n_img_batches = GGML_PAD(n_tokens, n_batch) / n_batch;
+    int32_t n_img_batches = (n_tokens + n_batch - 1) / n_batch;
     decode_embd_batch batch_embd(encoded_embd, n_tokens, n_pos_per_embd, n_mmproj_embd);
 
     if (mtmd_decode_use_mrope(ctx)) {