[QUESTION] How does veScale FSDP handles 2D FP8 blockwise scaling for RaggedShard

Abierto
#73 1 comentario 3 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

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

Línea de trabajo

This is a design question about how veScale FSDP shards FP8 weights for the DeepSeek blockwise recipe, not a scoped change. Start by reading the RaggedShard/FSDP parameter sharding path and wherever the FP8 blockwise scaling is applied, then compare it with the to_blocked_128x128 helper quoted in the issue to see whether the permutation happens before sharding, after the all-gather, or not at all. Done means an explanation of whether the permute/unpermute round-trip is required around the AG and how a regular FP8 GEMM is launched on the result — ideally recorded as a doc or comment so the next reader does not have to ask.

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

Descripción

For deepseek FP8 blockwise recipe, the scaling block size for weights is 128x128. Having 2D block scaling means sharding by blocks will make memory incontiguous. Does it mean that we have to go through the following function to "permute" the original [N, K] weight tensor. And then after the parameter AG, do we also need to "unpermute" it such that we can launch a regular FP8 GEMM?

def to_blocked_128x128(a: torch.Tensor) -> torch.Tensor:
    N, K = a.shape
    return a.view(N//128, 128, K//128, 128).permute(0, 2, 1, 3).contiguous()
Image
Lenguaje dominante
Python
Estrellas
1k
Forks
65
Merge medio
21 h 34 min
PR fusionados (30 d)
1

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 volcengine/veScale

Todos los issues de volcengine/veScale

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.