ZeRO-1/2 gradient accumulation: remaining test coverage

Aperta
#8,957 0 commenti 1 reazione 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@sfc-gh-truwase ci sta già lavorando.

Dal 30/10/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.
Lingua principale
Python
Stelle
43.3k
Fork
5.1k
Merge medio
5g 10h
PR unite (30g)
85

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di deepspeedai/DeepSpeed

Tutte le issue di deepspeedai/DeepSpeed

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.