Skip to content

Z3: Support for activation ckpt with frozen params#8148

Open
sfc-gh-truwase wants to merge 6 commits into
masterfrom
sfc-gh-truwase/ds_8130
Open

Z3: Support for activation ckpt with frozen params#8148
sfc-gh-truwase wants to merge 6 commits into
masterfrom
sfc-gh-truwase/ds_8130

Conversation

@sfc-gh-truwase

Copy link
Copy Markdown
Collaborator

Build on #8130

@sfc-gh-truwase
sfc-gh-truwase requested a review from tohtana July 16, 2026 22:00
@sfc-gh-truwase
sfc-gh-truwase requested a review from tjruwase as a code owner July 16, 2026 22:00
@sfc-gh-truwase sfc-gh-truwase changed the title Sfc gh truwase/ds 8130 Z3: Support for activation ckpt with frozen params Jul 16, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a77470bf0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread deepspeed/runtime/zero/partitioned_param_coordinator.py Outdated
Comment thread deepspeed/runtime/zero/partitioned_param_coordinator.py
Comment thread deepspeed/runtime/zero/parameter_offload.py Outdated
Comment thread deepspeed/runtime/zero/partitioned_param_coordinator.py Outdated
Signed-off-by: Olatunji Ruwase <tunji.ruwase@snowflake.com>
Signed-off-by: Olatunji Ruwase <tunji.ruwase@snowflake.com>
Signed-off-by: tunji-ruwase_snow <tunji.ruwase@snowflake.com>
Signed-off-by: tunji-ruwase_snow <tunji.ruwase@snowflake.com>
@sfc-gh-truwase
sfc-gh-truwase force-pushed the sfc-gh-truwase/ds_8130 branch from 29c461f to e72bfd0 Compare July 16, 2026 22:42
sfc-gh-truwase and others added 2 commits July 16, 2026 23:48
Signed-off-by: tunji-ruwase_snow <tunji.ruwase@snowflake.com>
- Release no-grad-input leftovers each microbatch via a coordinator sweep
  in stage3 backward_epilogue (params whose post-backward hook never fires).
- Key active-backward submodules by ds_id (dict, not LIFO deque) so a
  multi-tensor z3-leaf module releases regardless of hook ordering.
- Extend user-backward unit tests; drop the two prior xfail markers.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sfc-gh-truwase
sfc-gh-truwase requested a review from loadams as a code owner July 18, 2026 13:05
@tohtana

tohtana commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Hi @sfc-gh-truwase,

Great PR, this one is much simpler than my previous attempt.

I tested this PR against several ZeRO-3 activation-checkpoint lifecycle cases. The following two checks failed. In both failed cases, a recomputed frozen parameter remained gathered beyond its final use. The difference is whether that parameter has a backward consumer:

These failures show that the weights remain gathered beyond their final use at the observed point in backward. Actually, my previous attempt only solves the first one.
If it is hard to resolve these, I think we can raise an explict error to catch these cases rather than blocking this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants