From 50864ce5986f3e3d1a0e95db96cdb0f2a871ee70 Mon Sep 17 00:00:00 2001 From: Minh Vu Date: Fri, 24 Jul 2026 20:23:32 +0200 Subject: [PATCH] [#16792][fix] Preserve Qwen3.5-VL multimodal content order Opt the dense and MoE Qwen3.5-VL registrations into the existing interleaved placeholder path so OpenAI content-part ordering is retained. Signed-off-by: Minh Vu --- tensorrt_llm/_torch/models/modeling_qwen3_5.py | 1 + tests/unittest/_torch/modeling/test_modeling_qwen3_5_vl.py | 1 + tests/unittest/_torch/modeling/test_modeling_qwen3_5_vl_moe.py | 1 + 3 files changed, 3 insertions(+) diff --git a/tensorrt_llm/_torch/models/modeling_qwen3_5.py b/tensorrt_llm/_torch/models/modeling_qwen3_5.py index 6fc43129a353..cafaac0537a3 100644 --- a/tensorrt_llm/_torch/models/modeling_qwen3_5.py +++ b/tensorrt_llm/_torch/models/modeling_qwen3_5.py @@ -649,6 +649,7 @@ def __init__(self, model_config): placeholder_placement=MultimodalPlaceholderPlacement.BEFORE_TEXT, placeholders_separator="", content_format=ContentFormat.STRING, + interleave_placeholders=True, ) diff --git a/tests/unittest/_torch/modeling/test_modeling_qwen3_5_vl.py b/tests/unittest/_torch/modeling/test_modeling_qwen3_5_vl.py index 57537e004166..425756cbf9e0 100644 --- a/tests/unittest/_torch/modeling/test_modeling_qwen3_5_vl.py +++ b/tests/unittest/_torch/modeling/test_modeling_qwen3_5_vl.py @@ -208,6 +208,7 @@ def test_qwen35_dense_vl_placeholder_metadata_registered() -> None: } assert metadata.placeholders_separator == "" assert metadata.content_format is ContentFormat.STRING + assert metadata.interleave_placeholders # --- Layered parity test scaffold ------------------------------------------- diff --git a/tests/unittest/_torch/modeling/test_modeling_qwen3_5_vl_moe.py b/tests/unittest/_torch/modeling/test_modeling_qwen3_5_vl_moe.py index e715c53a3ac2..309afbf5a8d7 100644 --- a/tests/unittest/_torch/modeling/test_modeling_qwen3_5_vl_moe.py +++ b/tests/unittest/_torch/modeling/test_modeling_qwen3_5_vl_moe.py @@ -165,6 +165,7 @@ def test_qwen35_moe_vl_placeholder_metadata_registered() -> None: } assert metadata.placeholders_separator == "" assert metadata.content_format is ContentFormat.STRING + assert metadata.interleave_placeholders # --- Layered parity test scaffold -------------------------------------------