Clarify safe cross-rank aggregation for MoE forward timing breakdown

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

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

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
python, pytorch

Hướng nghiên cứu

Start by reading DeepSpeedEngine.print_forward_breakdown() and the TODO for cross-rank aggregation, then trace how MoE layers, pipeline stages, and expert-parallel groups are represented. First agree with maintainers on whether to support a limited synchronized topology or redesign collection around per-layer or per-group ownership. Done means implementing the agreed behavior with regression coverage, including multiprocess tests where applicable.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Description

DeepSpeedEngine.print_forward_breakdown() reports forward, MoE gating, MoE execution, and all-to-all timing measurements. Currently, the method prints rank 0's local measurements rather than aggregating timing values across ranks.

The method contains an existing TODO to all-reduce and average these values for more accurate timing.

While investigating a possible implementation, I found that the main challenge is establishing safe collective participation and meaningful aggregation:

  • The method is called only when the local engine has MoE layers, so ranks may not all enter it.
  • Pipeline stages can contain different portions of the model, including stages without MoE layers.
  • The engine stores expert-parallel groups in mappings rather than exposing one unambiguous reduction group for all aggregated timings.
  • The method sums timing measurements across local MoE layers before reporting them, potentially combining layers associated with different expert groups.

An unconditional global reduction could therefore deadlock, while reducing across an incorrectly chosen expert group could produce misleading measurements.

Question for maintainers

What behavior should this enhancement target?

  1. Initially support a clearly defined topology with a common process group and synchronized participation, preserving existing behavior for unsupported configurations; or
  2. Redesign the timing collection to retain per-layer or per-process-group ownership so that aggregation remains meaningful across more complex parallel configurations.

I'm happy to implement the agreed approach and add regression coverage, including multiprocess tests where applicable.

Scope

This issue concerns the correctness and interpretation of MoE timing diagnostics. It does not propose changing model execution or training behavior.

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.