update packed modules mapping (#11)

Signed-off-by: prashanth058 <prashanth.dannamaneni@uipath.com>
This commit is contained in:
prashanth058 2025-12-11 23:55:32 -06:00 committed by GitHub
parent 0642610719
commit 5e78570cce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 6 deletions

View File

@ -340,12 +340,7 @@ class QKVParallelLinearWithLoRA(ColumnParallelLinearWithLoRA):
packed_modules_list: list,
model_config: PretrainedConfig | None = None,
) -> bool:
# Vision tower QKV has packed_modules_list=[] (already packed in checkpoint)
# Language models have packed_modules_list=[module_name]
# (single LoRA for qkv_proj)
return type(source_layer) is QKVParallelLinear and (
len(packed_modules_list) <= 1
)
return type(source_layer) is QKVParallelLinear and len(packed_modules_list) == 1
class MergedQKVParallelLinearWithLoRA(MergedColumnParallelLinearWithLoRA):

View File

@ -1061,6 +1061,7 @@ class Qwen2_5_VLForConditionalGeneration(
packed_modules_mapping = {
"qkv_proj": ["q_proj", "k_proj", "v_proj"],
"gate_up_proj": ["gate_proj", "up_proj"],
"qkv": ["qkv"], # For vision tower's already-packed QKV
}
# To ensure correct weight loading and mapping.

View File

@ -1201,6 +1201,7 @@ class Qwen3VLForConditionalGeneration(
"gate_proj",
"up_proj",
],
"qkv": ["qkv"], # For vision tower's already-packed QKV
}
supports_encoder_tp_data = True