[Bugfix] Make mrope kwargs optional in HunyuanImage3 get_mrope_input_positions#2654
Conversation
…positions (vllm-project#2642) HunyuanImage3ForConditionalGeneration.get_mrope_input_positions() declared hf_config, image_grid_thw, and video_grid_thw as required keyword-only parameters, but the upstream vllm caller only passes 2 positional args per the SupportsMRoPE protocol contract, causing a TypeError crash. These 3 kwargs are never referenced in the ~180-line method body the method extracts all needed data from self.config and mm_features internally. Give them None defaults so both callers (upstream 2-arg and vllm-omni full-kwargs) work correctly. Fixes vllm-project#2642 Signed-off-by: Yiyang Liu <yiyangliu@microsoft.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@hsliuustc0106 @lishunyang12 The |
|
@hsliuustc0106 @lishunyang12 Gentle ping the readthedocs timeout on the merge commit appears to be a repo-wide issue (not specific to this PR). All other checks pass. Could you take a look when convenient? |
…positions (vllm-project#2654) Signed-off-by: Yiyang Liu <yiyangliu@microsoft.com> Co-authored-by: SYLAR <125541396+lishunyang12@users.noreply.github.com>
…positions (vllm-project#2654) Signed-off-by: Yiyang Liu <yiyangliu@microsoft.com> Co-authored-by: SYLAR <125541396+lishunyang12@users.noreply.github.com>
…positions (vllm-project#2654) Signed-off-by: Yiyang Liu <yiyangliu@microsoft.com> Co-authored-by: SYLAR <125541396+lishunyang12@users.noreply.github.com>
…positions (vllm-project#2654) Signed-off-by: Yiyang Liu <yiyangliu@microsoft.com> Co-authored-by: SYLAR <125541396+lishunyang12@users.noreply.github.com>
Purpose
Fix #2642
HunyuanImage3ForConditionalGeneration.get_mrope_input_positions()crashes withTypeError: missing 3 required keyword-only arguments: 'hf_config', 'image_grid_thw', and 'video_grid_thw'when called from the upstream vllm caller.Root cause
The
SupportsMRoPEprotocol definesget_mrope_input_positions(self, input_tokens, mm_features)only 2 positional args. But HunyuanImage3's implementation declareshf_config,image_grid_thw, andvideo_grid_thwas required keyword-only parameters (after*, no defaults). The upstream vllm caller follows the protocol and only passes 2 args crash.Key finding
These 3 kwargs are never referenced in the ~180-line method body. The method extracts all needed data from
self.configandmm_featuresinternally (e.g.,vae_token_grid_hwandvit_spatial_shapesfrommm_feature.data). They were likely carried over from an older Qwen2-VL style signature.Fix
Give the 3 unused kwargs
Nonedefaults so both callers work:Test Plan
Signature-only change no new logic paths introduced. The 3 kwargs are confirmed unused in the method body (verified by reading all ~180 lines). Both callers (upstream 2-arg and vllm-omni full-kwargs) continue to work correctly.
Test Result
Before:
TypeError: get_mrope_input_positions() missing 3 required keyword-only argumentsAfter: Method accepts calls with or without these kwargs.
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.