You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(mtmd/qwen3vl): validate image_max_tiles at library boundary, scope to Qwen3VL
Addresses review on PR #175:
- Clamp the preproc_max_tiles override to [1,256] in clip_init. Bindings populate
clip_context_params directly and bypass the CLI's range check; an unbounded value
reached the O(max_tiles*log max_tiles) grid-fitting reserve in mtmd-image.cpp and
could request hundreds of GB -> std::bad_alloc -> process crash.
- Extract a shared CLIP_PREPROC_MAX_TILES_LIMIT (clip-impl.h) and use it at both the
GGUF-read and override sites so the bound can't drift.
- Scope the override to PROJECTOR_TYPE_QWEN3VL (the only preprocessor that reads the
field live); warn and ignore for other projectors. Drop the dead InternVL min-tiles
clamp (InternVL reads a candidate list frozen in load_hparams, not the live field).
- Gate the "set --image-max-tiles" suggestion in the shared Qwen2/2.5/3 case to
Qwen3VL only; the flag is inert for Qwen2/2.5VL (dyn_size).
0 commit comments