From 92b40628cd686932e02cd0bf7ccdcd278527c67c Mon Sep 17 00:00:00 2001 From: youzeyu <52071654+kurkol@users.noreply.github.com> Date: Tue, 20 Jan 2026 19:22:33 +0800 Subject: [PATCH] delete glmGlmForCausalLM register (#132) Co-authored-by: hanhaowen --- vllm_kunlun/models/__init__.py | 4 ---- vllm_kunlun/models/glm.py | 24 ------------------------ 2 files changed, 28 deletions(-) delete mode 100644 vllm_kunlun/models/glm.py diff --git a/vllm_kunlun/models/__init__.py b/vllm_kunlun/models/__init__.py index 55ab61e..48a4fe1 100644 --- a/vllm_kunlun/models/__init__.py +++ b/vllm_kunlun/models/__init__.py @@ -36,10 +36,6 @@ def register_model(): ModelRegistry.register_model( "Qwen3NextForCausalLM", "vllm_kunlun.models.qwen3_next:Qwen3NextForCausalLM") - - ModelRegistry.register_model( - "GlmForCausalLM", - "vllm_kunlun.models.glm:GlmForCausalLM") ModelRegistry.register_model( "GptOssForCausalLM", diff --git a/vllm_kunlun/models/glm.py b/vllm_kunlun/models/glm.py deleted file mode 100644 index d61e089..0000000 --- a/vllm_kunlun/models/glm.py +++ /dev/null @@ -1,24 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# SPDX-FileCopyrightText: Copyright contributors to the vLLM project -"""Inference-only HF format GLM-4 model compatible with THUDM weights.""" -from vllm.config import VllmConfig -# from vllm.model_executor.models.llama import LlamaForCausalLM -from .llama import LlamaForCausalLM #noqa: F401 - -from vllm.model_executor.models.utils import PPMissingLayer - -class GlmForCausalLM(LlamaForCausalLM): - - def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""): - print("glm for causalLM initialization!!!!", flush=True) - vllm_config.model_config.hf_config.partial_rotary_factor = 0.5 - super().__init__(vllm_config=vllm_config, prefix=prefix) - # Hack Llama model to fit HF format GLM implementation - # Attention difference between GLM and Llama: - # 1. Half partial rotary_dim and no Neox style. - # 2. There is no bias for o_proj in attention - for layer in self.model.layers: - if not isinstance(layer, PPMissingLayer): - layer.self_attn.rotary_emb.is_neox_style = False - layer.self_attn.o_proj.bias = None - layer.self_attn.o_proj.skip_bias_add = True