Skip to content

Commit c090a30

Browse files
authored
Merge branch 'main' into checkpoint-policy-refactor-v2
2 parents 66c9826 + d0b2e7f commit c090a30

File tree

14 files changed

+31
-72
lines changed

14 files changed

+31
-72
lines changed

.github/actions/setup-environment/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ runs:
5454
- name: Set up nim
5555
shell: bash
5656
run: |
57-
curl -L -o nimby https://github.com/treeform/nimby/releases/download/0.1.6/nimby-Linux-X64
57+
curl -L -o nimby https://github.com/treeform/nimby/releases/latest/download/nimby-Linux-X64
5858
chmod +x nimby
5959
./nimby use 2.2.6
6060
echo "$HOME/.nimby/nim/bin" >> "$GITHUB_PATH"

.importlinter

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ root_packages =
1818
metta.cogworks
1919
metta.adaptive
2020
metta.map
21-
metta.utils
2221
metta.common
2322
metta.app_backend
2423
cogames
@@ -41,7 +40,6 @@ layers =
4140
metta.cogworks
4241
metta.adaptive
4342
metta.map
44-
metta.utils
4543
metta.common
4644
# Known violations to fix over time (remove as they get fixed)
4745
ignore_imports =
@@ -50,8 +48,6 @@ ignore_imports =
5048
metta.gridworks.** -> metta.tools.**
5149
metta.rl.** -> metta.tools.**
5250
metta.rl.** -> metta.sim.**
53-
metta.utils.** -> metta.adaptive.**
54-
metta.common.** -> metta.utils.**
5551
metta.common.** -> metta.rl.**
5652

5753
[importlinter:contract:cogames-independence]
@@ -102,5 +98,4 @@ forbidden_modules =
10298
ignore_imports =
10399
metta.common.** -> metta.common.**
104100
# Tech debt - remove as violations are fixed:
105-
metta.common.** -> metta.utils.**
106101
metta.common.** -> metta.rl.**

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ graph TD
154154
cogworks[cogworks]
155155
adaptive[adaptive]
156156
map[map]
157-
utils[utils]
158157
common[common]
159158
tools --> gridworks
160159
gridworks --> setup
@@ -164,8 +163,7 @@ graph TD
164163
sweep --> cogworks
165164
cogworks --> adaptive
166165
adaptive --> map
167-
map --> utils
168-
utils --> common
166+
map --> common
169167
```
170168

171169
<!-- FOLDER_DIAGRAM_END -->

common/src/metta/common/tool/run_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from rich.console import Console
2727
from typing_extensions import TypeVar
2828

29-
import metta.utils.torch_init # noqa: F401
29+
import metta.rl.torch_init # noqa: F401
3030
from metta.common.tool import Tool
3131
from metta.common.tool.recipe_registry import recipe_registry
3232
from metta.common.tool.schema import get_pydantic_field_info
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
- Default: fetch 50 runs, display 10 most recent
1616
1717
Usage:
18-
./metta/util/live_run_monitor.py --group my_group_name
19-
./metta/util/live_run_monitor.py --name-filter "axel.*"
20-
./metta/util/live_run_monitor.py --group my_group --name-filter "experiment.*"
21-
./metta/util/live_run_monitor.py --refresh 15 --entity myteam --project myproject
22-
./metta/util/live_run_monitor.py --fetch-limit 100 --display-limit 20
23-
./metta/util/live_run_monitor.py # Monitor last 10 runs (fetch 50, display 10)
18+
metta run-monitor --group my_group_name
19+
metta run-monitor --name-filter "axel.*"
20+
metta run-monitor --group my_group --name-filter "experiment.*"
21+
metta run-monitor --refresh 15 --entity myteam --project myproject
22+
metta run-monitor --fetch-limit 100 --display-limit 20
23+
metta run-monitor # Monitor last 10 runs (fetch 50, display 10)
2424
"""
2525

2626
import logging

metta/setup/metta_cli.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
from metta.setup.tools.test_runner.test_nim import app as nim_test_runner_app
3636
from metta.setup.tools.test_runner.test_python import app as python_test_runner_app
3737
from metta.setup.utils import debug, error, info, success, warning
38-
from metta.utils.live_run_monitor import app as run_monitor_app
3938

4039
if TYPE_CHECKING:
4140
from metta.setup.registry import SetupModule
@@ -718,7 +717,23 @@ def cmd_gridworks(ctx: typer.Context):
718717
subprocess.run(cmd, cwd=get_repo_root(), check=False)
719718

720719

721-
app.add_typer(run_monitor_app, name="run-monitor", help="Monitor training runs.")
720+
@app.command(
721+
name="run-monitor",
722+
help="Monitor training runs.",
723+
context_settings={"allow_extra_args": True, "ignore_unknown_options": True},
724+
add_help_option=False,
725+
)
726+
def cmd_run_monitor(ctx: typer.Context) -> None:
727+
"""Launch the live run monitor CLI without importing it at module load time."""
728+
from metta.adaptive import live_run_monitor
729+
730+
live_run_monitor.app(
731+
prog_name="metta run-monitor",
732+
standalone_mode=False,
733+
args=list(ctx.args),
734+
)
735+
736+
722737
app.add_typer(observatory_app, name="observatory")
723738
app.add_typer(book_app, name="book")
724739
app.add_typer(codebase_app, name="codebase")

metta/utils/__init__.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

packages/cortex/evaluations/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
)
2121
from torch.utils.data import DataLoader
2222

23-
from metta.utils.torch_init import enable_determinism
23+
from metta.rl.torch_init import enable_determinism
2424

2525
# Globals used by optional Axons parity probe
2626
AXONS_PARITY_PROBE: int = 0

packages/cortex/src/cortex/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def set_tf32_precision(mode: str) -> None:
109109
def configure_tf32_precision() -> None:
110110
"""Ensure TF32 fast paths are enabled."""
111111
try:
112-
from metta.utils.torch_init import configure_torch_globally
112+
from metta.rl.torch_init import configure_torch_globally
113113

114114
configure_torch_globally()
115115
except ImportError:

0 commit comments

Comments
 (0)