ZeRO-1/2 gradient accumulation: remaining test coverage

Đang mở
#8,957 0 bình luận 1 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@sfc-gh-truwase đang làm issue này rồi.

Từ ngày 30/10/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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.
Ngôn ngữ chính
Python
Star
43.3k
Fork
5.1k
Merge trung bình
5 ngày 10 giờ
Pull request đã merge (30 ngày)
85

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của deepspeedai/DeepSpeed

Tất cả issue của deepspeedai/DeepSpeed

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.