From 4e880537501d2b2935c97ddfe3dfdf2679d3e2dc Mon Sep 17 00:00:00 2001 From: TaffyOfficial <2587297563@qq.com> Date: Sun, 17 May 2026 22:42:59 +0800 Subject: [PATCH] [BugFix][HunyuanImage3] Set MRoPE dynamic_arg_dims so graph mode can compile (#3630) Signed-off-by: TaffyOfficial <2324465096@qq.com> Co-authored-by: TaffyOfficial <2324465096@qq.com> Co-authored-by: Codex --- .../models/hunyuan_image3/hunyuan_image3.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/vllm_omni/model_executor/models/hunyuan_image3/hunyuan_image3.py b/vllm_omni/model_executor/models/hunyuan_image3/hunyuan_image3.py index 4596d1145..b68a6fc3a 100644 --- a/vllm_omni/model_executor/models/hunyuan_image3/hunyuan_image3.py +++ b/vllm_omni/model_executor/models/hunyuan_image3/hunyuan_image3.py @@ -96,7 +96,16 @@ from vllm_omni.model_executor.models.hunyuan_image3.siglip2 import LightProjecto logger = init_logger(__name__) -@support_torch_compile +@support_torch_compile( + dynamic_arg_dims={ + "input_ids": 0, + # positions is (3, num_tokens) for mRoPE, so the token dimension is + # the last dimension rather than dim 0. + "positions": -1, + "intermediate_tensors": 0, + "inputs_embeds": 0, + } +) class HunyuanModel(HunYuanModel): def _split_qkv_weight(self, qkv: torch.Tensor): num_attention_heads = self.config.num_attention_heads