Skip to content

Z3: Support for activation ckpt with frozen params#8148

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

Z3: Support for activation ckpt with frozen params#8148
sfc-gh-truwase wants to merge 9 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
@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
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.

@sfc-gh-truwase

Copy link
Copy Markdown
Collaborator Author

@tohtana thanks for the reviewing, extended testing, and reporting limitations of the PR. For the two failing cases,

  1. How can I integrate those UTs into my branch for investigation? Can you push into my branch?
  2. I agree with temporary explicit asserts for those cases. What is the easiest way to detect these conditions? Or is it better to use XFAILs in the UTs?

@sfc-gh-truwase

Copy link
Copy Markdown
Collaborator Author

@tohtana, I have used AI to integrate your UTs as XFAILs. Do you think we still need explicit asserts in zero3 code?

sfc-gh-truwase and others added 7 commits July 20, 2026 15:16
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: Olatunji Ruwase <tunji.ruwase@snowflake.com>
Signed-off-by: tunji-ruwase_snow <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: Olatunji Ruwase <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>
Signed-off-by: Olatunji Ruwase <tunji.ruwase@snowflake.com>
Signed-off-by: Olatunji Ruwase <tunji.ruwase@snowflake.com>
@sfc-gh-truwase
sfc-gh-truwase force-pushed the sfc-gh-truwase/ds_8130 branch from eb7a3f8 to 335e93d Compare July 20, 2026 15:34
sfc-gh-truwase and others added 2 commits July 20, 2026 15:40
The _dump_params / _dump_param_ids fetch traces were emitting on every
forward/backward step; make them opt-in like the other coordinator debug logs.

Signed-off-by: Olatunji Ruwase <tunji.ruwase@snowflake.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: tunji-ruwase_snow <tunji.ruwase@snowflake.com>
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