mtmd : read LFM2 tiling params from GGUF metadata#25524
Open
michael-dm wants to merge 1 commit into
Open
Conversation
Write min_tiles, max_tiles, tile_size and max_pixels_tolerance from processor_config.json when converting LFM2-VL mmproj, read them in clip.cpp with the previous constants as defaults. do_image_splitting=false maps to min_tiles=max_tiles=1 (no tiling). Assisted-by: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01Xyxm13w4R2MjaLzwpiHDbi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Read LFM2/LFM2.5-VL image tiling parameters from GGUF metadata instead of hardcoded constants. The converter now writes min_tiles, max_tiles, tile_size and max_pixels_tolerance from processor_config.json, following the existing InternVL preproc_min_tiles / preproc_max_tiles pattern. do_image_splitting=false maps to min_tiles=max_tiles=1, which skips tiling.
Motivation: fine-tunes trained with do_image_splitting=false currently get forced tiling (19 chunks instead of 1 for a 1376x768 input), which breaks parity with the HF pipeline. GGUFs converted before this change keep the exact current behavior via defaults (2/10/512/2.0).
Additional information
Related: #21658 took a runtime CLI-flag approach to the same problem and was closed as too use-case specific. This does it at conversion time via metadata, consistent with how other projectors handle preprocessing params.
Requirements