Skip to content

fix: Fix Granite4 Vision regression based on n_tokens counting - #24733

Closed
gabe-l-hart wants to merge 1 commit into
ggml-org:masterfrom
gabe-l-hart:FixLlavaNextNTokens
Closed

gabe-l-hart wants to merge 1 commit into
ggml-org:masterfrom
gabe-l-hart:FixLlavaNextNTokens

Conversation

@gabe-l-hart

Copy link
Copy Markdown
Collaborator

Draft Status

We're actively getting our GGUF models published, and I'll add a test against them in the future so we can catch this. I'll take this out of draft once I have the test in place.

Overview

The fix in #24656 was added to correctly account for batch size when users submit multi-image batches, but in the process it broke Granite4 Vision (and any future llava-next style model) which uses the batch dimension to hold the image tiles without textual delimiters.

#24656 (comment)
#24656 (comment)

Additional information

This is the least-invasive fix I could come up with. I considered setting n_temporal_merge instead, but that would need to be dynamic based on the tile grid logic and the input image size/shape. The downside of the current solution is that it likely prevents proper counting for multi-image batches for these models. Currently G4V doesn't support multi-image queries, so that isn't a strong functional requirement, but could be a problem in the future.

Requirements

This likely isn't quite right for actual multi-image batches.

Branch: FixLlavaNextNTokens
AI-usage: none
Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
@gabe-l-hart

Copy link
Copy Markdown
Collaborator Author

Closing in favor of #24732

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