Repository navigation
[WIP] refactor: unify pretrain entry for GPT model - #243
Open
Chamberlain0w0 wants to merge 2 commits into
Open
Chamberlain0w0 wants to merge 2 commits into
Chamberlain0w0 wants to merge 2 commits into
Conversation
Chamberlain0w0
force-pushed
the
refactor/pretrain-gpt
branch
from
October 28, 2026 06:53
c427202 to
09fb800
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GPT-2、LLaMA3、Qwen3 和 Mixtral 的入口包含大量重复的训练逻辑。本次将公共训练生命周期收敛到
infini_train::training::Pretrain(),由example/pretrain_gpt.cc统一组装模型、数据和 forward/loss 回调。train.flags提供运行预设。保留四个命名 executable,并支持命令行覆盖参数。FinalizeModelGrads()完成梯度同步;MoE 根据模型配置处理未命中专家及 EP/EDP 通信。验证覆盖四模型 CPU/CUDA、命名入口与统一入口、recompute、checkpoint 恢复,以及 dense 模型的 DP/TP/SP/PP/VPP。Mixtral 的 DP、EP、EP+EDP 数值对照通过,PP/VPP/EP+PP 完成训练,EP+ZeRO 0/1/2 与 master 原训练逻辑结果一致。