allenai / allenai/OLMo-core

BeakerCallback fails without the [beaker] extra: olmo_core.launch.beaker imports gantry at module top

Aberta
#850 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
1.5k
Forks
315
Merge médio
1d 9h
PRs com merge (30d)
11

Descrição

**Rev:** observed on `vision` @ `c54d228`, but the import structure looks the same on `main`.

`BeakerCallback.post_attach` does `from olmo_core.launch.beaker import is_running_in_beaker_batch_job`, and `olmo_core/launch/beaker.py` imports `from gantry.api import GitRepoState` at module top. When ai2-olmo-core is installed without the `[beaker]` extra (which declares `beaker-gantry`), attaching the callback in a Beaker batch job crashes:

```
ModuleNotFoundError: No module named 'gantry'
File "olmo_core/train/callbacks/beaker.py", line 49, in post_attach
from olmo_core.launch.beaker import is_running_in_beaker_batch_job
File "olmo_core/launch/beaker.py", line 25, in
from gantry.api import GitRepoState
```

The failure only manifests at trainer attach time inside an actual Beaker job, so it passes local tests and only dies in production.

**Suggested fixes:** guard the gantry import (the callback's description updates via `gantry.api.update_workload_description` could raise a clear "install ai2-olmo-core[beaker]" error or degrade to a no-op), or move `is_running_in_beaker_batch_job` somewhere gantry-free.

Found while reusing OLMo-core-native callbacks in allenai/open-instruct (open-instruct#1856).

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Read olmo_core/train/callbacks/beaker.py at post_attach and olmo_core/launch/beaker.py around the top-level gantry import and is_running_in_beaker_batch_job. Reproduce the callback attachment with ai2-olmo-core installed without the [beaker] extra, then verify that a Beaker job no longer fails with ModuleNotFoundError and that missing gantry produces the selected clear error or no-op behavior.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
python
Domínio
infrastructure
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Ativa
Clareza
Razoavelmente clara
Facilidade para iniciantes
68/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.