Skip to content

[Doc] Update ViT CUDA graph doc for mixed (image+video) inputs#40355

Merged
Isotr0py merged 1 commit intovllm-project:mainfrom
shen-shanshan:doc
Apr 21, 2026
Merged

[Doc] Update ViT CUDA graph doc for mixed (image+video) inputs#40355
Isotr0py merged 1 commit intovllm-project:mainfrom
shen-shanshan:doc

Conversation

@shen-shanshan
Copy link
Copy Markdown
Contributor

@shen-shanshan shen-shanshan commented Apr 20, 2026

Purpose

Following #35963 and #38061, we have supported ViT CUDA graph image/video inference for Qwen3-VL respectively. Now we have demonstrated that it's also compatible for mixed (image+video) inputs (per prompt).

Since we have grouped and batched multi-modal inputs in _execute_mm_encoder() through group_and_batch_mm_kwargs(), each call for model.embed_multimodal() or encoder_cudagraph_manager.execute() will only contain single modality.

# vllm/vllm/v1/worker/gpu_model_runner.py
def _execute_mm_encoder(...):
    # ...
    for modality, num_items, mm_kwargs_batch in group_and_batch_mm_kwargs(...):
        # ...
        if enable_vit_cuda_graph:
            batch_outputs = self.encoder_cudagraph_manager.execute(mm_kwargs_batch)
        else:
            batch_outputs = model.embed_multimodal(**mm_kwargs_batch)


# vllm/vllm/multimodal/utils.py
def group_and_batch_mm_kwargs(mm_kwargs, ...):
    for modality, group in groupby(mm_kwargs, key=lambda x: x[0]):
        ...
        for num_items, mm_kwargs_batch in group_and_batch_mm_items(...):
            yield modality, num_items, mm_kwargs_batch

Thus, mixed inputs will be separated to different ViT processes (i.e., it's compatible for our CUDA graph implementation).

Test Plan

Based on #40335.

# Pass compilation_config to EngineArgs in run_qwen3_vl()
# compilation_config={
#     "cudagraph_mm_encoder": True,
#     "encoder_cudagraph_token_budgets": [512, 1024, 1536, 2048, 2560, 3072, 3584, 4096, 4864],
#     "encoder_cudagraph_max_vision_items_per_batch": 8,
#     "encoder_cudagraph_max_frames_per_batch": 64,
# }
python examples/offline_inference/vision_language.py -m qwen3_vl --modality "image+video"

Test Result

--------------------------------------------------
The image shows a baby girl sitting on a bed, wearing glasses and reading a book. She is focused on the book, turning the pages with her small hands. The room appears to be a bedroom, with a crib and some clothes visible in the background.

In the video, the baby girl continues to read the book, occasionally looking up and smiling. She seems to be enjoying her reading time, and her glasses add a touch of charm to her appearance. The video captures a sweet and innocent moment of a child engaging in a quiet activity.
--------------------------------------------------
The image shows a baby girl sitting on a bed, wearing glasses, and reading a book.

The video shows the same baby girl continuing to read the book, turning the pages, and occasionally looking up. She appears to be very focused on the book and is enjoying her reading time.
--------------------------------------------------
The image shows a baby girl sitting on a bed, wearing glasses, and reading a book. She is focused on the book, turning the pages with her small hands. The background includes a crib and some clothes, suggesting a cozy and comfortable setting.

In the video, the baby girl continues to read the book, occasionally looking up and smiling. She seems to be enjoying the activity and is fully engaged in the story. The video captures the innocence and curiosity of a young child exploring the world of books.
--------------------------------------------------
The image shows a baby sitting on a bed, wearing glasses, and reading a book. The baby is dressed in a light blue shirt and pink pants. The background includes a crib and some clothes on the bed.

In the video, the baby continues to read the book, turning the pages and occasionally looking up. The baby seems to be enjoying the activity and is focused on the book. The video captures the baby's concentration and curiosity as they explore the book.
--------------------------------------------------

Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

Signed-off-by: shen-shanshan <467638484@qq.com>
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 20, 2026

Documentation preview: https://vllm--40355.org.readthedocs.build/en/40355/

@mergify mergify Bot added documentation Improvements or additions to documentation nvidia labels Apr 20, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the documentation for CUDA graphs in multimodal models to reflect that video inference support is no longer experimental and that mixed image and video inputs per prompt are now supported. Examples and notes recommending the limitation of multi-modal inputs have been removed accordingly. I have no feedback to provide as there were no review comments.

@Isotr0py Isotr0py enabled auto-merge (squash) April 21, 2026 02:29
@github-actions github-actions Bot added the ready ONLY add when PR is ready to merge/full CI is needed label Apr 21, 2026
@github-project-automation github-project-automation Bot moved this to Ready in NVIDIA Apr 21, 2026
@Isotr0py Isotr0py merged commit 8097591 into vllm-project:main Apr 21, 2026
13 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to Done in NVIDIA Apr 21, 2026
Copilot AI pushed a commit to hongbolv/vllm that referenced this pull request Apr 22, 2026
…project#40355)

Signed-off-by: shen-shanshan <467638484@qq.com>
Co-authored-by: hongbolv <33214277+hongbolv@users.noreply.github.com>
baonudesifeizhai pushed a commit to baonudesifeizhai/vllm that referenced this pull request Apr 23, 2026
yzong-rh pushed a commit to yzong-rh/vllm that referenced this pull request Apr 23, 2026
…project#40355)

Signed-off-by: shen-shanshan <467638484@qq.com>
Signed-off-by: Yifan <yzong@redhat.com>
avinashsingh77 pushed a commit to avinashsingh77/vllm that referenced this pull request Apr 27, 2026
…project#40355)

Signed-off-by: shen-shanshan <467638484@qq.com>
Signed-off-by: Avinash Singh <avinashsingh.rcoem@gmail.com>
Lafunamor pushed a commit to Lafunamor/vllm that referenced this pull request May 1, 2026
…project#40355)

Signed-off-by: shen-shanshan <467638484@qq.com>
Signed-off-by: Adrian <info@zzit.ch>
Copilot AI pushed a commit to hongbolv/vllm that referenced this pull request May 7, 2026
…project#40355)

Signed-off-by: shen-shanshan <467638484@qq.com>
Co-authored-by: hongbolv <33214277+hongbolv@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation nvidia ready ONLY add when PR is ready to merge/full CI is needed

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants