Feat/checkpoint resharding - #196
Open
JYMiracle305 wants to merge 3 commits into
Open
Conversation
JYMiracle305
force-pushed
the
feat/checkpoint_resharding
branch
3 times, most recently
from
August 3, 2026 10:17
5153a9e to
a3f6181
Compare
JYMiracle305
changed the base branch from
master
to
feat/checkpoint-consumed-micro-batches
August 3, 2026 10:17
JYMiracle305
force-pushed
the
feat/checkpoint-consumed-micro-batches
branch
from
August 4, 2026 07:43
57ab888 to
7689011
Compare
JYMiracle305
force-pushed
the
feat/checkpoint_resharding
branch
2 times, most recently
from
August 6, 2026 07:13
e0540b5 to
c85e813
Compare
JYMiracle305
changed the base branch from
feat/checkpoint-consumed-micro-batches
to
feat/checkpoint-optimizer-state-control
August 6, 2026 07:16
JYMiracle305
force-pushed
the
feat/checkpoint_resharding
branch
from
August 6, 2026 07:19
c85e813 to
7028203
Compare
JYMiracle305
force-pushed
the
feat/checkpoint-optimizer-state-control
branch
from
August 6, 2026 08:12
5514a0b to
cf3cce5
Compare
JYMiracle305
force-pushed
the
feat/checkpoint_resharding
branch
from
August 6, 2026 08:12
7028203 to
8e4012b
Compare
JYMiracle305
changed the base branch from
feat/checkpoint-optimizer-state-control
to
feat/checkpoint-consumed-micro-batches
August 6, 2026 08:14
JYMiracle305
changed the base branch from
feat/checkpoint-consumed-micro-batches
to
feat/checkpoint-optimizer-state-control
August 6, 2026 08:16
JYMiracle305
changed the base branch from
feat/checkpoint-optimizer-state-control
to
feat/checkpoint-consumed-micro-batches
August 6, 2026 08:17
JYMiracle305
force-pushed
the
feat/checkpoint_resharding
branch
from
August 6, 2026 08:44
8e4012b to
83a73ee
Compare
JYMiracle305
force-pushed
the
feat/checkpoint-consumed-micro-batches
branch
from
August 6, 2026 08:44
59a9674 to
9d99035
Compare
JYMiracle305
force-pushed
the
feat/checkpoint_resharding
branch
from
August 6, 2026 09:47
83a73ee to
57bc905
Compare
JYMiracle305
force-pushed
the
feat/checkpoint-consumed-micro-batches
branch
from
August 6, 2026 09:47
9d99035 to
862a378
Compare
kilinchange
force-pushed
the
feat/checkpoint-consumed-micro-batches
branch
from
August 7, 2026 02:18
862a378 to
f6f4715
Compare
kilinchange
force-pushed
the
feat/checkpoint_resharding
branch
from
August 7, 2026 02:18
57bc905 to
9928ff2
Compare
JYMiracle305
force-pushed
the
feat/checkpoint-consumed-micro-batches
branch
from
August 12, 2026 01:37
f6f4715 to
9d30401
Compare
JYMiracle305
force-pushed
the
feat/checkpoint_resharding
branch
5 times, most recently
from
August 12, 2026 08:27
845f617 to
8ba9890
Compare
JYMiracle305
force-pushed
the
feat/checkpoint-consumed-micro-batches
branch
from
August 12, 2026 14:55
9d30401 to
6799ce4
Compare
JYMiracle305
force-pushed
the
feat/checkpoint_resharding
branch
2 times, most recently
from
August 14, 2026 09:19
d64951e to
770fc02
Compare
JYMiracle305
force-pushed
the
feat/checkpoint-consumed-micro-batches
branch
from
August 14, 2026 09:20
6799ce4 to
9d406c9
Compare
JYMiracle305
force-pushed
the
feat/checkpoint-consumed-micro-batches
branch
from
August 14, 2026 09:35
9d406c9 to
86aefcd
Compare
JYMiracle305
force-pushed
the
feat/checkpoint_resharding
branch
from
August 14, 2026 09:35
770fc02 to
8a3ddc2
Compare
JYMiracle305
force-pushed
the
feat/checkpoint-consumed-micro-batches
branch
from
August 20, 2026 08:56
86aefcd to
48ca7e4
Compare
JYMiracle305
force-pushed
the
feat/checkpoint_resharding
branch
from
August 20, 2026 08:56
8a3ddc2 to
340c458
Compare
JYMiracle305
force-pushed
the
feat/checkpoint_resharding
branch
from
August 25, 2026 03:24
340c458 to
32b6d48
Compare
JYMiracle305
changed the base branch from
feat/checkpoint-consumed-micro-batches
to
fix/adam-fp32-state
August 25, 2026 03:34
JYMiracle305
force-pushed
the
feat/checkpoint_resharding
branch
from
August 26, 2026 08:09
32b6d48 to
fb9fc5f
Compare
JYMiracle305
force-pushed
the
fix/adam-fp32-state
branch
from
August 26, 2026 08:09
8323452 to
b66c25c
Compare
kilinchange
force-pushed
the
fix/adam-fp32-state
branch
from
August 26, 2026 08:15
b66c25c to
82a301e
Compare
kilinchange
force-pushed
the
feat/checkpoint_resharding
branch
from
August 26, 2026 08:15
fb9fc5f to
31e9655
Compare
JYMiracle305
force-pushed
the
feat/checkpoint_resharding
branch
from
August 27, 2026 01:33
31e9655 to
40e28ec
Compare
JYMiracle305
force-pushed
the
feat/checkpoint_resharding
branch
2 times, most recently
from
August 27, 2026 06:14
7f25f0a to
3328359
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.
背景
现有 distributed checkpoint 与保存时的 TP/PP 拓扑绑定,恢复训练时要求使用相同的并行配置。本 PR 引入基于全局张量坐标的 checkpoint resharding,使 checkpoint 可以在不同 TP/PP 配置之间恢复。
设计文档:Checkpoint Resharding 设计
主要修改
ShardedTensor/ShardedStateDict,描述张量的全局形状、本地分片、全局偏移和切分方式。SavePlanner,统一规划模型参数和 Adam optimizer state 的本地写入布局,并生成可用于 reshard 的全局 metadata。LoadPlanner,根据源 checkpoint 与当前目标拓扑的分片坐标计算重叠区间。IndexedRegionLoadStrategy,按 metadata 中的文件和 offset 直接读取所需区域,在加载阶段完成重组,无需预先生成中间 checkpoint。m/v共用参数分片信息,训练状态和 LR scheduler 状态随 checkpoint 一并恢复。dp_rank=0的 TP/PP ranks 写入 shard,并在所有 rank metadata 就绪后原子发布全局 metadata。当前限制
segments表达。DistributedOptimizer/ ZeRO optimizer state 的保存和恢复。测试