Repository navigation
feat: support reentrant checkpoint exclusions - #67
Merged
Merged
Conversation
3 of 5 tasks
DavidFFFan
force-pushed
the
sync/pr-1290
branch
2 times, most recently
from
October 30, 2026 08:56
aabdc9d to
a152a51
Compare
DavidFFFan
force-pushed
the
sync/pr-1290
branch
from
November 7, 2026 03:51
a152a51 to
ded6299
Compare
DavidFFFan
force-pushed
the
sync/pr-1290
branch
2 times, most recently
from
November 7, 2026 08:30
2f560b8 to
7150a3c
Compare
Contributor
Author
|
/retest |
|
Gate trigger failed: please fix the /check-pr findings and obtain the |
Contributor
Author
|
/check-pr |
DavidFFFan
force-pushed
the
sync/pr-1290
branch
from
November 7, 2026 09:25
7150a3c to
f9f5917
Compare
Contributor
Author
|
/check-pr |
Contributor
Author
|
/retest |
|
Gate trigger failed: please fix the /check-pr findings and obtain the |
Contributor
Author
|
/retest |
|
|
@DavidFFFan, your gate pipeline failed at the code check stage. You can configure some code check tools locally following the (pre-push quick guide), to enable automatic checking when you push your code every time. Tools included are: Check_CMakelint, Check_Codespell, Check_Cpplint, Check_Lizard, Check_Pylint, Check_ClangFormat, Check_ShellCheck. |
DavidFFFan
force-pushed
the
sync/pr-1290
branch
from
November 7, 2026 11:16
f9f5917 to
8c53c14
Compare
Contributor
Author
|
/check-pr |
Contributor
Author
|
/retest |
|
|
DavidFFFan
force-pushed
the
sync/pr-1290
branch
from
November 8, 2026 14:34
8c53c14 to
cab0f2d
Compare
Contributor
Author
|
/retest |
|
|
yangzhenzhang02
approved these changes
Nov 9, 2026
Contributor
Author
|
/check-pr |
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.
What changed
Build Torch eager reentrant checkpointing on top of #1348's exclude-swap change. The branch has two commits in merge order: the cherry-picked #1348 commit, followed by our reentrant integration. #1348 remains a separate PR and is expected to merge first.
saved_tensors_hookscontext. Only excluded regions record a small local autograd graph; their forward operators run once, and replay reuses cached outputs.AccumulateGradnodes or per-tensor input gradient hooks. Saved input aliases/views are reconstructed from replay inputs; other required tensors can use feat: checkpoint_exclude_swap #1348's optional swap hooks. Excluded outputs are always cached and can be registered with the swap group.use_reentrant=Trueentry points, and share prefire/session cleanup APIs with non-reentrant checkpoints.checkpoint_exclude_wrapper(module, swap=False, group_swap=False, cpu_pool=None)interface and add an eight-card-budget grouped NPU test launcher.Scope and limitations
Excluded outputs are always cached; there is no
save_outputswitch. The eager reentrant checkpoint itself does not supporttorch.compile,policy_fn, checkpoint-input swap, non-defaultearly_stop, higher-order differentiation, or nested reentrant checkpoints. The exclude wrapper'sswap,group_swap, andcpu_pooloptions are separate and supported. Ordinary unscopedautograd.gradcannot guarantee that captured parameter gradients are filtered by its requested targets; use non-reentrant checkpointing when that contract is needed. PP dx/dw split combined with FSDP/HSDP, and PPretain_backward_graph=True, remain unsupported; ordinary FSDP backward is supported. The same-rank stage-backed swap/split test does not establish cross-rank PP+swap ordering or transfer-failure recovery.Validation
torch-npuactivated on this checkout; relevant CPU UT: 830 passed, 1 skipped, 1 xfailed (activation memory, pipeline, auto-model checkpoint, and fully-shard).git diff --check, and agent documentation catalog check passed.Fixes #1172.