_LOAD_BALANCING_LOSS returns empty list sometimes
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- python
- Área
- machine-learning
Línea de trabajo
Comienza por las líneas enlazadas de megablocks/layers/moe.py y luego sigue el llamador mostrado en savanna/training.py, especialmente mb_moe_loss_func. Reproduce los casos expert_interval=2 y expert_interval=1 y compara el número de capas con las entradas de loss; se considera terminado cuando la discrepancia y el _LOAD_BALANCING_LOSS vacío de forma intermitente tienen una causa raíz documentada y una prueba de regresión o un fix claramente delimitado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hello, I am using Eleuther AI's gpt-neox implementation with megablocks, but I get 2 errors related to the _LOAD_BALANCING_LOSS.
- the
tokens_per_expertgives me this error at this line.ValueError: Expected 14 token_per_experts but found 7.Here's the stack trace.
File "/home/etnguyen/test/savanna/train.py", line 10, in <module> [53/1963]
pretrain(global_config=global_config)
File "/home/etnguyen/test/savanna/savanna/training.py", line 228, in pretrain
iteration = train(
^^^^^^
File "/home/etnguyen/test/savanna/savanna/training.py", line 1004, in train
loss_dict, skipped_iter = train_step(
^^^^^^^^^^^
File "/home/etnguyen/test/savanna/savanna/training.py", line 919, in train_step
loss = forward_step(
^^^^^^^^^^^^^
File "/home/etnguyen/test/savanna/savanna/training.py", line 515, in forward_step
moe_loss = mb_moe_loss_func(global_config, loss_mask, outputs)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/etnguyen/test/savanna/savanna/training.py", line 464, in mb_moe_loss_func
lbl = moe.batched_load_balancing_loss(megablocks_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/etnguyen/.local/lib/python3.11/site-packages/megablocks/layers/moe.py", line 43, in batched_load_balancing_loss
raise ValueError(
ValueError: Expected 14 token_per_experts but found 7.
num_layers = 14
pipeline_model_parallel_size = 1
num_layers_per_virtual_pipeline_stage = None
I get this error when the expert_interval=2, ie when the default value is used, and so the number of experts is actually half the number of layers (14 layers, 7 Megablocks layers used). This error gets fixed when I set the expert_interval=1 so that there are 14 Megablocks, and 14 layers. But I don't know the root cause of this discrepancy, especially if I want to change the expert_interval and number of Megablocks to every other layer.
- The second issue is, let's say I do use
expert_interval=1to get around the issue above, so every layer uses a Megablock, then my next error I get is that the return value of get_load_balancing_loss occasionally returns an empty list, which then errors out, meaning the_LOAD_BALANCING_LOSSis an empty list. Critically, this happens part way through training, like 30 secs in, so some batches it's fine and returns the expected losses.
Does this sound familiar to anybody? I'd very much appreciate any insights, thank you!
- Lenguaje dominante
- Python
- Estrellas
- 1.6k
- Forks
- 228
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
microsoft/agent-lightning#661 ·
Los mantenedores suelen responder en 2 días
-
area/profiles comp/cli P3 type/feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
NousResearch/hermes-agent#146372 ·
Los mantenedores suelen responder en 1 día
-
[BUG] OpenAI-compatible embedding model alias breaks embedder constructionPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
[oblt-aw][autodoc] Document obs-aw-automerge contract and fix automerge doc inconsistenciesPosiblemente ocupada @github-actions la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
GeoSeries scale and skew tests fail with pytest 9.2.0Posiblemente ocupada @jiayuasu la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día