Skip to content

mtmd : read LFM2 tiling params from GGUF metadata#25524

Open
michael-dm wants to merge 1 commit into
ggml-org:masterfrom
michael-dm:lfm2-configurable-tiling
Open

mtmd : read LFM2 tiling params from GGUF metadata#25524
michael-dm wants to merge 1 commit into
ggml-org:masterfrom
michael-dm:lfm2-configurable-tiling

Conversation

@michael-dm

@michael-dm michael-dm commented Jul 10, 2026

Copy link
Copy Markdown

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

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES - code written with AI assistance (Claude), reviewed and submitted by me.

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
@michael-dm michael-dm requested review from a team and CISC as code owners July 10, 2026 12:20
@github-actions github-actions Bot added mtmd Related to multimodal functionality (video/image/audio) conversion labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conversion mtmd Related to multimodal functionality (video/image/audio)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant