Remove unnecessary load_weights methods (#44589)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2026-06-29 01:52:23 -07:00
committed by GitHub
parent db28ae2d07
commit 5051698e41
54 changed files with 821 additions and 1975 deletions
+13
View File
@@ -61,6 +61,7 @@ from .interfaces import (
SupportsMultiModal,
SupportsPP,
)
from .utils import WeightsMapper
class GLMVImagePixelInputs(TensorSchema):
@@ -376,6 +377,15 @@ class EVA2CLIPModel(nn.Module):
class GLM4VModel(ChatGLMModel):
hf_to_vllm_mapper = ChatGLMModel.hf_to_vllm_mapper | WeightsMapper(
orig_to_new_stacked={
# weight_name: (param_name, shard_id)
# Vision GLU projections
"linear_proj.gate_proj": ("linear_proj.merged_proj", 0),
"linear_proj.dense_h_to_4h": ("linear_proj.merged_proj", 1),
}
)
def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
super().__init__(vllm_config=vllm_config, prefix=prefix)
@@ -507,6 +517,9 @@ class GLM4VMultiModalProcessor(BaseMultiModalProcessor[GLM4VProcessingInfo]):
class GLM4VForCausalLM(
ChatGLMBaseModel, SupportsMultiModal, SupportsLoRA, SupportsPP, SupportsMRoPE
):
# NOTE: we must bring this to the surface because GLM4VModel.hf_to_vllm_mapper
# contains non-stacking related mappings which LoRA/BnB needs to know about
hf_to_vllm_mapper = GLM4VModel.hf_to_vllm_mapper
packed_modules_mapping = {
"query_key_value": ["query_key_value"],
"dense_h_to_4h": ["dense_h_to_4h"],