[Bug] DecoupledCheckpointEngine.commit hangs non-writer ranks at dist.barrier() when writer subprocess is dead

未关闭
#9,192 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python, pytorch

调研方向

Start with deepspeed/runtime/checkpoint_engine/decoupled_checkpoint_engine.py, especially commit() and the writer/non-writer handling around self.ckpt_process and dist.barrier(). Trace how a dead writer subprocess can leave non-writer ranks blocked, then implement coordinated error propagation so every rank raises consistently. The issue is done when the two-rank reproduction no longer hangs and all ranks report the writer failure.

由索引模型根据 Issue 内容生成。

描述

Summary

In deepspeed/runtime/checkpoint_engine/decoupled_checkpoint_engine.py:164-186, only designated DP writer ranks create self.ckpt_process (dp_writer_config is not None), while non-writer ranks have self.ckpt_process = None. Inside commit():

if self.ckpt_process is not None:
    if not self._check_process_alive():
        raise RuntimeError(f"[{ENGINE_NAME}] Cannot commit checkpoint: checkpoint process is not running.")
    ...
dist.barrier()

If a writer rank's checkpoint subprocess crashes or times out, the writer rank raises RuntimeError before reaching line 183 while all non-writer ranks proceed directly to dist.barrier() and hang indefinitely.

Affected Location
  • Repository: deepspeedai/DeepSpeed (master, deepspeed/runtime/checkpoint_engine/decoupled_checkpoint_engine.py:164-186)
Minimal Standalone Reproduction

2-rank Gloo group where rank 0's ckpt_process has exited with code 1 and rank 1 has ckpt_process = None:

  • Rank 0 exits with RuntimeError: [DecoupledCheckpointEngine] Cannot commit checkpoint: checkpoint process is not running.
  • Rank 1 hangs indefinitely inside dist.barrier().
Suggested Fix

Propagate writer commit errors across the process group (e.g., via dist.all_reduce on a status flag or dist.broadcast_object_list before/instead of bare dist.barrier()) so all ranks raise uniformly.

主要语言
Python
星标
43.4k
派生
5.1k
平均合并
5 天 10 小时
30 天内合并 PR
85

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

deepspeedai/DeepSpeed 的其他 Issue

查看 deepspeedai/DeepSpeed 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。