ZeRO-1/2 gradient accumulation: remaining test coverage

Abierto
#8,957 0 comentarios 1 reacción 1 asignado Ver en GitHub

Los mantenedores suelen responder en 2 días

@sfc-gh-truwase ya está trabajando en esto.

Desde el 30/10/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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.
Lenguaje dominante
Python
Estrellas
43.3k
Forks
5.1k
Merge medio
5 d 10 h
PR fusionados (30 d)
85

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de deepspeedai/DeepSpeed

Todos los issues de deepspeedai/DeepSpeed

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.