Files
laoyao_2b_moe/model/README.md
T

23 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Model
本目录存放模型定义。迁移目标是使用 NeMo/Megatron 配置表达模型,而不是继续维护旧的手写 PyTorch 模型定义。
当前目标 preset 来自旧工程的 `2b-moe-active0.9b-balanced`
- 12 transformer layers
- hidden size 1536
- attention heads 24
- grouped-query attention kv heads 4
- dense FFN hidden size 4608
- MoE layers: 2, 4, 6, 8, 10
- experts: 12
- active experts/top-k: 4
- expert FFN hidden size 6144
- 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 不一致的问题。