mirror of
https://gitee.com/mindspore/mindformers.git
synced 2025-12-06 11:29:59 +08:00
!7779 【master】【bugfix】文档拼写整改
Merge pull request !7779 from 森镇/code_docs_fix_spelling
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Glm4
|
||||
# GLM-4
|
||||
|
||||
## 模型描述
|
||||
|
||||
@@ -8,8 +8,8 @@ GLM-4 系列模型是专为智能代理设计的基础模型, 其性能可与Ope
|
||||
|
||||
| 模型名称 | 规格 | 支持任务 | 模型架构 | 支持设备 | 模型级别 |
|
||||
|:----------:|:---------:|:------:|:-----:|:-------------------------------------------------:|:-------------------:|
|
||||
|GLM4-32B | 32B | 推理 | Mcore | Atlas 800T A2/Atlas 800I A2/Atlas 900 A3 SuperPoD | [Validated](#模型级别介绍) |
|
||||
|GLM4-9B | 9B | 推理 | Mcore | Atlas 800T A2/Atlas 800I A2/Atlas 900 A3 SuperPoD | [Validated](#模型级别介绍) |
|
||||
|GLM-4-32B | 32B | 推理 | Mcore | Atlas 800T A2/Atlas 800I A2/Atlas 900 A3 SuperPoD | [Validated](#模型级别介绍) |
|
||||
|GLM-4-9B | 9B | 推理 | Mcore | Atlas 800T A2/Atlas 800I A2/Atlas 900 A3 SuperPoD | [Validated](#模型级别介绍) |
|
||||
|
||||
说明:
|
||||
|
||||
@@ -18,15 +18,15 @@ GLM-4 系列模型是专为智能代理设计的基础模型, 其性能可与Ope
|
||||
|
||||
## 版本配套
|
||||
|
||||
GLM4 当前支持的版本配套如下。
|
||||
GLM-4 当前支持的版本配套如下。
|
||||
|
||||
| | Mindspore Transformers | MindSpore | CANN | HDK |
|
||||
| | MindSpore Transformers | MindSpore | CANN | HDK |
|
||||
|:---------:|:----------------------:|:---------:|:----:|:---:|
|
||||
| 当前支持的版本 | 在研版本 | 在研版本 | 在研版本 | 在研版本 |
|
||||
|
||||
## 使用样例
|
||||
|
||||
MindSpore Transformers 支持使用 GLM4 进行推理。各任务的整体使用流程如下:
|
||||
MindSpore Transformers 支持使用 GLM-4 进行推理。各任务的整体使用流程如下:
|
||||
|
||||
| 任务 | 前期准备 | 使用流程 |
|
||||
|:---:|:------------------------|:---------------------------|
|
||||
@@ -69,7 +69,7 @@ parallel_config:
|
||||
- pretrained_model_dir:Hugging Face模型目录路径,放置模型配置、Tokenizer等文件。`/path/hf_dir`中的内容如下:
|
||||
|
||||
```text
|
||||
📂GLM4
|
||||
📂GLM-4
|
||||
├── 📄config.json
|
||||
├── 📄generation_config.json
|
||||
├── 📄merges.txt
|
||||
@@ -192,11 +192,11 @@ Glm4的模型文件包括以下内容:
|
||||
|
||||
```text
|
||||
📦glm4
|
||||
├── 📄__init__.py # glm4模块初始化文件
|
||||
├── 📄configuration_glm4.py # glm4模型配置类定义
|
||||
├── 📄modeling_glm4.py # glm4模型主体实现
|
||||
├── 📄modeling_glm4_infer.py # glm4推理模型实现
|
||||
└── 📄utils.py # glm4工具函数和基础类
|
||||
├── 📄__init__.py # GLM-4模块初始化文件
|
||||
├── 📄configuration_glm4.py # GLM-4模型配置类定义
|
||||
├── 📄modeling_glm4.py # GLM-4模型主体实现
|
||||
├── 📄modeling_glm4_infer.py # GLM-4推理模型实现
|
||||
└── 📄utils.py # GLM-4工具函数和基础类
|
||||
```
|
||||
|
||||
### 并行配置建议
|
||||
@@ -218,7 +218,7 @@ Glm4的模型文件包括以下内容:
|
||||
<th>模型级别</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>GLM4-32B</td>
|
||||
<td>GLM-4-32B</td>
|
||||
<td>32B</td>
|
||||
<td>1 × Atlas 800T A2 (2P)</td>
|
||||
<td>2</td>
|
||||
@@ -235,7 +235,7 @@ Glm4的模型文件包括以下内容:
|
||||
<td> Validated </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>GLM4-9B</td>
|
||||
<td>GLM-4-9B</td>
|
||||
<td>9B</td>
|
||||
<td>1 × Atlas 800T A2 (1P)</td>
|
||||
<td>1</td>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## 模型描述
|
||||
|
||||
GLM-4.5 系列模型是专为智能代理设计的基础模型,基于GLM4采用了MoE结构的变体,也标记为GLM4-MoE。GLM-4.5 总参数 3550 亿,激活参数 320 亿,而 GLM-4.5-Air 采用更紧凑的设计,总参数 1060 亿,激活参数 120 亿。GLM-4.5模型统一了推理、编码和智能体能力,满足智能体应用的复杂需求。
|
||||
GLM-4.5 系列模型是专为智能代理设计的基础模型,基于GLM-4采用了MoE结构的变体,也标记为GLM-4-MoE。GLM-4.5 总参数 3550 亿,激活参数 320 亿,而 GLM-4.5-Air 采用更紧凑的设计,总参数 1060 亿,激活参数 120 亿。GLM-4.5模型统一了推理、编码和智能体能力,满足智能体应用的复杂需求。
|
||||
具体模型能力查看以下技术报告:[GLM-4.5: Reasoning, Coding, and Agentic Abililties](https://z.ai/blog/glm-4.5)
|
||||
|
||||
## 支持规格
|
||||
@@ -21,7 +21,7 @@ GLM-4.5 系列模型是专为智能代理设计的基础模型,基于GLM4采
|
||||
|
||||
GLM-4.5 当前支持的版本配套如下。
|
||||
|
||||
| | Mindspore Transformers | MindSpore | CANN | HDK |
|
||||
| | MindSpore Transformers | MindSpore | CANN | HDK |
|
||||
|:---------:|:----------------------:|:---------:|:----:|:---:|
|
||||
| 当前支持的版本 | 在研版本 | 在研版本 | 在研版本 | 在研版本 |
|
||||
|
||||
@@ -70,7 +70,7 @@ parallel_config:
|
||||
- pretrained_model_dir:Hugging Face模型目录路径,放置模型配置、Tokenizer等文件。`/path/hf_dir`中的内容如下:
|
||||
|
||||
```text
|
||||
📂Glm4.5
|
||||
📂GLM-4.5
|
||||
├── 📄config.json
|
||||
├── 📄generation_config.json
|
||||
├── 📄merges.txt
|
||||
@@ -190,15 +190,15 @@ bash scripts/msrun_launcher.sh "run_mindformer.py \
|
||||
|
||||
### 模型文件说明
|
||||
|
||||
glm4_moe的模型文件包括以下内容:
|
||||
GLM-4-MoE的模型文件包括以下内容:
|
||||
|
||||
```text
|
||||
📦glm4_moe
|
||||
├── 📄__init__.py # glm4_moe模块初始化文件
|
||||
├── 📄configuration_glm4_moe.py # glm4_moe模型配置类定义
|
||||
├── 📄modeling_glm4_moe.py # glm4_moe模型主体实现
|
||||
├── 📄modeling_glm4_moe_infer.py # glm4_moe推理模型实现
|
||||
└── 📄utils.py # glm4_moe工具函数和基础类
|
||||
├── 📄__init__.py # GLM-4-MoE模块初始化文件
|
||||
├── 📄configuration_glm4_moe.py # GLM-4-MoE模型配置类定义
|
||||
├── 📄modeling_glm4_moe.py # GLM-4-MoE模型主体实现
|
||||
├── 📄modeling_glm4_moe_infer.py # GLM-4-MoE推理模型实现
|
||||
└── 📄utils.py # GLM-4-MoE工具函数和基础类
|
||||
```
|
||||
|
||||
### 并行配置建议
|
||||
|
||||
@@ -74,7 +74,7 @@ MindSpore Transformers 提供 `alpaca` 数据集示例处理脚本制作[全参
|
||||
|
||||
| 数据集名称 | 适用模型 | 适用阶段 | 下载链接 |
|
||||
|:-------------|:-------:|:--------:|:------------------------------------------------------------------------------------------:|
|
||||
| alpaca | glm4-9b | Finetune | [Link](https://github.com/tatsu-lab/stanford_alpaca/blob/main/alpaca_data.json) |
|
||||
| alpaca | GLM-4-9B | Finetune | [Link](https://github.com/tatsu-lab/stanford_alpaca/blob/main/alpaca_data.json) |
|
||||
|
||||
数据预处理中所用的 `tokenizer.model` 可以参考[模型权重下载](#模型权重下载)进行下载。
|
||||
|
||||
|
||||
@@ -30,33 +30,33 @@
|
||||
|
||||
以下模型性能均由Atlas 800T A2硬件环境下测试得出。
|
||||
|
||||
TeleChat2-7b:
|
||||
TeleChat2-7B:
|
||||
|
||||
| config | task | Datasets | SeqLength | phase | performance |
|
||||
|:---------------------------------------------------:| :-------------------: |:----------:|:---------:|:---------------:|:------------:|
|
||||
| [TeleChat2_7b](./telechat2-7b/finetune_telechat_7b.yaml) | text_generation | example_dataset | 8192 | [finetune](#微调) | 2950 tokens/s/p |
|
||||
| [TeleChat2_7b](./telechat2-7b/predict_telechat_7b.yaml) | text_generation | example_dataset | 8192 | [predict](#推理) | 54.1 tokens/s |
|
||||
| [TeleChat2_7B](./telechat2-7b/finetune_telechat_7b.yaml) | text_generation | example_dataset | 8192 | [finetune](#微调) | 2950 tokens/s/p |
|
||||
| [TeleChat2_7B](./telechat2-7b/predict_telechat_7b.yaml) | text_generation | example_dataset | 8192 | [predict](#推理) | 54.1 tokens/s |
|
||||
|
||||
TeleChat2-35b:
|
||||
TeleChat2-35B:
|
||||
|
||||
| config | task | Datasets | SeqLength | phase | performance |
|
||||
|-----------------------------------------------------| --------------------- |------------|-----------|-----------------|--------------|
|
||||
| [TeleChat2_35b](./telechat2-35b/finetune_telechat_35b.yaml) | text_generation | example_dataset | 8192 | [finetune](#微调) | 516 tokens/s/p |
|
||||
| [TeleChat2_35b](./telechat2-35b/predict_telechat_35b.yaml) | text_generation | example_dataset | 8192 | [predict](#推理) | 27.7 tokens/s |
|
||||
| [TeleChat2_35B](./telechat2-35b/finetune_telechat_35b.yaml) | text_generation | example_dataset | 8192 | [finetune](#微调) | 516 tokens/s/p |
|
||||
| [TeleChat2_35B](./telechat2-35b/predict_telechat_35b.yaml) | text_generation | example_dataset | 8192 | [predict](#推理) | 27.7 tokens/s |
|
||||
|
||||
TeleChat2-115b:
|
||||
TeleChat2-115B:
|
||||
|
||||
| config | task | Datasets | SeqLength | phase | performance |
|
||||
|-----------------------------------------------------| --------------------- |------------|-----------|-----------------|--------------|
|
||||
| [TeleChat2_115b](./telechat2-115b/finetune_telechat_115b.yaml) | text_generation | example_dataset | 8192 | [finetune](#微调) | 158 tokens/s/p |
|
||||
| [TeleChat2_115b](./telechat2-115b/predict_telechat_115b.yaml) | text_generation | example_dataset | 8192 | [predict](#推理) | 26.5 tokens/s |
|
||||
| [TeleChat2_115B](./telechat2-115b/finetune_telechat_115b.yaml) | text_generation | example_dataset | 8192 | [finetune](#微调) | 158 tokens/s/p |
|
||||
| [TeleChat2_115B](./telechat2-115b/predict_telechat_115b.yaml) | text_generation | example_dataset | 8192 | [predict](#推理) | 26.5 tokens/s |
|
||||
|
||||
TeleChat2-39b-a12b:
|
||||
TeleChat2-39B-A12B:
|
||||
|
||||
| config | task | Datasets | SeqLength | phase | performance |
|
||||
| ------------------------------------------------------------ | --------------- | --------------- | --------- | ---------------- | ------------- |
|
||||
| [TeleChat2_39b_a12b](./telechat2-39b-a12b/finetune_telechat_39b_a12b.yaml) | text_generation | example_dataset | 8192 | [finetune](#微调) | 865 tokens/s/p |
|
||||
| [TeleChat2_39b_a12b](./telechat2-39b-a12b/predict_telechat_39b_a12b_parallel.yaml) | text_generation | example_dataset | 8192 | [predict](#推理) | 36.4 tokens/s |
|
||||
| [TeleChat2_39B_A12B](./telechat2-39b-a12b/finetune_telechat_39b_a12b.yaml) | text_generation | example_dataset | 8192 | [finetune](#微调) | 865 tokens/s/p |
|
||||
| [TeleChat2_39B_A12B](./telechat2-39b-a12b/predict_telechat_39b_a12b_parallel.yaml) | text_generation | example_dataset | 8192 | [predict](#推理) | 36.4 tokens/s |
|
||||
|
||||
## 模型文件
|
||||
|
||||
@@ -149,10 +149,10 @@ MindFormers提供已经转换完成的预训练权重、词表文件用于预训
|
||||
|
||||
1.torch模型权重及词模型下载链接:
|
||||
|
||||
- [TeleChat2-7b](https://modelscope.cn/models/TeleAI/TeleChat2-7B-32K)
|
||||
- [TeleChat2-7B](https://modelscope.cn/models/TeleAI/TeleChat2-7B-32K)
|
||||
- [TeleChat2-39B-A12B](https://modelscope.cn/models/TeleAI/TeleChat2-39B-A12B)
|
||||
- [TeleChat2-35b](https://modelscope.cn/models/TeleAI/TeleChat2-35B)
|
||||
- [TeleChat2-115b](https://modelscope.cn/models/TeleAI/TeleChat2-115B)
|
||||
- [TeleChat2-35B](https://modelscope.cn/models/TeleAI/TeleChat2-35B)
|
||||
- [TeleChat2-115B](https://modelscope.cn/models/TeleAI/TeleChat2-115B)
|
||||
|
||||
下载完成后,运行如下转换脚本,将全量微调的权重转换为完整的ckpt权重。
|
||||
|
||||
@@ -170,10 +170,10 @@ mindspore_path: 权重保存文件名,可以指定自定义保存路径
|
||||
|
||||
2.获取MindFormers提供的已转换权重,可直接从下面的链接获取。
|
||||
|
||||
- [TeleChat2-7b](https://telechat-docker.obs.cn-north-4.myhuaweicloud.com/model_weight/Telechat_7B/Telechat_7B.zip)
|
||||
- [TeleChat2-35b](https://telechat-docker.obs.cn-north-4.myhuaweicloud.com/model_weight/Telechat_35B/Telechat_35B.zip)
|
||||
- [TeleChat2-115b](https://telechat-docker.obs.cn-north-4.myhuaweicloud.com/model_weight/Telechat_115B/Telechat_115B.zip)
|
||||
- [Telechat2-39b-a12b](https://telechat-docker.obs.cn-north-4.myhuaweicloud.com/model_weight/Telechat_39B_A12.tar):仅适用于8卡推理,使用方式请参考[Telechat2-39B-A12B推理](#Telechat2-39B-A12B推理)章节。
|
||||
- [TeleChat2-7B](https://telechat-docker.obs.cn-north-4.myhuaweicloud.com/model_weight/Telechat_7B/Telechat_7B.zip)
|
||||
- [TeleChat2-35B](https://telechat-docker.obs.cn-north-4.myhuaweicloud.com/model_weight/Telechat_35B/Telechat_35B.zip)
|
||||
- [TeleChat2-115B](https://telechat-docker.obs.cn-north-4.myhuaweicloud.com/model_weight/Telechat_115B/Telechat_115B.zip)
|
||||
- [Telechat2-39B-A12B](https://telechat-docker.obs.cn-north-4.myhuaweicloud.com/model_weight/Telechat_39B_A12.tar):仅适用于8卡推理,使用方式请参考[Telechat2-39B-A12B推理](#Telechat2-39B-A12B推理)章节。
|
||||
|
||||
### 分布式权重切分与合并
|
||||
|
||||
@@ -226,7 +226,7 @@ MindFormers提供`TeleChat2-115B`的微调示例,过程中使用中电信人
|
||||
- step 2. 根据服务器节点数等信息,修改相应的配置。
|
||||
|
||||
```yaml
|
||||
# 以telechat-115b模型8机64卡训练为例,默认配置机4096卡,如果节点数有变,需要修改相应的配置。
|
||||
# 以telechat-115B模型8机64卡训练为例,默认配置机4096卡,如果节点数有变,需要修改相应的配置。
|
||||
# 配置文件路径:finetune_telechat_115b.yaml
|
||||
parallel_config:
|
||||
data_parallel: 1
|
||||
|
||||
Reference in New Issue
Block a user