Use GLM-5.2 tokenizer vocabulary
This commit is contained in:
11
README.md
11
README.md
@@ -25,6 +25,17 @@
|
||||
|
||||
验证集为 2,800 条,七个能力维度各 400 条:science_reasoning、logic、code、chinese_exam、math、chinese_dialogue、english_dialogue。它会用于预训练过程中的 accuracy、perplexity 和 nll 评估。
|
||||
|
||||
|
||||
## Tokenizer 设计
|
||||
|
||||
为了兼容 GLM-5.2 生态,本模型的 tokenizer/vocab 直接采用 GLM-5.2 同款词表,而不是旧 Laoyao 65K BPE。当前 g0033 上的引用路径是:
|
||||
|
||||
```bash
|
||||
/mnt/tmp/yi/data/tokenizer/tokenizer.json
|
||||
```
|
||||
|
||||
该 tokenizer 当前解析出的 vocab size 为 151,643。后续训练数据应按这个 tokenizer 重新统计/切分 token budget。
|
||||
|
||||
## g0033 路径约定
|
||||
|
||||
repo 路径:
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
- experts: 12
|
||||
- active experts/top-k: 4
|
||||
- expert FFN hidden size 6144
|
||||
- tokenizer: laoyaomodel bytes BPE, vocab size约 65K
|
||||
- tokenizer: GLM-5.2 同款 tokenizer/vocab,当前 g0033 引用路径 `/mnt/tmp/yi/data/tokenizer/tokenizer.json`,vocab size 151,643
|
||||
|
||||
关键改动是强制专家负载均衡:router aux loss、z-loss、capacity factor 和 router bias update 都必须显式配置,避免旧实验中专家负载失衡。
|
||||
|
||||
## Tokenizer 兼容策略
|
||||
|
||||
为了兼容后续 GLM-5.2 风格服务、SFT 数据和推理工具链,本模型不再使用 Jiayi 旧工程的 65K `laoyaomodel.bytes_bpe` tokenizer。模型词表直接设计为 GLM-5.2 同款 tokenizer JSON 和 token-id vocab。这样做的代价是 embedding/output head 参数量上升,但可以避免后续 tokenizer swap、数据重切和推理侧 token id 不一致的问题。
|
||||
|
||||
@@ -3,3 +3,7 @@
|
||||
`laoyao_2b_moe_nemo_megatron.yaml` 是目标架构配置。它不是旧 hand-written trainer 的 Python 模型定义,而是供 NeMo/Megatron/Megatron-Bridge 迁移使用的结构化配置。
|
||||
|
||||
后续需要根据实际使用的 NeMo 版本,把字段名映射到对应 launcher schema;当前文件保留了架构语义和所有关键 MoE/负载均衡超参。
|
||||
|
||||
## Tokenizer
|
||||
|
||||
配置中的 tokenizer 目标是 GLM-5.2 同款 vocab。当前配置写死 g0033 上 `/mnt/tmp/yi/data/tokenizer/tokenizer.json`,vocab size 151,643。NeMo/Megatron launcher 接线时,需要确保 embedding size、output projection 和 tokenizer loader 都使用这一份 vocab。
|
||||
|
||||
@@ -3,9 +3,11 @@ model:
|
||||
architecture: decoder_only_moe
|
||||
library_target: nemo_megatron
|
||||
tokenizer:
|
||||
library: laoyaomodel.bytes_bpe
|
||||
path: /mnt/beegfs/yi/laoyao_moe_rebalanced/tokenizers/pretrain-mix-code40-text60-bpe-65k-20260623/tokenizer.json
|
||||
vocab_size: 65536
|
||||
library: huggingface_tokenizers
|
||||
compatibility_target: GLM-5.2
|
||||
path: /mnt/tmp/yi/data/tokenizer/tokenizer.json
|
||||
vocab_size: 151643
|
||||
design_note: use the same tokenizer JSON and token-id vocabulary as GLM-5.2 for serving/SFT compatibility
|
||||
|
||||
# Derived from laoyaomodel preset: 2b-moe-active0.9b-balanced.
|
||||
num_layers: 12
|
||||
|
||||
Reference in New Issue
Block a user