Skip to content

Fix/minicpmv46 missing version#44980

Merged
DarkLight1337 merged 4 commits into
vllm-project:mainfrom
wjinxu:fix/minicpmv46-missing-version
Jun 11, 2026
Merged

Fix/minicpmv46 missing version#44980
DarkLight1337 merged 4 commits into
vllm-project:mainfrom
wjinxu:fix/minicpmv46-missing-version

Conversation

@wjinxu

@wjinxu wjinxu commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Reported in OpenBMB/MiniCPM-V#1113 (vllm serve openbmb/MiniCPM-V-4_6).

Fix

Two layers:

  1. MiniCPMV4_6ProcessingInfo.get_hf_processor() now returns the native MiniCPMV4_6Processor directly instead of the vendored wrapper. MiniCPM-V 4.6 already implements its own image/video handling and prompt-update logic, so it neither needs nor is compatible with the vendored processor designed for 2.x/4.0/4.5. The transformers v5+ image_mean/image_std ndarray→list normalization is preserved.

  2. Defensive safety net: MiniCPMVProcessor.__init__ reads getattr(image_processor, "version", None) instead of hard-crashing, so any future MiniCPM image processor that drops version degrades gracefully. version is only used to special-case the 2.5 tokenization path; any other value already takes the default branch.

Test Plan

Verified end-to-end with vllm serve on transformers 5.9.0 (a true v5 env), image+text request to each:

Version Arch Startup Image+text result
2.5 (MiniCPM-Llama3-V-2_5) MiniCPMV OK correct
4.5 (MiniCPM-o-4_5) MiniCPMO OK correct
4.6 (MiniCPM-V-4_6) MiniCPMV4_6 OK correct

The 4.6 run confirms the original AttributeError is gone; 2.5/4.5 confirm the vendored path is unaffected.

Fixes OpenBMB/MiniCPM-V#1113

cc @DarkLight1337 @tc-mb

wjinxu and others added 2 commits June 9, 2026 15:37
MiniCPM-V 4.6 uses the transformers v5.7+ native MiniCPMV4_6ImageProcessor,
which no longer exposes the legacy `version` attribute. Since
MiniCPMV4_6ProcessingInfo inherited the base get_hf_processor() that wraps
the image processor in the vendored MiniCPMVProcessor, startup crashed with:

    AttributeError: 'MiniCPMV4_6ImageProcessor' object has no attribute 'version'

(reported in OpenBMB/MiniCPM-V#1113).

Fix it in two layers:

1. MiniCPMV4_6ProcessingInfo now overrides get_hf_processor() to return the
   native MiniCPMV4_6Processor directly. 4.6 already implements its own
   image/video handling and prompt-update logic, so it neither needs nor is
   compatible with the vendored processor designed for 2.x/4.0/4.5. The v5+
   image_mean/image_std ndarray->list normalization is preserved.

2. As a defensive safety net for any future MiniCPM image processor that
   drops `version`, MiniCPMVProcessor.__init__ now reads it via
   getattr(image_processor, "version", None) instead of hard-crashing.
   `version` is only used to special-case the 2.5 tokenization path; any
   other value already takes the default branch.

Verified end-to-end with `vllm serve` on transformers 5.9.0: MiniCPM-V 2.5,
MiniCPM-o 4.5, and MiniCPM-V 4.6 all start and answer image+text requests
correctly.

Signed-off-by: wjinxu <1299461899@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Apply the same defensive fallback to MiniCPMOProcessor.__init__ as was done
for MiniCPMVProcessor: read `version` via getattr(..., None) instead of
hard-crashing. MiniCPM-o shares the same vendored-processor pattern, so a
future MiniCPM-o variant on a transformers v5.7+ native image processor
(which no longer carries `version`) would otherwise hit the identical
AttributeError. No behavior change for current 2.6/4.5 models, whose
image processors still expose `version`.

Signed-off-by: wjinxu <1299461899@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@DarkLight1337 DarkLight1337 enabled auto-merge (squash) June 9, 2026 07:51
@github-actions github-actions Bot added the ready ONLY add when PR is ready to merge/full CI is needed label Jun 9, 2026
@tc-mb

tc-mb commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Yes, when merging #44282 before, it wasn't fully tested.
This PR will fix and add the missing parts. Sorry for the inconvenience.

@wjinxu

wjinxu commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@DarkLight1337 The docs/readthedocs.org:vllm red is stale, not a real docs failure.

That RTD build (#33053507) ran before the ready label was added: its post_checkout step runs docs/pre_run_check.sh, which polled pre-commit/pre-run-check, saw it failing (the label/merge-count gate), and skipped the docs build, exiting 1 — mkdocs never actually ran. After the label was added the gate passed and buildkite re-ran green, but RTD doesn't auto-rebuild the same commit, so its status is frozen on that pre-label snapshot (status timestamp 07:55, never updated since).

This PR only adds # comments — no docstring or mkdocs/nav changes — so there's nothing for griffe/fail_on_warning to trip on. Could you trigger a Read the Docs rebuild for this commit, or confirm the docs check isn't blocking the squash auto-merge? Thanks!

wjinxu and others added 2 commits June 11, 2026 14:48
Empty commit to re-run buildkite + Read the Docs after the `ready` label
was applied (previous run's docs build was skipped by pre_run_check.sh
while the label/merge-count gate was still failing). No code changes.

Signed-off-by: wjinxu <1299461899@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@DarkLight1337 DarkLight1337 merged commit aa1df36 into vllm-project:main Jun 11, 2026
70 checks passed
ryttry pushed a commit to ryttry/vllm that referenced this pull request Jun 11, 2026
Signed-off-by: wjinxu <1299461899@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Saddss pushed a commit to Saddss/vllm that referenced this pull request Jun 14, 2026
Signed-off-by: wjinxu <1299461899@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
vivek8123 pushed a commit to odh-on-pz/vllm-upstream that referenced this pull request Jun 18, 2026
Signed-off-by: wjinxu <1299461899@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
divineearthly pushed a commit to divineearthly/vllm that referenced this pull request Jun 19, 2026
Signed-off-by: wjinxu <1299461899@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: divineearthly <divineearthly@gmail.com>
tunglinwood pushed a commit to tunglinwood/vllm that referenced this pull request Jun 22, 2026
Signed-off-by: wjinxu <1299461899@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
nkzhenhua pushed a commit to nkzhenhua/vllm that referenced this pull request Jun 24, 2026
Signed-off-by: wjinxu <1299461899@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

3 participants