Skip to content

issue/350 - add ChatGLM causal LM model support#353

Open
JoeZhang-0x000 wants to merge 2 commits intoInfiniTensor:mainfrom
JoeZhang-0x000:issue/350
Open

issue/350 - add ChatGLM causal LM model support#353
JoeZhang-0x000 wants to merge 2 commits intoInfiniTensor:mainfrom
JoeZhang-0x000:issue/350

Conversation

@JoeZhang-0x000
Copy link
Copy Markdown

Summary

  • Add ChatGLM model config adapter (csrc/models/chatglm/)
  • Extend rank_worker.cpp condition to include "chatglm"
  • Register "chatglm" in config_factory.cpp classic_models list and auto_config.py
  • Add ChatGLM weight remapping (key rename + QKV/FFN split) in modeling_utils.py
  • Update test_infer.py for ChatGLM tokenizer special token handling

Note: This branch is based on issue/349 (GLM4 support) since ChatGLM depends on GLM4's infrastructure changes (partial rotary, RoPE algo, rank_worker special path). Please merge #352 first.

Closes #350
Parent issue: #332

- Add GLM4 model config adapter (csrc/models/glm4/)
- Add partial rotary support (llama_utils.hpp, llama_attention.*)
- Add forward_naive + GLM4 post-norm support (llama_decoder_layer.*)
- Add RoPE algo selection for GLM4 (llama_model.cpp)
- Add GLM4 special model creation path (rank_worker.cpp)
- Register glm4 in config_factory.cpp and auto_config.py
- Add GLM4 weight remapping (gate_up_proj split) in modeling_utils.py
@JoeZhang-0x000 JoeZhang-0x000 requested a review from a team May 7, 2026 06:59
- Add ChatGLM model config adapter (csrc/models/chatglm/)
- Extend rank_worker.cpp condition to include chatglm
- Register chatglm in config_factory.cpp and auto_config.py
- Add ChatGLM weight remapping (key rename + QKV/FFN split) in modeling_utils.py
- Update test_infer.py for ChatGLM tokenizer special token handling
@pengcheng888
Copy link
Copy Markdown
Collaborator

请先处理glm4的#352

@wooway777
Copy link
Copy Markdown
Collaborator

image

在当前分支模型输出为空

但在之前的三合一分支正常:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support ChatGLM model

3 participants