Clarify safe cross-rank aggregation for MoE forward timing breakdown

オープン
#8,863 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
活発
技術スタック
python, pytorch

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
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 を短くまとめたダイジェスト。