Clarify safe cross-rank aggregation for MoE forward timing breakdown

Abierto
#8,863 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Activo
Stack tecnológico
python, pytorch

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
43.4k
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.