ZeRO-1/2 gradient accumulation: remaining test coverage

オープン
#8,957 コメント 0 件 リアクション 1 件 担当者 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時間
マージ済み PR(30日)
85

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

deepspeedai/DeepSpeed のほかの issue

deepspeedai/DeepSpeed の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。