TensorRT-LLM icon indicating copy to clipboard operation
TensorRT-LLM copied to clipboard

[Model Requests] Support Qwen2.5-VL Architecture

Open mtezgider opened this issue 1 year ago • 9 comments

I would like to request support for the Qwen2.5-VL architecture in TensorRT-LLM.

When I try to convert the model to an LLM checkpoint and build the engine, I encounter the following error:

Traceback (most recent call last): File "/usr/local/bin/trtllm-build", line 8, in <module> sys.exit(main()) ^^^^^^ File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/commands/build.py", line 517, in main model_config = PretrainedConfig.from_json_file(config_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/models/modeling_utils.py", line 434, in from_json_file obj = cls.from_dict(config) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/models/modeling_utils.py", line 416, in from_dict model_cls = MODEL_MAP[config['architecture']] ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^ KeyError: 'Qwen2_5_VLForConditionalGeneration'

It seems that Qwen2.5-VL is not yet included in the MODEL_MAP within TensorRT-LLM. Since Qwen2 VL models are already supported, adding Qwen2.5-VL would be a valuable extension, particularly for multimodal tasks (text + image understanding).

Request: Could you provide insights on whether there are plans to support this architecture in future releases?

Thanks!

mtezgider avatar Feb 18 '25 16:02 mtezgider

I also request this support. Adding 'Qwen2_5_VLForConditionalGeneration': QWenForCausalLM in MODEL_MAP didn't work.

'Qwen2_5_VLForConditionalGeneration': QWenForCausalLM,

https://github.com/NVIDIA/TensorRT-LLM/blob/258c7540c03517def55d9a5aadfa9288af474e1b/tensorrt_llm/models/init.py#L179

[TensorRT-LLM] TensorRT-LLM version: 0.17.0
~~~ omit ~~~
[03/03/2025-04:54:10] [TRT-LLM] [I] Set nccl_plugin to None.
Traceback (most recent call last):
  File "/usr/local/bin/trtllm-build", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/commands/build.py", line 621, in main
    parallel_build(model_config, ckpt_dir, build_config, args.output_dir,
  File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/commands/build.py", line 419, in parallel_build
    passed = build_and_save(rank, rank % workers, ckpt_dir,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/commands/build.py", line 384, in build_and_save
    engine = build_model(build_config,
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/commands/build.py", line 377, in build_model
    return build(model, build_config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/builder.py", line 1257, in build
    model(**inputs)
  File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/module.py", line 52, in __call__
    output = self.forward(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/models/modeling_utils.py", line 1004, in forward
    hidden_states = self.transformer.forward(**kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/models/qwen/model.py", line 196, in forward
    hidden_states = self.layers.forward(
                    ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/models/modeling_utils.py", line 549, in forward
    hidden_states = layer(
                    ^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/module.py", line 52, in __call__
    output = self.forward(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/models/qwen/model.py", line 127, in forward
    attention_output = self.attention(
                       ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/module.py", line 52, in __call__
    output = self.forward(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/layers/attention.py", line 1033, in forward
    context, past_key_value = gpt_attention(
                              ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/graph_rewriting.py", line 567, in wrapper
    outs = f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/functional.py", line 5132, in gpt_attention
    assert (mrope_rotary_cos_sin
           ^^^^^^^^^^^^^^^^^^^^^
AssertionError

youki-sada avatar Mar 03 '25 05:03 youki-sada

How is it going?Is there any plan to support Qwen2.5-VL?

Weili17 avatar Mar 18 '25 13:03 Weili17

Same problem here

andrearama avatar Mar 20 '25 08:03 andrearama

same problem here

YoungerGao avatar Apr 07 '25 07:04 YoungerGao

same problem here

HPUedCSLearner avatar May 14 '25 02:05 HPUedCSLearner

same problem here

zkl-ai avatar Aug 20 '25 09:08 zkl-ai

This model has been around for months, why haven't they added any support or at least some kind of response like we're working on it(

moninch avatar Sep 10 '25 12:09 moninch

Any updates here?

waseemoo1 avatar Nov 26 '25 09:11 waseemoo1

Apologies for the delayed response. The Qwen2.5 VL model is supported by the PyTorch backend and can be found in the Multimodal Feature Support Matrix (PyTorch Backend).

karljang avatar Dec 22 '25 08:12 karljang