@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 841490434a
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

[Model] Enable native HF format InternVL support (#23742)

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>

Isotr0py committed Aug 27, 2025 at 22:45 UTC 841490434aaee4b1c8d8427112af740b6662f384
4 files changed +18 -16
docs/models/supported_models.md
+1
@@ -629,6 +629,7 @@ These models primarily accept the [`LLM.generate`](./generative_models.md#llmgen
629 | `Idefics3ForConditionalGeneration` | Idefics3 | T + I | `HuggingFaceM4/Idefics3-8B-Llama3`, etc. | ✅︎ | | ✅︎ |
630 | `InternS1ForConditionalGeneration` | Intern-S1 | T + I<sup>E+</sup> + V<sup>E+</sup> | `internlm/Intern-S1`, etc. | ✅︎ | ✅︎ | ✅︎ |
631 | `InternVLChatModel` | InternVL 3.5, InternVL 3.0, InternVideo 2.5, InternVL 2.5, Mono-InternVL, InternVL 2.0 | T + I<sup>E+</sup> + (V<sup>E+</sup>) | `OpenGVLab/InternVL3_5-14B`, `OpenGVLab/InternVL3-9B`, `OpenGVLab/InternVideo2_5_Chat_8B`, `OpenGVLab/InternVL2_5-4B`, `OpenGVLab/Mono-InternVL-2B`, `OpenGVLab/InternVL2-4B`, etc. | ✅︎ | ✅︎ | ✅︎ |
632 +| `InternVLForConditionalGeneration` | InternVL 3.0 (HF format) | T + I<sup>E+</sup> + V<sup>E+</sup> | `OpenGVLab/InternVL3-1B-hf`, etc. | ✅︎ | ✅︎ | ✅︎ |
633 | `KeyeForConditionalGeneration` | Keye-VL-8B-Preview | T + I<sup>E+</sup> + V<sup>E+</sup> | `Kwai-Keye/Keye-VL-8B-Preview` | | | ✅︎ |
634 | `KimiVLForConditionalGeneration` | Kimi-VL-A3B-Instruct, Kimi-VL-A3B-Thinking | T + I<sup>+</sup> | `moonshotai/Kimi-VL-A3B-Instruct`, `moonshotai/Kimi-VL-A3B-Thinking` | | ✅︎ | ✅︎ |
635 | `Llama4ForConditionalGeneration` | Llama 4 | T + I<sup>+</sup> | `meta-llama/Llama-4-Scout-17B-16E-Instruct`, `meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8`, `meta-llama/Llama-4-Maverick-17B-128E-Instruct`, etc. | | ✅︎ | ✅︎ |
tests/models/multimodal/generation/test_common.py
+14 -15
@@ -222,21 +222,6 @@ VLM_TEST_SETTINGS = {
222 },
223 marks=[large_gpu_mark(min_gb=32)],
224 ),
225 - # Check "auto" with fallback to transformers
226 - "internvl-transformers": VLMTestInfo(
227 - models=["OpenGVLab/InternVL3-1B-hf"],
228 - test_type=(VLMTestType.IMAGE, VLMTestType.MULTI_IMAGE),
229 - prompt_formatter=lambda img_prompt: f"<|im_start|>User\n{img_prompt}<|im_end|>\n<|im_start|>Assistant\n", # noqa: E501
230 - img_idx_to_prompt=lambda idx: "<IMG_CONTEXT>",
231 - max_model_len=4096,
232 - use_tokenizer_eos=True,
233 - image_size_factors=[(0.25, 0.5, 1.0)],
234 - vllm_runner_kwargs={
235 - "model_impl": "auto",
236 - },
237 - auto_cls=AutoModelForImageTextToText,
238 - marks=[pytest.mark.core_model],
239 - ),
225 #### Extended model tests
226 "aria": VLMTestInfo(
227 models=["rhymes-ai/Aria"],
@@ -461,6 +446,20 @@ VLM_TEST_SETTINGS = {
446 use_tokenizer_eos=True,
447 patch_hf_runner=model_utils.internvl_patch_hf_runner,
448 ),
449 + "intern_vl-hf": VLMTestInfo(
450 + models=["OpenGVLab/InternVL3-1B-hf"],
451 + test_type=(
452 + VLMTestType.IMAGE,
453 + VLMTestType.MULTI_IMAGE,
454 + VLMTestType.VIDEO,
455 + ),
456 + prompt_formatter=lambda img_prompt: f"<|im_start|>User\n{img_prompt}<|im_end|>\n<|im_start|>Assistant\n", # noqa: E501
457 + img_idx_to_prompt=lambda idx: "<IMG_CONTEXT>",
458 + video_idx_to_prompt=lambda idx: "<video>",
459 + max_model_len=8192,
460 + use_tokenizer_eos=True,
461 + auto_cls=AutoModelForImageTextToText,
462 + ),
463 "kimi_vl": VLMTestInfo(
464 models=["moonshotai/Kimi-VL-A3B-Instruct"],
465 test_type=(VLMTestType.IMAGE, VLMTestType.MULTI_IMAGE),
tests/models/registry.py
+2 -1
@@ -429,6 +429,7 @@ _MULTIMODAL_EXAMPLE_MODELS = {
429 "3.5-qwen3moe": "OpenGVLab/InternVL3_5-30B-A3B", # noqa: E501
430 "3.5-gptoss": "OpenGVLab/InternVL3_5-GPT-OSS-20B-A4B-Preview"}, # noqa: E501
431 trust_remote_code=True),
432 + "InternVLForConditionalGeneration": _HfExamplesInfo("OpenGVLab/InternVL3-1B-hf"), # noqa: E501
433 "KeyeForConditionalGeneration": _HfExamplesInfo("Kwai-Keye/Keye-VL-8B-Preview", # noqa: E501
434 trust_remote_code=True),
435 "KimiVLForConditionalGeneration": _HfExamplesInfo("moonshotai/Kimi-VL-A3B-Instruct", # noqa: E501
@@ -584,7 +585,7 @@ _SPECULATIVE_DECODING_EXAMPLE_MODELS = {
585 _TRANSFORMERS_BACKEND_MODELS = {
586 "TransformersModel": _HfExamplesInfo("Qwen/Qwen3-Embedding-0.6B"),
587 "TransformersForCausalLM": _HfExamplesInfo("hmellor/Ilama-3.2-1B", trust_remote_code=True), # noqa: E501
587 - "TransformersForMultimodalLM": _HfExamplesInfo("OpenGVLab/InternVL3-1B-hf"),
588 + "TransformersForMultimodalLM": _HfExamplesInfo("BAAI/Emu3-Chat-hf"),
589 }
590
591 _EXAMPLE_MODELS = {
vllm/model_executor/models/registry.py
+1
@@ -220,6 +220,7 @@ _MULTIMODAL_MODELS = {
220 "H2OVLChatModel": ("h2ovl", "H2OVLChatModel"),
221 "InternVLChatModel": ("internvl", "InternVLChatModel"),
222 "InternS1ForConditionalGeneration": ("interns1", "InternS1ForConditionalGeneration"), # noqa: E501
223 + "InternVLForConditionalGeneration": ("interns1", "InternS1ForConditionalGeneration"), # noqa: E501
224 "Idefics3ForConditionalGeneration":("idefics3","Idefics3ForConditionalGeneration"),
225 "SmolVLMForConditionalGeneration": ("smolvlm","SmolVLMForConditionalGeneration"), # noqa: E501
226 "KeyeForConditionalGeneration": ("keye", "KeyeForConditionalGeneration"),