ZeRO-1/2 gradient accumulation: remaining test coverage

未关闭
#8,957 0 条评论 1 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 2 天内回复

@sfc-gh-truwase 已经在做这个了。

开始于 2026年10月30日。

评估

这个 Issue 还没有评估数据。

描述

build training

Context

Follow-up to the ZeRO-1/2 request-boundary gradient work in #8949.

The local fix keeps non-offload gradients until step(), records norm and overflow for every reduced parameter, mirrors and resets the compact FP32 partition, uses ZenFlow overlap_grad, and clears retained state from zero_grad(). The checks below are still missing. Existing tests either call optimizer helpers on a partial object, set only one accumulation boundary, or compare CPU offload against the non-offload path.

Test gaps

  • End-to-end run with several set_gradient_accumulation_boundary(True) calls before one step(), compared with an independent summed-loss reference. test_multi_backward_matches_no_offload uses the sibling path as the oracle and only one boundary.
  • Two-parameter late first use, with source_offset > 0 and partition padding.
  • Compact FP32 accumulation (grad_accum_dtype=fp32) after overflow, then a later finite window, asserting gradient equality.
  • Clipping and Inf detection for a parameter used only on a non-boundary microbatch.
  • Multi-rank split parameters.
  • Fractional BF16/FP16 values so the master-dtype conversion is visible. Current fills are integers.
  • End-to-end reentrant checkpointing and managed_gradient_accumulation=false.
  • overlap_comm stream ordering for the synchronous host copy, and a ZenFlow overlap_step training loop. The current ZenFlow check uses a partial optimizer.
  • Direct gradient equality in test_zero_cpu_offload_grad_accum.py. That test only checks that the host-partition norm changes.
  • GPU run of test_cuda_oversized_producer_handoff. It is skipped under DS_ACCELERATOR=cpu.
主要语言
Python
星标
43.3k
派生
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 摘要。