Skip to content

Update TensorRT-LLM - #2978

Merged
juney-nvidia merged 1 commit into
mainfrom
preview/main
Mar 23, 2025
Merged

juney-nvidia merged 1 commit into
mainfrom
preview/main

Conversation

@kaiyux

@kaiyux kaiyux commented Mar 23, 2025

Copy link
Copy Markdown
Member

No description provided.

Signed-off-by: Kaiyu Xie <26294424+kaiyux@users.noreply.github.com>
@juney-nvidia juney-nvidia self-assigned this Mar 23, 2025
@juney-nvidia
juney-nvidia self-requested a review March 23, 2025 08:39
@juney-nvidia
juney-nvidia merged commit 2631f21 into main Mar 23, 2025
@juney-nvidia
juney-nvidia deleted the preview/main branch March 23, 2025 08:39
@yorkeehuang

yorkeehuang commented Mar 24, 2025 •

Copy link
Copy Markdown

@kaiyux Dear expert, I have two questions about this commit:

  1. Can this modification improve ViT performance (it seems that it currently only supports llava_next), and what are the main optimizations introduced?
  2. Are there plans to implement Qwen2 VL/Qwen2.5 VL visual encoder in multimodal_encoders, and if so, what is the approximate timeline?
    Thank you very much!

@symphonylyh

symphonylyh commented Mar 24, 2025 •

Copy link
Copy Markdown
Collaborator

@yorkeehuang
Edit: the following answer is for pytorch workflow. for TRT workflow, see answers in the next paragraph

  1. no, at this point, the vision encoder ViT part is still just running huggingface pytorch, so not accelerated by TRT-LLM. We have plan to define ViT using TRT-LLM API, but no timeline yet.
  2. are you asking about Qwen2-VL or its vision encoder specifically? qwen2-vl model is already supported in https://github.com/NVIDIA/TensorRT-LLM/blob/main/tensorrt_llm/_torch/models/modeling_qwen2vl.py, and can try https://github.com/NVIDIA/TensorRT-LLM/blob/main/examples/pytorch/quickstart_multimodal.py. but if you're asking about just its vision encoder, the answer is same as (1)

ah...are you asking about the TRT workflow? since there are two workflows in TRT-LLM (the new Pytorch workflow, and the old TRT workflow), things can get confusing. I guess you are asking about "TensorRT workflow - Added vision encoders with tensor parallelism and context parallelism support. Refer to examples/vit/README.md."? If so, the answers is below:

  1. it's more of a functionality unblocker, not expecting too much performance gain. In the past, ViT is built as a single TensorRT engine, and you cannot do tensor parallelism / context parallelism. but with this change, TP/CP can be enabled for relatively large ViTs
  2. it's not on the roadmap, because new model / features are likely to land in the Pytorch workflow instead of TRT workflow. but I think you can follow the ViT TP/CP changes to smoothly enable it for qwen's vision encoder on your own

@yorkeehuang

yorkeehuang commented Mar 28, 2025 •

Copy link
Copy Markdown

@yorkeehuang Edit: the following answer is for pytorch workflow. for TRT workflow, see answers in the next paragraph

  1. no, at this point, the vision encoder ViT part is still just running huggingface pytorch, so not accelerated by TRT-LLM. We have plan to define ViT using TRT-LLM API, but no timeline yet.
  2. are you asking about Qwen2-VL or its vision encoder specifically? qwen2-vl model is already supported in https://github.com/NVIDIA/TensorRT-LLM/blob/main/tensorrt_llm/_torch/models/modeling_qwen2vl.py, and can try https://github.com/NVIDIA/TensorRT-LLM/blob/main/examples/pytorch/quickstart_multimodal.py. but if you're asking about just its vision encoder, the answer is same as (1)

ah...are you asking about the TRT workflow? since there are two workflows in TRT-LLM (the new Pytorch workflow, and the old TRT workflow), things can get confusing. I guess you are asking about "TensorRT workflow - Added vision encoders with tensor parallelism and context parallelism support. Refer to examples/vit/README.md."? If so, the answers is below:

  1. it's more of a functionality unblocker, not expecting too much performance gain. In the past, ViT is built as a single TensorRT engine, and you cannot do tensor parallelism / context parallelism. but with this change, TP/CP can be enabled for relatively large ViTs
  2. it's not on the roadmap, because new model / features are likely to land in the Pytorch workflow instead of TRT workflow. but I think you can follow the ViT TP/CP changes to smoothly enable it for qwen's vision encoder on your own

@symphonylyh
If I want to enhance the inference performance of Qwen2.5-VL's ViT by integrating FasterTransformer features in TensorRT-LLM, are there effective methods or similar examples? Looking forward to your reply, Thank you!

@symphonylyh

Copy link
Copy Markdown
Collaborator

@yorkeehuang what are "by integrating FasterTransformer features in TensorRT-LLM"? TRT-LLM should already included FastTransformer features

wu1du2 pushed a commit to wu1du2/TensorRT-LLM that referenced this pull request May 11, 2025
Signed-off-by: Kaiyu Xie <26294424+kaiyux@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants