Skip to content

add minicpmv46 downsample#25993

Open
tc-mb wants to merge 1 commit into
ggml-org:masterfrom
tc-mb:minicpmv46-downsample-mode
Open

add minicpmv46 downsample#25993
tc-mb wants to merge 1 commit into
ggml-org:masterfrom
tc-mb:minicpmv46-downsample-mode

Conversation

@tc-mb

@tc-mb tc-mb commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Overview

This branch adds configurable visual token downsampling for MiniCPM-V 4.6:

  • Supports 4x and 16x modes, defaulting to the model’s 16x mode.
  • Skips the intermediate ViT merger in 4x mode to retain more visual tokens.

Signed-off-by: tc-mb <tianchi_cai@icloud.com>
@github-actions github-actions Bot added server mtmd Related to multimodal functionality (video/image/audio) labels Jul 22, 2026
@tc-mb
tc-mb marked this pull request as ready for review July 22, 2026 11:26
@tc-mb
tc-mb requested review from a team as code owners July 22, 2026 11:26
Comment thread common/arg.cpp
Comment on lines +2244 to +2248
add_opt(common_arg(
{"--downsample-mode"}, "N",
"MiniCPM-V 4.6 ViT downsample mode (4 or 16), default: 16 (model default)",
[](common_params & params, int value) {
if (value != 4 && value != 16) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding a single-use-case flag is generally not expected in the project. this flag should be removed.

instead, many models have the downsample as a GGUF metadata (read as n_merge in clip.cpp), I think it's better here to just distribute specific GGUF with the correct downsample values (will be 2 extra mmproj files in this case)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants