Skip to content

fix(checkpointing): remove identical if/else arms and leftover debug print in WriterFactory - #8446

Open
simpleqt wants to merge 1 commit into
deepspeedai:masterfrom
simpleqt:fix/writer-factory-dead-branch
Open

fix(checkpointing): remove identical if/else arms and leftover debug print in WriterFactory#8446
simpleqt wants to merge 1 commit into
deepspeedai:masterfrom
simpleqt:fix/writer-factory-dead-branch

Conversation

@simpleqt

@simpleqt simpleqt commented Sep 6, 2026

Copy link
Copy Markdown

In deepspeed/runtime/model_checkpointing/writer_factory.py:

  1. The pure_dp if/else computed the byte-identical expression in both arms (AST-verified) — collapsed to a single assignment.
  2. Removed an unconditional print(f'WriterFactory: …') debug line that was dumped to stdout of every user process constructing the fast checkpoint writer (deepspeed/runtime/checkpoint_engine/fast_checkpoint_engine.py).

Checklist

  • python -m py_compile passes on the touched file
  • No behavior change beyond removing stdout noise

Signed-off-by: simpleqt 89645338+simpleqt@users.noreply.github.com

Copilot AI lite review requested due to automatic review settings September 6, 2026 17:35

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@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: 9324cc49e6

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 34 to 35
print(
f'WriterFactory: self._data_parallel_writer={self._data_parallel_writer} self._show_statistics={self._show_statistics}'
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove the now-empty print call

Every CheckpointWriterFactory construction still executes print(), so distributed checkpoint runs now emit one blank line per participating process. This leaves the debug side effect in place (and can pollute machine-readable stdout or logs); delete the call itself rather than only its argument.

Useful? React with 👍 / 👎.

…print in WriterFactory

Both arms of the pure_dp conditional computed the same expression
(AST-verified), and the constructor unconditionally printed a debug
line to stdout of every user process that enables the fast checkpoint
writer. Collapsed the conditional and removed the print.

Signed-off-by: simpleqt <89645338+simpleqt@users.noreply.github.com>
@simpleqt
simpleqt force-pushed the fix/writer-factory-dead-branch branch from 9324cc4 to 9d74c0e Compare September 6, 2026 19:39
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