Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
75663f0d4c | ||
|
|
a975cab86d | ||
|
|
9aa5f1f2c8 | ||
|
|
c09bb0b30c | ||
|
|
3e93371dad |
Vendored
+1
-1
Submodule deps/prime-envs updated: b30aad3637...26dafdc958
Vendored
+1
-1
Submodule deps/renderers updated: 2846a3dcd2...cb82439137
Vendored
+1
-1
Submodule deps/verifiers updated: d4f3d5a8c6...237a78f147
@@ -247,8 +247,8 @@ uv run rl @ examples/basic/reverse-text/rl.toml \
|
||||
Then inspect the resolved config:
|
||||
|
||||
```bash
|
||||
ls /tmp/reverse-dry/check/configs/
|
||||
ls /tmp/reverse-dry/check/configs/resolved/
|
||||
# rl.json trainer.json orchestrator.json inference.json
|
||||
```
|
||||
|
||||
Each per-process TOML reflects the final, validated configuration that the actual run would consume — exactly what each process sees when started standalone (`uv run trainer @ /tmp/reverse-dry/check/configs/trainer.json`, etc.). This is the easiest way to bisect a misbehaving config: dry-run a known-good base, dry-run your overlay, diff the two.
|
||||
Each per-process JSON reflects the final, validated configuration that the actual run would consume — exactly what each process sees when started standalone (`uv run trainer @ /tmp/reverse-dry/check/configs/resolved/trainer.json`, etc.). This is the easiest way to bisect a misbehaving config: dry-run a known-good base, dry-run your overlay, diff the two.
|
||||
|
||||
+6
-5
@@ -43,19 +43,20 @@ uv run rl @ rl.toml \
|
||||
|
||||
The launcher allocates GPUs in order from `CUDA_VISIBLE_DEVICES` (or all visible GPUs): inference first, trainer next. To target a specific physical subset, pin `CUDA_VISIBLE_DEVICES` before launching.
|
||||
|
||||
For quick A/B ablations on the same node, run two RL instances side-by-side in separate tmux sessions, each pinned to half the GPUs and a separate inference port:
|
||||
For quick A/B ablations on the same node, run two RL instances side-by-side in separate shells, each pinned to half the GPUs and a separate inference port, and track both in one dashboard:
|
||||
|
||||
```bash
|
||||
# session 1, GPUs 0–1, default port 8000
|
||||
bash scripts/tmux.sh -s exp1 -o outputs/exp1
|
||||
# shell 1, GPUs 0–1, default port 8000
|
||||
CUDA_VISIBLE_DEVICES=0,1 uv run rl @ rl.toml --run.name exp1
|
||||
|
||||
# session 2, GPUs 2–3, port 8001
|
||||
bash scripts/tmux.sh -s exp2 -o outputs/exp2
|
||||
# shell 2, GPUs 2–3, port 8001
|
||||
CUDA_VISIBLE_DEVICES=2,3 uv run rl @ rl.toml \
|
||||
--inference.server.port 8001 \
|
||||
--orchestrator.model.client.base-url http://localhost:8001/v1 \
|
||||
--run.name exp2
|
||||
|
||||
# watch both side by side
|
||||
uv run dashboard outputs
|
||||
```
|
||||
|
||||
#### SFT and Torchrun
|
||||
|
||||
+3
-11
@@ -81,7 +81,7 @@ A condensed view of the knobs you'll most often tune. For trainer-side paralleli
|
||||
| `--run.name <name>` | Run name, also the run directory name under `<output_dir>` (override the directory separately via `--run.dir`). Auto-generated as `<envs>--<model>--<short-id>` when unset, so every launch gets a fresh, readable run directory. Set an explicit name for a predictable path — required to resume the run later. |
|
||||
| `--clean` | Wipe the run directory before starting. Useful when re-running a named run during iteration. |
|
||||
| `--max-steps N` | Stop after `N` trainer steps. Overrides the config value. |
|
||||
| `--dry-run` | Resolve + validate the full config, write per-process TOMLs to `<run_dir>/configs/`, and exit without launching. The fastest way to debug a misbehaving config. |
|
||||
| `--dry-run` | Resolve + validate the full config, write per-process configs to `<run_dir>/configs/resolved/`, and exit without launching. The fastest way to debug a misbehaving config. |
|
||||
|
||||
### Algorithms
|
||||
|
||||
@@ -327,17 +327,9 @@ tail -F <run_dir>/logs/latest/trainer/node_*.log # multi-node only
|
||||
tail -F <run_dir>/logs/latest/inference/router.log # multi-node only
|
||||
```
|
||||
|
||||
### Console Output
|
||||
### Dashboard
|
||||
|
||||
`scripts/tmux.sh` opens a 4-pane tmux session that follows `trainer.log`, `orchestrator.log`, `inference.log`, and the union of env worker logs. Start it before launching:
|
||||
|
||||
```bash
|
||||
bash scripts/tmux.sh -o outputs/my-run
|
||||
# then in the Launcher window:
|
||||
uv run rl @ ... --run.name my-run
|
||||
```
|
||||
|
||||
Pass `-s <session>` and `-o <run_dir>` (the run directory, `<output_dir>/<run_name>`) to run multiple parallel experiments side-by-side in different sessions. The helper also works on a SLURM head node — `bash scripts/tmux.sh my-rl-job /shared/outputs/my-rl-job`.
|
||||
`uv run dashboard [output_dir ...]` (default `outputs/`) serves a local web dashboard at `http://localhost:7788` with four views per run: metrics (the W&B overview sections, read from `metrics.jsonl`), the resolved configs, a rollout trace viewer with a per-token advantage/logprob view, and merged component logs. It only reads the run dirs, so it is safe to point at a live run; pass several output directories to track parallel experiments. A taken port automatically bumps to the next free one, so several dashboards coexist on one node. On a machine that should not resolve the training dependencies (e.g. a cluster head node), run it standalone: `uv run --script src/prime_rl/dashboard/server.py [output_dir ...]` — an isolated script environment with only the dashboard's own small dependencies.
|
||||
|
||||
### Weights & Biases
|
||||
|
||||
|
||||
@@ -12,9 +12,10 @@ The taskset is included through the Verifiers workspace. After syncing the repos
|
||||
uv run python -c "import alphabet_sort"
|
||||
```
|
||||
|
||||
Start the tmux session:
|
||||
We'll use two terminals: one for the inference server, one for everything else. To watch the run while it trains — metrics, resolved configs, rollout traces, and logs in one place — start the local dashboard and open http://localhost:7788:
|
||||
|
||||
```bash
|
||||
bash scripts/tmux.sh
|
||||
uv run dashboard
|
||||
```
|
||||
|
||||
## Task
|
||||
@@ -31,13 +32,13 @@ We use non-default settings to balance the difficulty: 3 fixed turns (instead of
|
||||
|
||||
Start the inference server:
|
||||
```bash
|
||||
# In the `Inference` pane
|
||||
# Run this in the inference terminal
|
||||
uv run inference --vllm.enable-lora --vllm.model Qwen/Qwen3-4B-Instruct-2507
|
||||
```
|
||||
|
||||
Evaluate the base model:
|
||||
```bash
|
||||
# In the `Trainer` pane
|
||||
# Run this in the other terminal
|
||||
uv run eval alphabet-sort --harness.id null \
|
||||
-m Qwen/Qwen3-4B-Instruct-2507 \
|
||||
--client.base-url http://localhost:8000/v1 \
|
||||
@@ -91,7 +92,7 @@ We train with LoRA (rank 32, alpha 64) for 100 steps.
|
||||
|
||||
*Check out the logs on [W&B](https://wandb.ai/primeintellect/alphabet-sort-4b-lora/workspace?nw=nwuserandrewpi).*
|
||||
```bash
|
||||
# In the `Trainer` pane
|
||||
# Run this in the other terminal
|
||||
uv run rl @ examples/basic/alphabet-sort/rl.toml \
|
||||
--run.name rl \
|
||||
--monitors.wandb.project ... \
|
||||
@@ -106,12 +107,12 @@ We have uploaded the final model as [`PrimeIntellect/Qwen3-4B-Instruct-AlphabetS
|
||||
|
||||
Let's see how our final RL checkpoint performs on the eval set.
|
||||
```bash
|
||||
# In the `Inference` pane
|
||||
# Run this in the inference terminal
|
||||
uv run inference --vllm.enable-lora --vllm.model PrimeIntellect/Qwen3-4B-Instruct-AlphabetSort-RL
|
||||
```
|
||||
|
||||
```bash
|
||||
# In the `Trainer` pane
|
||||
# Run this in the other terminal
|
||||
uv run eval alphabet-sort --harness.id null \
|
||||
-m PrimeIntellect/Qwen3-4B-Instruct-AlphabetSort-RL \
|
||||
--client.base-url http://localhost:8000/v1 \
|
||||
|
||||
@@ -12,21 +12,21 @@ The `reverse-text` taskset is included through the Verifiers workspace. After sy
|
||||
uv run python -c "import reverse_text"
|
||||
```
|
||||
|
||||
First, let's start a `tmux` session which we will use throughout the experiment.
|
||||
We'll use two terminals: one for the inference server, one for everything else. To watch the run while it trains — metrics, resolved configs, rollout traces, and logs in one place — start the local dashboard and open http://localhost:7788:
|
||||
|
||||
```bash
|
||||
bash scripts/tmux.sh
|
||||
uv run dashboard
|
||||
```
|
||||
|
||||
Let's check how well `Qwen3-0.6B` does out-of-the-box on the `reverse-text` environment.
|
||||
|
||||
```bash
|
||||
# Run this in the `Inference` pane
|
||||
# Run this in the inference terminal
|
||||
uv run inference --vllm.model Qwen/Qwen3-0.6B
|
||||
```
|
||||
|
||||
```bash
|
||||
# Run this in the `Trainer` pane
|
||||
# Run this in the other terminal
|
||||
uv run eval reverse-text --harness.id null -m Qwen/Qwen3-0.6B --client.base-url http://localhost:8000/v1 -n 20 -r 3 --sampling.max-tokens 1024 --no-push
|
||||
```
|
||||
|
||||
@@ -41,7 +41,7 @@ We will fine-tune `PrimeIntellect/Qwen3-0.6B` ([HF](https://huggingface.co/Prime
|
||||
To train on a single GPU, run
|
||||
|
||||
```bash
|
||||
# In the `Trainer` pane
|
||||
# Run this in the other terminal
|
||||
uv run sft @ examples/basic/reverse-text/sft.toml \
|
||||
--run.name sft \
|
||||
--monitors.wandb.project ... \
|
||||
@@ -51,7 +51,7 @@ uv run sft @ examples/basic/reverse-text/sft.toml \
|
||||
To train on multiple GPUs, run
|
||||
|
||||
```bash
|
||||
# In the `Trainer` pane
|
||||
# Run this in the other terminal
|
||||
uv run torchrun \
|
||||
--local-ranks-filter 0 \
|
||||
--nproc-per-node ... \
|
||||
@@ -71,7 +71,7 @@ For the RL we will only do 20 steps at 8x16 rollouts, for a total batch size of
|
||||
*Check out the logs of the RL run on [W&B](https://wandb.ai/primeintellect/examples?nw=yxjwjc556do).*
|
||||
|
||||
```bash
|
||||
# Run this in the `Trainer` pane
|
||||
# Run this in the other terminal
|
||||
uv run rl @ examples/basic/reverse-text/rl.toml \
|
||||
--model.name ... \
|
||||
--run.name rl \
|
||||
@@ -88,12 +88,12 @@ We have uploaded the final model as [`PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL`
|
||||
Let's see how our final RL checkpoints perform on the `reverse-text` environment.
|
||||
|
||||
```bash
|
||||
# Run this in the `Inference` pane
|
||||
# Run this in the inference terminal
|
||||
uv run inference --vllm.model PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL
|
||||
```
|
||||
|
||||
```bash
|
||||
# Run this in the `Trainer` pane
|
||||
# Run this in the other terminal
|
||||
uv run eval reverse-text --harness.id null -m PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL --client.base-url http://localhost:8000/v1 -n 20 -r 3 --sampling.max-tokens 1024 --no-push
|
||||
```
|
||||
|
||||
|
||||
@@ -25,10 +25,10 @@ Set up the credentials for the configured reference judge:
|
||||
export OPENAI_API_KEY=your_api_key_here
|
||||
```
|
||||
|
||||
Start the tmux session:
|
||||
We'll use two terminals: one for the inference server, one for everything else. To watch the run while it trains — metrics, resolved configs, rollout traces, and logs in one place — start the local dashboard and open http://localhost:7788:
|
||||
|
||||
```bash
|
||||
bash scripts/tmux.sh
|
||||
uv run dashboard
|
||||
```
|
||||
|
||||
## Task
|
||||
@@ -69,14 +69,14 @@ Key configuration highlights:
|
||||
Start the inference server:
|
||||
|
||||
```bash
|
||||
# In the `Inference` pane
|
||||
# Run this in the inference terminal
|
||||
uv run inference --vllm.enable-lora --vllm.model Qwen/Qwen3-4B-Instruct-2507 --vllm.tool-call-parser hermes
|
||||
```
|
||||
|
||||
Evaluate the base model:
|
||||
|
||||
```bash
|
||||
# In the `Trainer` pane
|
||||
# Run this in the other terminal
|
||||
uv run eval wiki-search --harness.id null \
|
||||
-m Qwen/Qwen3-4B-Instruct-2507 \
|
||||
--client.base-url http://localhost:8000/v1 \
|
||||
@@ -91,7 +91,7 @@ uv run eval wiki-search --harness.id null \
|
||||
Train with the unified config file:
|
||||
|
||||
```bash
|
||||
# In the `Trainer` pane
|
||||
# Run this in the other terminal
|
||||
uv run rl @ examples/basic/wiki-search/rl.toml \
|
||||
--run.name rl \
|
||||
--monitors.wandb.project your-project-name \
|
||||
@@ -110,12 +110,12 @@ This will write DCP checkpoints in `outputs/rl/checkpoints/step_*`.
|
||||
Evaluate your trained model:
|
||||
|
||||
```bash
|
||||
# In the `Inference` pane
|
||||
# Run this in the inference terminal
|
||||
uv run inference --vllm.enable-lora --vllm.model <user>/Qwen3-4B-Instruct-WikiSearch-RL --vllm.tool-call-parser hermes
|
||||
```
|
||||
|
||||
```bash
|
||||
# In the `Trainer` pane
|
||||
# Run this in the other terminal
|
||||
uv run eval wiki-search --harness.id null \
|
||||
-m <user>/Qwen3-4B-Instruct-WikiSearch-RL \
|
||||
--client.base-url http://localhost:8000/v1 \
|
||||
|
||||
@@ -12,23 +12,23 @@ The taskset is included through the Verifiers workspace. After syncing the repos
|
||||
uv run python -c "import wordle"
|
||||
```
|
||||
|
||||
Start the pre-layouted `tmux` session which we will use to run all experiments and view logs conveniently
|
||||
We'll use two terminals: one for the inference server, one for everything else. To watch the run while it trains — metrics, resolved configs, rollout traces, and logs in one place — start the local dashboard and open http://localhost:7788:
|
||||
|
||||
```bash
|
||||
bash scripts/tmux.sh
|
||||
uv run dashboard
|
||||
```
|
||||
|
||||
Before training, we want to get a baseline score and test how well `Qwen3-1.7B` does out-of-the-box in the `wordle` environment so that we quantify our training effect. To do so, first start a local inference server to serve `Qwen3-1.7B`.
|
||||
|
||||
```bash
|
||||
# Run this in the `Inference` pane
|
||||
# Run this in the inference terminal
|
||||
uv run inference --vllm.model Qwen/Qwen3-1.7B
|
||||
```
|
||||
|
||||
Then, use the `eval` entrypoint to evaluate the model in the `wordle` environment. We evaluate on the 20 evaluation examples which are distinct words not appearing in the training set of the environment. We constrain the response length to 1024 tokens as this should be more than enough to play a full game.
|
||||
|
||||
```bash
|
||||
# Run this in the `Trainer` pane
|
||||
# Run this in the other terminal
|
||||
uv run eval wordle --harness.id null -m Qwen/Qwen3-1.7B --client.base-url http://localhost:8000/v1 -n 20 -r 3 --sampling.max-tokens 1024 --no-push
|
||||
```
|
||||
|
||||
@@ -43,7 +43,7 @@ We will fine-tune `PrimeIntellect/Qwen3-1.7B` ([HF](https://huggingface.co/Prime
|
||||
To train on a single GPU, run
|
||||
|
||||
```bash
|
||||
# In the `Trainer` pane
|
||||
# Run this in the other terminal
|
||||
uv run sft @ examples/basic/wordle/sft.toml \
|
||||
--run.name sft \
|
||||
--monitors.wandb.project ... \
|
||||
@@ -53,7 +53,7 @@ uv run sft @ examples/basic/wordle/sft.toml \
|
||||
To train on multiple GPUs, run
|
||||
|
||||
```bash
|
||||
# In the `Trainer` pane
|
||||
# Run this in the other terminal
|
||||
uv run torchrun \
|
||||
--local-ranks-filter 0 \
|
||||
--nproc-per-node ... \
|
||||
@@ -74,7 +74,7 @@ Finally, we will do multi-turn RL against the `wordle` environment using the mod
|
||||
|
||||
|
||||
```bash
|
||||
# Run this in the `Trainer` pane
|
||||
# Run this in the other terminal
|
||||
uv run rl @ examples/basic/wordle/rl.toml \
|
||||
--model.name ... \
|
||||
--run.name rl \
|
||||
@@ -91,12 +91,12 @@ We have uploaded the final model as [`PrimeIntellect/Qwen3-1.7B-Wordle-RL`](http
|
||||
Let's see how our final RL checkpoint performs on the eval set.
|
||||
|
||||
```bash
|
||||
# Run this in the `Inference` pane
|
||||
# Run this in the inference terminal
|
||||
uv run inference --vllm.model PrimeIntellect/Qwen3-1.7B-Wordle-RL
|
||||
```
|
||||
|
||||
```bash
|
||||
# Run this in the `Trainer` pane
|
||||
# Run this in the other terminal
|
||||
uv run eval wordle --harness.id null -m PrimeIntellect/Qwen3-1.7B-Wordle-RL --client.base-url http://localhost:8000/v1 -n 20 -r 3 --sampling.max-tokens 1024 --no-push
|
||||
```
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ requires-python = "~=3.12.0"
|
||||
dependencies = [
|
||||
"pydantic>=1.10.13",
|
||||
"prime-pydantic-config>=0.4.3",
|
||||
"renderers>=0.1.9",
|
||||
"renderers>=0.1.10",
|
||||
"tomli>=2.2.1",
|
||||
"tomli-w>=1.2.0",
|
||||
"verifiers>=0.3.0",
|
||||
|
||||
+7
-1
@@ -34,7 +34,7 @@ dependencies = [
|
||||
"uvloop>=0.21.0",
|
||||
"torchtitan",
|
||||
"verifiers[harbor]>=0.3.1.dev59",
|
||||
"renderers",
|
||||
"renderers>=0.1.10",
|
||||
"dion",
|
||||
"tilelang>=0.1.8",
|
||||
"flash-linear-attention",
|
||||
@@ -55,11 +55,16 @@ trainer = "prime_rl.entrypoints.trainer:main"
|
||||
orchestrator = "prime_rl.entrypoints.orchestrator:main"
|
||||
evals = "prime_rl.entrypoints.evals:main"
|
||||
env-server = "prime_rl.entrypoints.env_server:main"
|
||||
dashboard = "prime_rl.dashboard.server:main"
|
||||
|
||||
[project.entry-points."vllm.general_plugins"]
|
||||
prime_rl = "prime_rl.inference.patches:apply_shared_vllm_patches"
|
||||
|
||||
[project.optional-dependencies]
|
||||
dashboard = [
|
||||
"fastapi>=0.115",
|
||||
"uvicorn>=0.30",
|
||||
]
|
||||
# Both wheels are the same flash-attn 2.8.3 / cu128 / torch 2.11 / cp312 build and carry
|
||||
# sm_80 / sm_90 / sm_100 / sm_120 cubins. `attn="auto"` picks FA4 on sm_100 and FA3 on
|
||||
# sm_90, so FA2 is the resolved backend on sm_120 (see `_resolve_attn_impl` in
|
||||
@@ -107,6 +112,7 @@ dev = [
|
||||
"ipykernel>=6.29.5",
|
||||
"ipywidgets>=8.1.7",
|
||||
"pre-commit>=4.2.0",
|
||||
"playwright>=1.49",
|
||||
"pytest>=8.4.1",
|
||||
"pytest-asyncio>=0.23",
|
||||
"ruff>=0.12.1",
|
||||
|
||||
-148
@@ -1,148 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
SESSION_NAME="prime-rl"
|
||||
OUTPUT_DIR="outputs"
|
||||
AGENT="claude"
|
||||
|
||||
# Optional CLI parsing
|
||||
# Supports:
|
||||
# -s|--session-name NAME
|
||||
# -o|--output-dir DIR
|
||||
# -a|--agent AGENT (claude|codex, default: claude)
|
||||
# Positional: [SESSION_NAME [OUTPUT_DIR]]
|
||||
POSITIONAL=()
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
-s|--session-name)
|
||||
if [[ -z "$2" ]]; then
|
||||
echo "Error: --session-name requires a value" >&2
|
||||
exit 1
|
||||
fi
|
||||
SESSION_NAME="$2"
|
||||
shift 2
|
||||
;;
|
||||
-o|--output-dir)
|
||||
if [[ -z "$2" ]]; then
|
||||
echo "Error: --output-dir requires a value" >&2
|
||||
exit 1
|
||||
fi
|
||||
OUTPUT_DIR="$2"
|
||||
shift 2
|
||||
;;
|
||||
-a|--agent)
|
||||
if [[ -z "$2" ]]; then
|
||||
echo "Error: --agent requires a value (claude|codex)" >&2
|
||||
exit 1
|
||||
fi
|
||||
AGENT="$2"
|
||||
shift 2
|
||||
;;
|
||||
-h|--help)
|
||||
echo "Usage: $0 [-s SESSION_NAME] [-o OUTPUT_DIR] [-a AGENT] [SESSION_NAME [OUTPUT_DIR]]" >&2
|
||||
echo " -a, --agent claude|codex (default: claude)" >&2
|
||||
exit 0
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
*)
|
||||
POSITIONAL+=("$1")
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ ${#POSITIONAL[@]} -ge 1 ]]; then
|
||||
SESSION_NAME="${POSITIONAL[0]}"
|
||||
fi
|
||||
if [[ ${#POSITIONAL[@]} -ge 2 ]]; then
|
||||
OUTPUT_DIR="${POSITIONAL[1]}"
|
||||
fi
|
||||
|
||||
LOG_DIR="${OUTPUT_DIR}/logs/latest"
|
||||
|
||||
if tmux has-session -t "$SESSION_NAME" 2>/dev/null; then
|
||||
echo "Attaching to tmux session: $SESSION_NAME"
|
||||
exec tmux attach-session -t "$SESSION_NAME"
|
||||
fi
|
||||
|
||||
echo "Creating new tmux session: $SESSION_NAME"
|
||||
|
||||
# Window 0: Launcher - empty shell
|
||||
tmux new-session -d -s "$SESSION_NAME" -n "Launcher"
|
||||
|
||||
# Window 1: Logs - 4 vertical panes
|
||||
tmux new-window -t "$SESSION_NAME" -n "Logs"
|
||||
|
||||
tmux split-window -v -t "$SESSION_NAME:Logs.0"
|
||||
tmux split-window -v -t "$SESSION_NAME:Logs.1"
|
||||
tmux split-window -v -t "$SESSION_NAME:Logs.2"
|
||||
tmux select-layout -t "$SESSION_NAME:Logs" even-vertical
|
||||
|
||||
tmux select-pane -t "$SESSION_NAME:Logs.0" -T "Trainer"
|
||||
tmux select-pane -t "$SESSION_NAME:Logs.1" -T "Orchestrator"
|
||||
tmux select-pane -t "$SESSION_NAME:Logs.2" -T "Envs"
|
||||
tmux select-pane -t "$SESSION_NAME:Logs.3" -T "Inference"
|
||||
|
||||
tmux send-keys -t "$SESSION_NAME:Logs.0" \
|
||||
"tail -F ${LOG_DIR}/trainer.log 2>/dev/null" C-m
|
||||
|
||||
tmux send-keys -t "$SESSION_NAME:Logs.1" \
|
||||
"tail -F ${LOG_DIR}/orchestrator.log 2>/dev/null" C-m
|
||||
|
||||
tmux send-keys -t "$SESSION_NAME:Logs.2" \
|
||||
"tail -F ${LOG_DIR}/envs/*/*.log 2>/dev/null" C-m
|
||||
|
||||
tmux send-keys -t "$SESSION_NAME:Logs.3" \
|
||||
"tail -F ${LOG_DIR}/inference.log 2>/dev/null" C-m
|
||||
|
||||
# Window 2: SUCCESS - grep SUCCESS on orch and trainer logs (two stacked panes)
|
||||
tmux new-window -t "$SESSION_NAME" -n "SUCCESS"
|
||||
|
||||
tmux split-window -v -t "$SESSION_NAME:SUCCESS.0"
|
||||
tmux select-layout -t "$SESSION_NAME:SUCCESS" even-vertical
|
||||
|
||||
tmux select-pane -t "$SESSION_NAME:SUCCESS.0" -T "Orchestrator"
|
||||
tmux select-pane -t "$SESSION_NAME:SUCCESS.1" -T "Trainer"
|
||||
|
||||
tmux send-keys -t "$SESSION_NAME:SUCCESS.0" "tail -F ${LOG_DIR}/orchestrator.log 2>/dev/null | grep --line-buffered SUCCESS" C-m
|
||||
|
||||
tmux send-keys -t "$SESSION_NAME:SUCCESS.1" "tail -F ${LOG_DIR}/trainer.log 2>/dev/null | grep --line-buffered SUCCESS" C-m
|
||||
|
||||
# Window 3: Agent (claude code or codex) with log context
|
||||
tmux new-window -t "$SESSION_NAME" -n "Agent"
|
||||
|
||||
AGENT_PROMPT="You are monitoring a prime-rl training run. The output directory is ${OUTPUT_DIR}. Log paths:
|
||||
Trainer: ${LOG_DIR}/trainer.log
|
||||
All nodes: ${LOG_DIR}/trainer/node_*.log
|
||||
All ranks: ${LOG_DIR}/trainer/torchrun/*/*/*/*.log
|
||||
Orchestrator: ${LOG_DIR}/orchestrator.log
|
||||
Inference: ${LOG_DIR}/inference.log
|
||||
Envs: ${LOG_DIR}/envs/*/*.log
|
||||
Train envs: ${LOG_DIR}/envs/train/*.log
|
||||
You are running inside tmux session \"${SESSION_NAME}\". The Launcher window (window 0) is where the user runs launch commands. You can read its contents with: tmux capture-pane -t ${SESSION_NAME}:Launcher -p
|
||||
Help the user monitor and debug this run."
|
||||
|
||||
case "$AGENT" in
|
||||
claude)
|
||||
tmux send-keys -t "$SESSION_NAME:Agent" \
|
||||
"claude --permission-mode auto --append-system-prompt \"${AGENT_PROMPT}\"" C-m
|
||||
;;
|
||||
codex)
|
||||
tmux send-keys -t "$SESSION_NAME:Agent" \
|
||||
"codex --yolo \"${AGENT_PROMPT}\"" C-m
|
||||
;;
|
||||
*)
|
||||
echo "Error: unknown agent '$AGENT' (expected claude|codex)" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Pane title styling
|
||||
tmux set-option -t "$SESSION_NAME" -g pane-border-status top
|
||||
tmux set-option -t "$SESSION_NAME" -g pane-border-format " #{pane_title} "
|
||||
|
||||
# Focus launcher window and attach
|
||||
tmux select-window -t "$SESSION_NAME:Launcher"
|
||||
exec tmux attach-session -t "$SESSION_NAME"
|
||||
@@ -29,6 +29,8 @@ uv sync --all-extras --all-packages # + all env packages (needed to train
|
||||
uv sync --package prime-rl --package gsm8k # core + just one env
|
||||
```
|
||||
|
||||
`uv sync --group dev` installs the `pre-commit` package but leaves the git hook inert until it's wired up — run `uv run pre-commit install` once per clone (see `README.md`'s Development section).
|
||||
|
||||
Environment packages are uv **workspace members**. Those under `deps/prime-envs/environments/*/*` are auto-discovered — adding a new env there needs no `pyproject.toml` change. verifiers' example envs are enumerated explicitly in `[tool.uv.workspace].members` (only the ones prime-rl trains or tests on) — to use another, add its path to the list. Members are opt-in: a plain `uv sync` / `--all-extras` does not install them (and would remove them if already present — re-run with `--all-packages`, or `--inexact` to keep them). Install all with `--all-packages`, or a subset with repeated `--package <env>` (include `--package prime-rl` to keep the core). If two envs pin conflicting transitive versions (all members share one lock), add the loser to `[tool.uv.workspace].exclude`.
|
||||
|
||||
When bumping a package past the workspace-wide `exclude-newer = "7 days"` window, add it (and any newly-required transitives) to `[tool.uv.exclude-newer-package]` before refreshing `uv.lock`.
|
||||
|
||||
@@ -9,7 +9,7 @@ description: Monitor an ongoing prime-rl training run — find the output direct
|
||||
|
||||
### On launch
|
||||
|
||||
1. Find the run dir and read the resolved configs at `{run_dir}/configs/` (start with `rl.json`). The run dir is `{output_dir}/{run_name}` — `run.name` auto-generates as `<envs>--<model>--<short-id>`, so if you only know the output dir, pick the most recently modified subdirectory (`ls -t {output_dir} | head -1`) or read `run.name` from the launch command.
|
||||
1. Find the run dir and read the resolved configs at `{run_dir}/configs/resolved/` (start with `rl.json`, or `orchestrator.json` on local runs). The launch TOML is copied verbatim to `{run_dir}/configs/rl.toml`. The run dir is `{output_dir}/{run_name}` — `run.name` auto-generates as `<envs>--<model>--<short-id>`, so if you only know the output dir, pick the most recently modified subdirectory (`ls -t {output_dir} | head -1`) or read `run.name` from the launch command.
|
||||
2. Confirm all processes are alive and the run is making progress.
|
||||
3. Write the initial summary into `{run_dir}/STATUS.md`.
|
||||
|
||||
@@ -40,14 +40,7 @@ In W&B, each project auto-gets an **"overview" saved view** (train / eval / stab
|
||||
|
||||
**Never restart unless the researcher explicitly asked.** Confirm the exact restart command and the conditions that warrant one.
|
||||
|
||||
**Never** run kill or launch commands from your own shell. Dispatch them to the tmux **Launcher** window so the researcher sees what was executed:
|
||||
|
||||
```bash
|
||||
SESSION=$(tmux display-message -p '#S')
|
||||
tmux send-keys -t "$SESSION:Launcher" 'your command here' Enter
|
||||
```
|
||||
|
||||
After a restart, verify all processes are back up and progress resumed before the next check-in.
|
||||
**Never** run kill or launch commands yourself. Hand the researcher the exact command and let them run it; after a restart, verify all processes are back up and progress resumed before the next check-in.
|
||||
|
||||
---
|
||||
|
||||
@@ -55,11 +48,22 @@ After a restart, verify all processes are back up and progress resumed before th
|
||||
|
||||
### Where to find things
|
||||
|
||||
- `scripts/tmux.sh` launches the run with a `Launcher` window in the named tmux session. The Claude window receives the run dir and session name in its appended prompt — if either is missing, **ask** rather than guess.
|
||||
- `{run_dir}/configs/` — resolved configs, written as JSON so explicit None settings round-trip (`rl.json` has the full picture).
|
||||
- `{run_dir}/configs/` — the launch TOML copied verbatim (`rl.toml`/`sft.toml`), plus `resolved/` with the per-component resolved configs, written as JSON so explicit None settings round-trip.
|
||||
- `{run_dir}/logs/latest/` — the current attempt's logs (each launch gets `logs/attempt_<n>/`; resumes never overwrite earlier attempts). See below.
|
||||
- `{run_dir}/rollouts/step_N/{train,eval}/` — saved episodes (see Episodes below).
|
||||
|
||||
### Dashboard
|
||||
|
||||
`uv run dashboard [output_dir ...]` (default `outputs/`; several dirs can be tracked at
|
||||
once) serves a local web dashboard at `http://localhost:7788` with four views per run:
|
||||
metrics (the W&B overview sections, read from `metrics.jsonl`), the resolved config
|
||||
files, a rollout trace viewer with a per-token advantage/logprob view, and merged
|
||||
component logs. It only reads the run dirs — safe to run against a live run.
|
||||
`--port`/`--host` pick the bind address; a taken port automatically bumps to the next
|
||||
free one, so several dashboards run side by side without coordination. Without the
|
||||
project's GPU deps (e.g. a head node), run it standalone:
|
||||
`uv run --script src/prime_rl/dashboard/server.py [output_dir ...]`.
|
||||
|
||||
### Logs
|
||||
|
||||
```
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
# Dashboard
|
||||
|
||||
`uv run dashboard [output_dir ...]` — a local web dashboard for run output
|
||||
directories (metrics, resolved configs, rollout traces, component logs) at
|
||||
http://localhost:7788. Needs the `dashboard` extra.
|
||||
|
||||
To run it without resolving the project's GPU dependencies (a cluster head
|
||||
node, a laptop against a mounted outputs dir), use the standalone script form —
|
||||
it resolves only a handful of small wheels into an isolated script environment:
|
||||
|
||||
```bash
|
||||
uv run --script src/prime_rl/dashboard/server.py [output_dir ...]
|
||||
```
|
||||
|
||||
The script needs its `static/` sibling directory, so copy this whole folder
|
||||
when moving it to another machine.
|
||||
|
||||
This package is fully AI-generated and maintained by agents - it is not meant to be read or edited by humans. Change it by asking an agent, and verify through the browser smoke tests.
|
||||
The integration suite covers it end to end (`tests/integration/dashboard_smoke.py`
|
||||
runs after every integration test).
|
||||
Executable
+872
@@ -0,0 +1,872 @@
|
||||
#!/usr/bin/env -S uv run --script
|
||||
# /// script
|
||||
# requires-python = ">=3.11"
|
||||
# dependencies = [
|
||||
# "fastapi>=0.115",
|
||||
# "uvicorn>=0.30",
|
||||
# "orjson>=3.10",
|
||||
# "tokenizers>=0.20",
|
||||
# "huggingface_hub>=0.25",
|
||||
# "rich>=14.0",
|
||||
# ]
|
||||
# ///
|
||||
"""Local dashboard for prime-rl runs: logs, metrics, and rollout traces.
|
||||
|
||||
This package is fully AI-generated and maintained by agents - it is not meant to be read or edited by humans. Change it by asking an agent, and verify through the browser smoke tests.
|
||||
|
||||
Reads everything from run output directories (metrics.jsonl, logs/attempt_N,
|
||||
rollouts/step_N) — no wandb or network required. Usage:
|
||||
|
||||
uv run dashboard [output_dir ...] [--port 7788] [--host 127.0.0.1]
|
||||
|
||||
Multiple output directories can be tracked at once.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
from collections import OrderedDict
|
||||
from pathlib import Path
|
||||
|
||||
import orjson
|
||||
|
||||
try:
|
||||
import uvicorn
|
||||
from fastapi import FastAPI, HTTPException, Query
|
||||
from fastapi.responses import FileResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
except ModuleNotFoundError as error: # the dashboard ships as an extra
|
||||
raise SystemExit(
|
||||
"the dashboard needs the 'dashboard' extra - install with `uv sync --extra dashboard` "
|
||||
"(or run the standalone script: `uv run --script src/prime_rl/dashboard/server.py`)"
|
||||
) from error
|
||||
|
||||
STATIC_DIR = Path(__file__).parent / "static"
|
||||
MASTER_LOGS = {"trainer.log", "orchestrator.log", "inference.log", "evals.log"}
|
||||
MAX_LOG_CHUNK = 2_000_000
|
||||
|
||||
app = FastAPI()
|
||||
output_dirs: list[Path] = [Path("outputs")]
|
||||
|
||||
# run id -> run dir, rebuilt on every /api/runs poll; ids are the run name,
|
||||
# qualified with the output dir's basename when two dirs hold the same name
|
||||
_run_registry: dict[str, Path] = {}
|
||||
|
||||
_lock = threading.Lock()
|
||||
MAX_CACHED_FILES = 64
|
||||
"""Per-cache LRU bound: paging through thousands of steps must not grow the
|
||||
server without limit (each entry holds one traces file's offsets/summaries)."""
|
||||
|
||||
|
||||
def _lru_get(cache: OrderedDict, key):
|
||||
value = cache.get(key)
|
||||
if value is not None:
|
||||
cache.move_to_end(key)
|
||||
return value
|
||||
|
||||
|
||||
def _lru_put(cache: OrderedDict, key, value) -> None:
|
||||
cache[key] = value
|
||||
cache.move_to_end(key)
|
||||
while len(cache) > MAX_CACHED_FILES:
|
||||
cache.popitem(last=False)
|
||||
|
||||
|
||||
# Append-only file caches keyed by absolute path: line-start offsets and per-episode summaries.
|
||||
_offsets_cache: OrderedDict[Path, tuple[int, list[int]]] = OrderedDict()
|
||||
_summaries_cache: OrderedDict[Path, tuple[int, list[dict]]] = OrderedDict()
|
||||
_tokenizer_cache: dict[str, object] = {}
|
||||
_piece_cache: dict[tuple[str, int], str] = {}
|
||||
_json_cache: dict[Path, tuple[tuple[int, float], dict]] = {}
|
||||
_steps_cache: dict[Path, tuple[float, list[int]]] = {}
|
||||
|
||||
|
||||
def is_run_dir(path: Path) -> bool:
|
||||
if not path.is_dir() or path.name.startswith("."):
|
||||
return False
|
||||
return any((path / marker).exists() for marker in ("configs", "logs", "metrics.jsonl", "rollouts"))
|
||||
|
||||
|
||||
def scan_runs() -> dict[str, Path]:
|
||||
global _run_registry
|
||||
by_name: dict[str, list[Path]] = {}
|
||||
for base in output_dirs:
|
||||
if not base.is_dir():
|
||||
continue
|
||||
for run_dir in sorted(base.iterdir()):
|
||||
if is_run_dir(run_dir):
|
||||
by_name.setdefault(run_dir.name, []).append(run_dir)
|
||||
registry: dict[str, Path] = {}
|
||||
for name, dirs in by_name.items():
|
||||
if len(dirs) == 1:
|
||||
registry[name] = dirs[0]
|
||||
else:
|
||||
for run_dir in dirs:
|
||||
registry[f"{run_dir.parent.name}:{name}"] = run_dir # ":" survives a URL path segment, "/" does not
|
||||
_run_registry = registry
|
||||
return registry
|
||||
|
||||
|
||||
def get_run_dir(run: str) -> Path:
|
||||
run_dir = _run_registry.get(run) or scan_runs().get(run)
|
||||
if run_dir is None or not run_dir.is_dir():
|
||||
raise HTTPException(404, f"run {run} not found")
|
||||
return run_dir
|
||||
|
||||
|
||||
def safe_child(base: Path, rel: str, *, suffix: str | None = None) -> Path:
|
||||
path = (base / rel).resolve()
|
||||
if not path.is_relative_to(base.resolve()) or (suffix and path.suffix != suffix) or not path.is_file():
|
||||
raise HTTPException(404, f"{rel} not found")
|
||||
return path
|
||||
|
||||
|
||||
def read_json(path: Path) -> dict:
|
||||
"""Config reads are cached by (size, mtime) — they sit on every /api/runs poll."""
|
||||
try:
|
||||
stat = path.stat()
|
||||
except OSError:
|
||||
return {}
|
||||
key = (stat.st_size, stat.st_mtime)
|
||||
with _lock:
|
||||
cached = _json_cache.get(path)
|
||||
if cached and cached[0] == key:
|
||||
return cached[1]
|
||||
try:
|
||||
data = orjson.loads(path.read_bytes())
|
||||
except (OSError, ValueError):
|
||||
data = {}
|
||||
with _lock:
|
||||
_json_cache[path] = (key, data)
|
||||
return data
|
||||
|
||||
|
||||
def numbered_dirs(parent: Path, prefix: str) -> list[tuple[int, Path]]:
|
||||
return sorted(
|
||||
(int(p.name.removeprefix(prefix)), p)
|
||||
for p in parent.glob(f"{prefix}*")
|
||||
if p.name.removeprefix(prefix).isdigit()
|
||||
)
|
||||
|
||||
|
||||
def size_etag(path: Path, etag: str | None) -> tuple[str, dict | None]:
|
||||
"""Etag = file size: the trace files are append-only, so an unchanged size means
|
||||
an unchanged response. Returns (current_etag, short-circuit response or None)."""
|
||||
current = str(path.stat().st_size)
|
||||
if etag is not None and etag == current:
|
||||
return current, {"unchanged": True, "etag": current}
|
||||
return current, None
|
||||
|
||||
|
||||
def model_name(config: dict) -> str | None:
|
||||
"""`model` is a string on eval configs, a {name} object on rl/sft ones."""
|
||||
model = config.get("model")
|
||||
return model if isinstance(model, str) else (model or {}).get("name")
|
||||
|
||||
|
||||
def resolved_config_dir(run_dir: Path) -> Path:
|
||||
"""Where the resolved JSON dumps live: `configs/resolved/`, or `configs/` on
|
||||
runs from before the launch-TOML split."""
|
||||
configs = run_dir / "configs"
|
||||
resolved = configs / "resolved"
|
||||
return resolved if resolved.is_dir() else configs
|
||||
|
||||
|
||||
def main_config(run_dir: Path) -> tuple[str, dict]:
|
||||
configs = resolved_config_dir(run_dir)
|
||||
if (configs / "sft.json").exists():
|
||||
return "sft", read_json(configs / "sft.json")
|
||||
if (configs / "orchestrator.json").exists() or (configs / "trainer.json").exists():
|
||||
return "rl", read_json(configs / "orchestrator.json") or read_json(configs / "trainer.json")
|
||||
if (configs / "eval.json").exists(): # verifiers `uv run eval` run dir
|
||||
return "eval", read_json(configs / "eval.json")
|
||||
return "other", {}
|
||||
|
||||
|
||||
def attempt_numbers(run_dir: Path) -> list[int]:
|
||||
return [n for n, _ in numbered_dirs(run_dir / "logs", "attempt_")]
|
||||
|
||||
|
||||
def step_numbers(run_dir: Path) -> list[int]:
|
||||
"""Rollout step numbers, cached by the rollouts dir mtime (which changes when a
|
||||
step dir is created) — polled per run on every /api/runs tick."""
|
||||
rollouts = run_dir / "rollouts"
|
||||
try:
|
||||
mtime = rollouts.stat().st_mtime
|
||||
except OSError:
|
||||
return []
|
||||
with _lock:
|
||||
cached = _steps_cache.get(rollouts)
|
||||
if cached and cached[0] == mtime:
|
||||
return cached[1]
|
||||
steps = [n for n, _ in numbered_dirs(rollouts, "step_")]
|
||||
with _lock:
|
||||
_steps_cache[rollouts] = (mtime, steps)
|
||||
return steps
|
||||
|
||||
|
||||
def run_meta(run_dir: Path) -> dict:
|
||||
configs = run_dir / "configs"
|
||||
run_type, config = main_config(run_dir)
|
||||
resolved = resolved_config_dir(run_dir)
|
||||
|
||||
def envs(split: str) -> list[str]:
|
||||
return sorted(p.stem for p in (resolved / "envs" / split).glob("*.json"))
|
||||
|
||||
steps = step_numbers(run_dir)
|
||||
metrics_path = run_dir / "metrics.jsonl"
|
||||
started = updated = None
|
||||
if metrics_path.is_file():
|
||||
updated = metrics_path.stat().st_mtime
|
||||
# read fresh every time: a relaunch replaces the file, and a cached
|
||||
# first-row time from the previous run makes the duration absurd
|
||||
with metrics_path.open("rb") as f:
|
||||
try:
|
||||
started = orjson.loads(f.readline()).get("time")
|
||||
except orjson.JSONDecodeError:
|
||||
started = None
|
||||
root_traces = run_dir / "traces.jsonl"
|
||||
if updated is None and root_traces.is_file(): # eval runs have no metrics.jsonl
|
||||
updated = root_traces.stat().st_mtime
|
||||
started = configs.stat().st_mtime if configs.is_dir() else None
|
||||
return {
|
||||
"name": run_dir.name,
|
||||
"type": run_type,
|
||||
"model": model_name(config),
|
||||
"dataset": (config.get("data") or {}).get("name"),
|
||||
"env": ((config.get("env") or {}).get("taskset") or {}).get("id"),
|
||||
"total_episodes": (config.get("num_tasks") or 0) * (config.get("num_rollouts") or 0) or None,
|
||||
"max_steps": config.get("max_steps"),
|
||||
"train_envs": envs("train"),
|
||||
"eval_envs": envs("eval"),
|
||||
"has_metrics": metrics_path.exists(),
|
||||
"last_step": max(steps, default=None),
|
||||
"started": started,
|
||||
"updated": updated,
|
||||
"created": configs.stat().st_mtime if configs.is_dir() else run_dir.stat().st_mtime,
|
||||
"mtime": run_dir.stat().st_mtime,
|
||||
}
|
||||
|
||||
|
||||
@app.get("/api/runs")
|
||||
def list_runs() -> dict:
|
||||
runs = []
|
||||
for run_id, run_dir in scan_runs().items():
|
||||
meta = run_meta(run_dir)
|
||||
meta["name"] = run_id
|
||||
runs.append(meta)
|
||||
runs.sort(key=lambda r: r["mtime"], reverse=True)
|
||||
return {"output_dir": ", ".join(str(d.resolve()) for d in output_dirs), "runs": runs}
|
||||
|
||||
|
||||
@app.get("/api/runs/{run}")
|
||||
def get_run(run: str) -> dict:
|
||||
return run_meta(get_run_dir(run))
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------- logs
|
||||
|
||||
|
||||
def log_component(rel: Path) -> tuple[str, str]:
|
||||
"""Map a path relative to the attempt dir to (component, label)."""
|
||||
parts = rel.parts
|
||||
if len(parts) == 1:
|
||||
return {
|
||||
"trainer.log": ("trainer", "trainer"),
|
||||
"orchestrator.log": ("orch", "orchestrator"),
|
||||
"inference.log": ("infer", "inference"),
|
||||
"evals.log": ("evals", "evals"),
|
||||
"eval.log": ("evals", "eval"),
|
||||
}.get(parts[0], ("other", parts[0]))
|
||||
if parts[0] == "trainer":
|
||||
if parts[1] == "torchrun": # trainer/torchrun/<rdzv>/attempt_0/<rank>/std{out,err}.log
|
||||
return "trainer", f"rank{parts[-2]}/{rel.stem}"
|
||||
return "trainer", rel.stem
|
||||
if parts[0] == "inference":
|
||||
return "infer", rel.stem
|
||||
if parts[0] == "envs" and len(parts) == 3: # envs/<split>/<env>.log
|
||||
return f"env:{rel.stem}", f"{rel.stem} ({parts[1]})"
|
||||
return "other", str(rel.with_suffix(""))
|
||||
|
||||
|
||||
@app.get("/api/runs/{run}/logfiles")
|
||||
def list_logfiles(run: str, attempt: str = "latest") -> dict:
|
||||
run_dir = get_run_dir(run)
|
||||
attempts = attempt_numbers(run_dir)
|
||||
if attempt == "latest":
|
||||
latest = (run_dir / "logs" / "latest").resolve()
|
||||
attempt_num = (
|
||||
int(latest.name.removeprefix("attempt_")) if latest.is_dir() else (attempts[-1] if attempts else 0)
|
||||
)
|
||||
else:
|
||||
attempt_num = int(attempt)
|
||||
attempt_dir = run_dir / "logs" / f"attempt_{attempt_num}"
|
||||
files = []
|
||||
|
||||
def add(path: Path, component: str, label: str) -> None:
|
||||
real = path.resolve() # multi-node masters are symlinks to node_0 logs
|
||||
if not real.is_file():
|
||||
return
|
||||
files.append(
|
||||
{
|
||||
"id": str(path.relative_to(run_dir)),
|
||||
"component": component,
|
||||
"label": label,
|
||||
"size": real.stat().st_size,
|
||||
"master": path.name in MASTER_LOGS and path.parent == attempt_dir,
|
||||
}
|
||||
)
|
||||
|
||||
if attempt_dir.is_dir():
|
||||
for path in sorted(attempt_dir.rglob("*.log")):
|
||||
component, label = log_component(path.relative_to(attempt_dir))
|
||||
add(path, component, label)
|
||||
# The evals process writes its env-server logs outside attempt_N (logs/envs/eval/*.log).
|
||||
for path in sorted((run_dir / "logs" / "envs").rglob("*.log")):
|
||||
add(path, f"env:{path.stem}", f"{path.stem} (evals)")
|
||||
return {"attempt": attempt_num, "attempts": attempts, "files": files}
|
||||
|
||||
|
||||
@app.get("/api/runs/{run}/log")
|
||||
def read_log(run: str, file: str, start: int | None = None, end: int | None = None, tail: int | None = None) -> dict:
|
||||
path = safe_child(get_run_dir(run), file)
|
||||
size = path.stat().st_size
|
||||
if tail is not None:
|
||||
start = max(0, size - tail)
|
||||
start = min(start or 0, size)
|
||||
with path.open("rb") as f:
|
||||
f.seek(start)
|
||||
data = f.read(min(MAX_LOG_CHUNK, (end if end is not None else size) - start))
|
||||
if tail is not None and start > 0: # snap the head to a line boundary
|
||||
cut = data.find(b"\n")
|
||||
if cut != -1:
|
||||
start += cut + 1
|
||||
data = data[cut + 1 :]
|
||||
chunk_end = start + len(data)
|
||||
if end is None and chunk_end == size:
|
||||
# Read to EOF: drop a partially-written trailing line so follow-mode gets whole lines.
|
||||
last_nl = data.rfind(b"\n")
|
||||
if last_nl != -1 and last_nl + 1 < len(data):
|
||||
data = data[: last_nl + 1]
|
||||
chunk_end = start + len(data)
|
||||
return {"text": data.decode("utf-8", errors="replace"), "start": start, "end": chunk_end}
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------- configs
|
||||
|
||||
CONFIG_ORDER = ["rl", "sft", "eval", "evals", "orchestrator", "trainer", "inference"]
|
||||
|
||||
|
||||
def config_rank(name: str) -> tuple[int, str]:
|
||||
stem = name.split("/")[0].removesuffix(".toml")
|
||||
return (CONFIG_ORDER.index(stem) if stem in CONFIG_ORDER else len(CONFIG_ORDER), name)
|
||||
|
||||
|
||||
@app.get("/api/runs/{run}/configs")
|
||||
def list_configs(run: str) -> dict:
|
||||
"""Two views of a run's config: each launch TOML (verbatim, as the run was
|
||||
started) and one "resolved" document concatenating every resolved JSON dump."""
|
||||
run_dir = get_run_dir(run)
|
||||
configs_dir = run_dir / "configs"
|
||||
files = sorted((p.name for p in configs_dir.glob("*.toml")), key=config_rank) if configs_dir.is_dir() else []
|
||||
if any(resolved_config_dir(run_dir).rglob("*.json")):
|
||||
files.append("resolved")
|
||||
return {"files": files}
|
||||
|
||||
|
||||
@app.get("/api/runs/{run}/config")
|
||||
def read_config(run: str, file: str) -> dict:
|
||||
run_dir = get_run_dir(run)
|
||||
if file == "resolved":
|
||||
base = resolved_config_dir(run_dir)
|
||||
names = sorted((str(p.relative_to(base).with_suffix("")) for p in base.rglob("*.json")), key=config_rank)
|
||||
doc = {name: read_json(base / f"{name}.json") for name in names}
|
||||
return {"file": file, "content": orjson.dumps(doc).decode()}
|
||||
path = safe_child(run_dir / "configs", file, suffix=".toml")
|
||||
return {"file": file, "content": path.read_text()}
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------- metrics
|
||||
|
||||
|
||||
MAX_METRICS_CHUNK = 4 * 1024 * 1024
|
||||
"""Per-response cap on /metrics: huge runs stream in chunks the client loops over,
|
||||
so the first charts paint long before a 100MB metrics.jsonl finishes loading."""
|
||||
|
||||
|
||||
@app.get("/api/runs/{run}/metrics")
|
||||
def read_metrics(run: str, offset: int = 0) -> dict:
|
||||
path = get_run_dir(run) / "metrics.jsonl"
|
||||
if not path.is_file():
|
||||
return {"rows": [], "offset": 0, "size": 0}
|
||||
size = path.stat().st_size
|
||||
if offset > size: # file was truncated/replaced
|
||||
offset = 0
|
||||
rows = []
|
||||
with path.open("rb") as f:
|
||||
f.seek(offset)
|
||||
data = f.read(MAX_METRICS_CHUNK)
|
||||
if data and b"\n" not in data: # a single line larger than the chunk
|
||||
data += f.readline()
|
||||
consumed = data.rfind(b"\n") + 1 # leave a partially-written last line for the next poll
|
||||
for line in data[:consumed].splitlines():
|
||||
try:
|
||||
rows.append(orjson.loads(line))
|
||||
except orjson.JSONDecodeError:
|
||||
continue
|
||||
return {"rows": rows, "offset": offset + consumed, "size": size}
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------ rollouts
|
||||
|
||||
|
||||
RECENT_STEPS = 64
|
||||
_avail_cache: dict[Path, dict[str, bool]] = {} # step dir -> known-present subsets
|
||||
_avail_scan_counter = 0
|
||||
|
||||
|
||||
EVAL_ROOT_STEP = (0, "eval", "all")
|
||||
"""The virtual address of a stepless `uv run eval` run's root traces.jsonl —
|
||||
the one convention shared by the step listing and traces_path."""
|
||||
|
||||
|
||||
def eval_root_traces(run_dir: Path) -> Path | None:
|
||||
root = run_dir / "traces.jsonl"
|
||||
return root if root.is_file() and root.stat().st_size > 0 else None
|
||||
|
||||
|
||||
def rollout_steps(run_dir: Path) -> list[dict]:
|
||||
"""Presence only — never reads trace files. Presence is monotonic (files only
|
||||
appear), so known-present subsets are cached forever; absent ones re-stat every
|
||||
poll only for the newest steps — older gaps (an eval landing late at its trigger
|
||||
step) are picked up by a full rescan every 10th call."""
|
||||
global _avail_scan_counter
|
||||
_avail_scan_counter += 1
|
||||
full_rescan = _avail_scan_counter % 10 == 1
|
||||
numbered = numbered_dirs(run_dir / "rollouts", "step_")
|
||||
recent_cutoff = numbered[-1][0] - RECENT_STEPS if numbered else 0
|
||||
steps = []
|
||||
for number, step_dir in numbered:
|
||||
available = _avail_cache.setdefault(step_dir, {})
|
||||
if len(available) < 4 and (full_rescan or number >= recent_cutoff):
|
||||
for kind in ("train", "eval"):
|
||||
for subset in ("all", "effective"):
|
||||
key = f"{kind}/{subset}"
|
||||
if key in available:
|
||||
continue
|
||||
path = step_dir / kind / subset / "traces.jsonl"
|
||||
if path.is_file() and path.stat().st_size > 0:
|
||||
available[key] = True
|
||||
if available:
|
||||
steps.append({"step": number, "available": available})
|
||||
root = eval_root_traces(run_dir)
|
||||
if not steps and root is not None:
|
||||
steps.append({"step": EVAL_ROOT_STEP[0], "available": {f"{EVAL_ROOT_STEP[1]}/{EVAL_ROOT_STEP[2]}": True}})
|
||||
return steps
|
||||
|
||||
|
||||
def line_offsets(path: Path) -> list[int]:
|
||||
size = path.stat().st_size
|
||||
with _lock:
|
||||
cached_size, offsets = _lru_get(_offsets_cache, path) or (0, [])
|
||||
if cached_size > size: # rewritten (e.g. resume cleanup): rebuild
|
||||
cached_size, offsets = 0, []
|
||||
if cached_size == size:
|
||||
return offsets
|
||||
# re-scan from the last recorded line (it may have been partial) into a local
|
||||
# list, then merge under the lock: the shared list only ever grows by strictly
|
||||
# increasing appends, so concurrent readers' indices stay valid and concurrent
|
||||
# growers can't double-append the same line start
|
||||
scan_from = offsets[-1] if offsets else 0
|
||||
found = []
|
||||
with path.open("rb") as f:
|
||||
f.seek(scan_from)
|
||||
pos = scan_from
|
||||
for line in f:
|
||||
if line.strip():
|
||||
found.append(pos)
|
||||
pos += len(line)
|
||||
with _lock:
|
||||
cached_size, current = _lru_get(_offsets_cache, path) or (0, offsets)
|
||||
if cached_size > size:
|
||||
current = []
|
||||
for offset in found:
|
||||
if not current or offset > current[-1]:
|
||||
current.append(offset)
|
||||
_lru_put(_offsets_cache, path, (max(size, cached_size), current))
|
||||
return current
|
||||
|
||||
|
||||
def walk_timing(obj: dict, prefix: str, out: dict[str, float]) -> None:
|
||||
"""Flatten a trace timing tree to phase -> seconds (same walk as the viewer)."""
|
||||
if isinstance(obj.get("duration"), (int, float)):
|
||||
out[prefix] = out.get(prefix, 0.0) + obj["duration"]
|
||||
elif isinstance(obj.get("start"), (int, float)) and isinstance(obj.get("end"), (int, float)):
|
||||
out[prefix] = out.get(prefix, 0.0) + (obj["end"] - obj["start"])
|
||||
for key, value in obj.items():
|
||||
if isinstance(value, dict):
|
||||
walk_timing(value, f"{prefix}/{key}" if prefix else key, out)
|
||||
|
||||
|
||||
def summarize_episode(line: int, rec: dict) -> dict:
|
||||
rewards, advantages = [], []
|
||||
input_tokens = output_tokens = turns = branches = 0
|
||||
stop_condition = None
|
||||
reward_parts: dict[str, list[float]] = {}
|
||||
metric_parts: dict[str, list[float]] = {}
|
||||
timing: dict[str, float] = {}
|
||||
costs: list[float] = []
|
||||
for trace in rec.get("traces") or []:
|
||||
costs.extend(
|
||||
usage["cost"]
|
||||
for call in trace.get("calls") or []
|
||||
if isinstance(usage := call.get("usage") or {}, dict) and isinstance(usage.get("cost"), (int, float))
|
||||
)
|
||||
nodes = trace.get("nodes") or []
|
||||
parents = {node.get("parent") for node in nodes if "parent" in node}
|
||||
branches += max(0, len(nodes) - len(parents))
|
||||
if trace.get("rewards"): # skip reward-less seats (e.g. a judge) in the episode mean
|
||||
rewards.append(
|
||||
sum(
|
||||
(r.get("score") or 0) * (r.get("weight") if r.get("weight") is not None else 1)
|
||||
for r in trace["rewards"].values()
|
||||
if isinstance(r, dict)
|
||||
)
|
||||
)
|
||||
for name, r in (trace.get("rewards") or {}).items():
|
||||
if isinstance(r, dict) and isinstance(r.get("score"), (int, float)):
|
||||
reward_parts.setdefault(name, []).append(r["score"])
|
||||
for name, value in (trace.get("metrics") or {}).items():
|
||||
if isinstance(value, (int, float)):
|
||||
metric_parts.setdefault(name, []).append(value)
|
||||
if isinstance(trace.get("timing"), dict):
|
||||
walk_timing(trace["timing"], "", timing)
|
||||
advantage = (trace.get("info") or {}).get("advantage")
|
||||
if advantage is not None:
|
||||
advantages.append(advantage)
|
||||
for node in nodes:
|
||||
n_tokens = len(node.get("token_ids") or [])
|
||||
if node.get("sampled"):
|
||||
output_tokens += n_tokens
|
||||
else:
|
||||
input_tokens += n_tokens
|
||||
if (node.get("message") or {}).get("role") == "assistant":
|
||||
turns += 1
|
||||
stop_condition = trace.get("stop_condition", stop_condition)
|
||||
if input_tokens == 0 and output_tokens == 0: # some eval traces carry no token arrays
|
||||
for call in trace.get("calls") or []:
|
||||
usage = call.get("usage") or {}
|
||||
input_tokens += usage.get("prompt_tokens") or 0
|
||||
output_tokens += usage.get("completion_tokens") or 0
|
||||
return {
|
||||
"rewards": {name: sum(v) / len(v) for name, v in reward_parts.items()},
|
||||
"metrics": {name: sum(v) / len(v) for name, v in metric_parts.items()},
|
||||
"timing": timing,
|
||||
"cost": sum(costs) if costs else None,
|
||||
"line": line,
|
||||
"id": rec.get("id"),
|
||||
"env": (rec.get("env") or {}).get("id") or (rec.get("env") or {}).get("name"),
|
||||
"group": (rec.get("group") or {}).get("id"),
|
||||
"ok": rec.get("ok"),
|
||||
"num_errors": len(rec.get("errors") or []),
|
||||
"reward": sum(rewards) / len(rewards) if rewards else None,
|
||||
"advantage": sum(advantages) / len(advantages) if advantages else None,
|
||||
"input_tokens": input_tokens,
|
||||
"output_tokens": output_tokens,
|
||||
"turns": turns,
|
||||
"branches": branches,
|
||||
"stop_condition": stop_condition,
|
||||
}
|
||||
|
||||
|
||||
def episode_summaries(path: Path) -> list[dict]:
|
||||
offsets = line_offsets(path)
|
||||
with _lock:
|
||||
cached_count, summaries = _lru_get(_summaries_cache, path) or (0, [])
|
||||
if cached_count > len(offsets):
|
||||
cached_count, summaries = 0, []
|
||||
if cached_count == 0:
|
||||
loaded = load_sidecar(path)
|
||||
if loaded is not None:
|
||||
cached_count, summaries = len(loaded), loaded
|
||||
cached_count = min(cached_count, len(offsets))
|
||||
if cached_count == len(offsets):
|
||||
with _lock:
|
||||
_lru_put(_summaries_cache, path, (cached_count, summaries))
|
||||
return summaries[:cached_count] if len(summaries) != cached_count else summaries
|
||||
summaries = list(summaries[:cached_count])
|
||||
with path.open("rb") as f:
|
||||
f.seek(offsets[cached_count])
|
||||
for line_no in range(cached_count, len(offsets)):
|
||||
raw = f.readline()
|
||||
try:
|
||||
summaries.append(summarize_episode(line_no, orjson.loads(raw)))
|
||||
except orjson.JSONDecodeError:
|
||||
summaries.append({"line": line_no, "id": None, "error": "unparseable"})
|
||||
with _lock:
|
||||
_lru_put(_summaries_cache, path, (len(offsets), summaries))
|
||||
write_sidecar(path, offsets, summaries)
|
||||
return summaries
|
||||
|
||||
|
||||
# ------------------------------------------------------- summary sidecars
|
||||
# Parsing a step's traces file for the table can mean reading gigabytes; the
|
||||
# result is persisted outside the run dir (the dashboard never writes there),
|
||||
# so a revisit — or a dashboard restart — skips the parse entirely.
|
||||
SIDECAR_DIR = Path.home() / ".cache" / "prime-rl" / "dashboard"
|
||||
SIDECAR_WRITE_INTERVAL_S = 20.0
|
||||
_sidecar_written: dict[Path, tuple[float, int]] = {} # path -> (last write time, count)
|
||||
|
||||
|
||||
def sidecar_path(path: Path) -> Path:
|
||||
digest = hashlib.sha256(str(path.resolve()).encode()).hexdigest()[:24]
|
||||
return SIDECAR_DIR / f"{digest}.json"
|
||||
|
||||
|
||||
def load_sidecar(path: Path) -> list[dict] | None:
|
||||
data = read_json(sidecar_path(path))
|
||||
try:
|
||||
if data.get("path") != str(path.resolve()) or path.stat().st_size < data["size"]:
|
||||
return None # different file, or rewritten smaller (relaunch)
|
||||
return data["summaries"]
|
||||
except (KeyError, OSError):
|
||||
return None
|
||||
|
||||
|
||||
def write_sidecar(path: Path, offsets: list[int], summaries: list[dict]) -> None:
|
||||
now = time.monotonic()
|
||||
last_time, last_count = _sidecar_written.get(path, (0.0, -1))
|
||||
if len(summaries) == last_count or now - last_time < SIDECAR_WRITE_INTERVAL_S:
|
||||
return
|
||||
_sidecar_written[path] = (now, len(summaries))
|
||||
SIDECAR_DIR.mkdir(parents=True, exist_ok=True)
|
||||
consumed = offsets[len(summaries) - 1] if summaries else 0
|
||||
payload = {"path": str(path.resolve()), "size": consumed, "summaries": summaries}
|
||||
target = sidecar_path(path)
|
||||
tmp = target.with_suffix(".tmp")
|
||||
tmp.write_bytes(orjson.dumps(payload))
|
||||
tmp.replace(target)
|
||||
|
||||
|
||||
def traces_path(run: str, step: int, kind: str, subset: str) -> Path:
|
||||
if kind not in ("train", "eval") or subset not in ("all", "effective"):
|
||||
raise HTTPException(400, "kind must be train|eval, subset all|effective")
|
||||
run_dir = get_run_dir(run)
|
||||
path = run_dir / "rollouts" / f"step_{step}" / kind / subset / "traces.jsonl"
|
||||
if path.is_file():
|
||||
return path
|
||||
if (step, kind, subset) == EVAL_ROOT_STEP:
|
||||
root = eval_root_traces(run_dir)
|
||||
if root is not None:
|
||||
return root
|
||||
raise HTTPException(404, "no traces for this step/kind/subset")
|
||||
|
||||
|
||||
@app.get("/api/runs/{run}/rollouts")
|
||||
def list_rollouts(run: str) -> dict:
|
||||
return {"steps": rollout_steps(get_run_dir(run))}
|
||||
|
||||
|
||||
@app.get("/api/runs/{run}/rollouts/{step}/{kind}/{subset}")
|
||||
def list_episodes(
|
||||
run: str,
|
||||
step: int,
|
||||
kind: str,
|
||||
subset: str,
|
||||
limit: int = Query(default=5000, le=5000),
|
||||
env: str | None = None,
|
||||
errors_only: bool = False,
|
||||
sort: str = "line",
|
||||
order: str = "asc",
|
||||
etag: str | None = None,
|
||||
) -> dict:
|
||||
path = traces_path(run, step, kind, subset)
|
||||
current_etag, unchanged = size_etag(path, etag)
|
||||
if unchanged:
|
||||
return unchanged
|
||||
summaries = episode_summaries(path)
|
||||
envs = sorted({s["env"] for s in summaries if s.get("env")})
|
||||
if env:
|
||||
summaries = [s for s in summaries if s.get("env") == env]
|
||||
if errors_only:
|
||||
summaries = [s for s in summaries if s.get("num_errors") or not s.get("ok")]
|
||||
if sort in ("reward", "advantage", "output_tokens", "turns", "group"):
|
||||
summaries = sorted(summaries, key=lambda s: (s.get(sort) is None, s.get(sort) or 0), reverse=(order == "desc"))
|
||||
return {"total": len(summaries), "etag": current_etag, "envs": envs, "episodes": summaries[:limit]}
|
||||
|
||||
|
||||
def get_tokenizer(model: str):
|
||||
with _lock:
|
||||
if model in _tokenizer_cache:
|
||||
return _tokenizer_cache[model]
|
||||
try:
|
||||
from tokenizers import Tokenizer
|
||||
|
||||
tokenizer = Tokenizer.from_pretrained(model)
|
||||
except Exception:
|
||||
tokenizer = None
|
||||
with _lock:
|
||||
_tokenizer_cache[model] = tokenizer
|
||||
return tokenizer
|
||||
|
||||
|
||||
def decode_pieces(model: str, ids: list[int]) -> list[str] | None:
|
||||
tokenizer = get_tokenizer(model)
|
||||
if tokenizer is None:
|
||||
return None
|
||||
pieces = []
|
||||
for token_id in ids:
|
||||
piece = _piece_cache.get((model, token_id))
|
||||
if piece is None:
|
||||
piece = tokenizer.decode([token_id], skip_special_tokens=False)
|
||||
_piece_cache[(model, token_id)] = piece
|
||||
pieces.append(piece)
|
||||
return pieces
|
||||
|
||||
|
||||
@app.get("/api/runs/{run}/rollouts/{step}/{kind}/{subset}/series")
|
||||
def episode_series(run: str, step: int, kind: str, subset: str, etag: str | None = None, after: int = 0) -> dict:
|
||||
"""Per-episode series over a traces file (x = episode order): reward, shape, and the
|
||||
nested rewards/metrics/timing keys — the metrics view for eval runs. `after` returns
|
||||
only episodes past that index, so a growing file ships increments, not the world."""
|
||||
path = traces_path(run, step, kind, subset)
|
||||
current_etag, unchanged = size_etag(path, etag)
|
||||
if unchanged:
|
||||
return unchanged
|
||||
summaries = episode_summaries(path)
|
||||
keys: set[str] = set()
|
||||
for s in summaries:
|
||||
keys.update(
|
||||
k
|
||||
for k in ("reward", "advantage", "cost", "turns", "branches", "input_tokens", "output_tokens")
|
||||
if s.get(k) is not None
|
||||
)
|
||||
for group in ("rewards", "metrics", "timing"):
|
||||
keys.update(f"{group}/{name}" for name in s.get(group) or {})
|
||||
|
||||
def value(s: dict, key: str):
|
||||
group, _, name = key.partition("/")
|
||||
return (s.get(group) or {}).get(name) if name else s.get(key)
|
||||
|
||||
tail = summaries[max(0, after) :]
|
||||
series = {key: [value(s, key) for s in tail] for key in sorted(keys)}
|
||||
return {"etag": current_etag, "count": len(summaries), "after": max(0, after), "series": series}
|
||||
|
||||
|
||||
@app.get("/api/runs/{run}/rollouts/{step}/{kind}/{subset}/{line}")
|
||||
def get_episode(run: str, step: int, kind: str, subset: str, line: int, tokens: bool = False) -> dict:
|
||||
path = traces_path(run, step, kind, subset)
|
||||
offsets = line_offsets(path)
|
||||
if not 0 <= line < len(offsets):
|
||||
raise HTTPException(404, "episode line out of range")
|
||||
with path.open("rb") as f:
|
||||
f.seek(offsets[line])
|
||||
rec = orjson.loads(f.readline())
|
||||
if not tokens:
|
||||
return rec
|
||||
fallback_model = model_name(main_config(get_run_dir(run))[1])
|
||||
for trace in rec.get("traces") or []:
|
||||
client = ((trace.get("agent") or {}).get("config") or {}).get("client") or {}
|
||||
model = client.get("renderer_model_name") or fallback_model
|
||||
if not model:
|
||||
continue
|
||||
for node in trace.get("nodes") or []:
|
||||
if node.get("token_ids"):
|
||||
node["token_strs"] = decode_pieces(model, node["token_ids"])
|
||||
return rec
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------- static
|
||||
|
||||
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
|
||||
|
||||
|
||||
@app.get("/")
|
||||
def index() -> FileResponse:
|
||||
return FileResponse(STATIC_DIR / "index.html")
|
||||
|
||||
|
||||
def render_status(url: str):
|
||||
"""The startup console: the URL plus each tracked dir with its discovered runs."""
|
||||
from rich.text import Text
|
||||
|
||||
text = Text()
|
||||
text.append("\n prime-rl dashboard", style="bold white")
|
||||
text.append(" · ", style="dim")
|
||||
text.append(url + "\n", style="underline #B6FF3C")
|
||||
runs = scan_runs()
|
||||
for base in output_dirs:
|
||||
text.append(f"\n {base.resolve()}/\n", style="dim")
|
||||
names = sorted(name for name, run_dir in runs.items() if run_dir.parent == base) or ["(no runs yet)"]
|
||||
for i, name in enumerate(names):
|
||||
connector = "└── " if i == len(names) - 1 else "├── "
|
||||
text.append(f" {connector}{name}\n", style="dim")
|
||||
return text
|
||||
|
||||
|
||||
def free_port(host: str, start: int) -> int:
|
||||
"""The first free port at or above `start`, so several dashboards on one node
|
||||
(e.g. a cluster head node) never collide."""
|
||||
import socket
|
||||
|
||||
for port in range(start, start + 100):
|
||||
with socket.socket() as sock:
|
||||
try:
|
||||
sock.bind((host, port))
|
||||
except OSError:
|
||||
continue
|
||||
return port
|
||||
raise SystemExit(f"no free port in [{start}, {start + 100})")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
global output_dirs
|
||||
parser = argparse.ArgumentParser(description="prime-rl run dashboard")
|
||||
parser.add_argument("output_dirs", nargs="*", default=[Path("outputs")], type=Path, metavar="output_dir")
|
||||
parser.add_argument("--port", type=int, default=7788)
|
||||
parser.add_argument("--host", default="127.0.0.1")
|
||||
args = parser.parse_args()
|
||||
output_dirs = [d for d in args.output_dirs if d.is_dir()]
|
||||
for missing in set(args.output_dirs) - set(output_dirs):
|
||||
print(f"warning: output dir {missing} does not exist", file=sys.stderr)
|
||||
if not output_dirs:
|
||||
raise SystemExit("no existing output dir given")
|
||||
port = free_port(args.host, args.port)
|
||||
if port != args.port:
|
||||
print(f"port {args.port} is taken - serving on {port}", file=sys.stderr)
|
||||
args.port = port
|
||||
url = f"http://localhost:{args.port}"
|
||||
live = None
|
||||
stop = threading.Event()
|
||||
if sys.stdout.isatty():
|
||||
# live console: re-scan every few seconds so new runs show up as tracked
|
||||
from rich.console import Console
|
||||
from rich.live import Live
|
||||
|
||||
live = Live(render_status(url), console=Console(), refresh_per_second=1)
|
||||
live.start()
|
||||
|
||||
def watch() -> None:
|
||||
while not stop.wait(3):
|
||||
live.update(render_status(url))
|
||||
|
||||
threading.Thread(target=watch, daemon=True).start()
|
||||
else:
|
||||
dirs = ", ".join(str(d.resolve()) for d in output_dirs)
|
||||
print(f"\n prime-rl dashboard · {dirs}\n {url}\n", flush=True)
|
||||
try:
|
||||
# short graceful-shutdown window: a Ctrl-C must not hang on the browser's
|
||||
# open keep-alive connections
|
||||
uvicorn.run(app, host=args.host, port=args.port, log_level="warning", timeout_graceful_shutdown=2)
|
||||
finally:
|
||||
# always unwind the Live display - it hides the terminal cursor, and an
|
||||
# interrupt that skips its exit path would leave the shell cursorless
|
||||
stop.set()
|
||||
if live is not None:
|
||||
live.stop()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 7.4 KiB |
@@ -0,0 +1,199 @@
|
||||
<!-- This package is fully AI-generated and maintained by agents - it is not meant to be read or edited by humans. Change it by asking an agent, and verify through the browser smoke tests. -->
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>prime-rl dashboard</title>
|
||||
<link rel="icon" href="/static/butterfly-white.svg">
|
||||
<link rel="stylesheet" href="/static/vendor/uPlot.min.css">
|
||||
<link rel="stylesheet" href="/static/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<header id="topbar">
|
||||
<div class="brand">
|
||||
<img src="/static/butterfly-white.svg" alt="Prime Intellect">
|
||||
</div>
|
||||
<select id="run-select" title="run"></select>
|
||||
<div id="compare-wrap" class="dd-wrap">
|
||||
<button id="compare-btn" class="btn dd-btn">compare</button>
|
||||
<div id="compare-menu" class="dd-menu" hidden></div>
|
||||
</div>
|
||||
<nav id="tabs">
|
||||
<button data-tab="config">Config</button>
|
||||
<button data-tab="metrics" class="active">Metrics</button>
|
||||
<button data-tab="traces">Traces</button>
|
||||
<button data-tab="logs">Logs</button>
|
||||
</nav>
|
||||
<label class="toggle" title="poll for updates"><input type="checkbox" id="live-toggle" checked><span class="dot"></span>live</label>
|
||||
</header>
|
||||
|
||||
<div id="run-overview"></div>
|
||||
|
||||
<main>
|
||||
<section id="tab-metrics">
|
||||
<div class="controls">
|
||||
<div class="seg" id="metrics-mode">
|
||||
<button data-mode="overview" class="active">Overview</button>
|
||||
<button data-mode="all">All</button>
|
||||
</div>
|
||||
<input id="metrics-search" class="search" type="search" placeholder="regex filter, e.g. ^entropy/ or reward">
|
||||
<label class="ctl">smooth <input id="smooth-range" type="range" min="1" max="50" value="1"><span id="smooth-val">off</span></label>
|
||||
<span id="metrics-status" class="muted"></span>
|
||||
<div class="spacer"></div>
|
||||
<div class="seg" id="all-layout" hidden>
|
||||
<button data-layout="flat">Flat</button>
|
||||
<button data-layout="nested">Nested</button>
|
||||
</div>
|
||||
<button id="metrics-collapse" class="btn">collapse</button>
|
||||
<button id="metrics-expand" class="btn">expand</button>
|
||||
</div>
|
||||
<div id="metrics-body"></div>
|
||||
</section>
|
||||
|
||||
<section id="tab-config" hidden>
|
||||
<div class="controls">
|
||||
<div class="seg" id="config-format">
|
||||
<button data-fmt="toml">TOML</button>
|
||||
<button data-fmt="json">JSON</button>
|
||||
</div>
|
||||
<input id="config-search" class="search" type="search" placeholder="regex search, e.g. lora|lr">
|
||||
<span id="config-hits" class="muted"></span>
|
||||
</div>
|
||||
<pre id="config-view"></pre>
|
||||
</section>
|
||||
|
||||
<section id="tab-traces" hidden>
|
||||
<div class="controls" id="step-bar">
|
||||
<button id="step-prev" class="btn tm-nav" title="previous step">‹</button>
|
||||
<div id="step-blocks"></div>
|
||||
<button id="step-next" class="btn tm-nav" title="next step">›</button>
|
||||
<span id="step-label" class="t-label"></span>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<div class="seg" id="trace-kind">
|
||||
<button data-kind="train" class="active">Train</button>
|
||||
<button data-kind="eval">Eval</button>
|
||||
</div>
|
||||
<div class="seg" id="trace-subset">
|
||||
<button data-subset="all">All</button>
|
||||
<button data-subset="effective" class="active">Effective</button>
|
||||
</div>
|
||||
<span id="trace-status" class="muted"></span>
|
||||
<div class="spacer"></div>
|
||||
<div id="trace-filter-wrap" class="dd-wrap">
|
||||
<button id="trace-filter-btn" class="btn dd-btn" title="filter & sort">
|
||||
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 5h18l-7 8v6l-4-2v-4L3 5z"></path></svg>
|
||||
filter
|
||||
</button>
|
||||
<div id="trace-filter-menu" class="dd-menu" hidden>
|
||||
<label class="t-label">env</label>
|
||||
<select id="trace-env"><option value="">all envs</option></select>
|
||||
<label class="t-label">sort</label>
|
||||
<select id="trace-sort">
|
||||
<option value="line:asc">order: arrival</option>
|
||||
<option value="reward:desc">reward ↓</option>
|
||||
<option value="reward:asc">reward ↑</option>
|
||||
<option value="advantage:desc">advantage ↓</option>
|
||||
<option value="advantage:asc">advantage ↑</option>
|
||||
<option value="output_tokens:desc">tokens ↓</option>
|
||||
<option value="group:asc">group</option>
|
||||
</select>
|
||||
<label class="toggle"><input type="checkbox" id="trace-errors"><span class="dot"></span>errors only</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="trace-empty" hidden></div>
|
||||
<div id="episode-table-wrap">
|
||||
<table id="episode-table">
|
||||
<thead><tr>
|
||||
<th>#</th><th>env</th><th>group</th><th>reward</th><th>adv</th>
|
||||
<th>tok</th><th>turns</th><th>branches</th><th>stop</th><th>status</th>
|
||||
</tr></thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="tab-logs" hidden>
|
||||
<div class="controls">
|
||||
<label class="t-label">attempt</label>
|
||||
<select id="attempt-select"></select>
|
||||
<div id="log-comp-wrap" class="dd-wrap">
|
||||
<button id="log-comp-btn" class="btn dd-btn">components</button>
|
||||
<div id="log-comp-menu" class="dd-menu" hidden></div>
|
||||
</div>
|
||||
<div class="seg" id="log-view">
|
||||
<button data-view="merge" class="active">Merge</button>
|
||||
<button data-view="split">Split</button>
|
||||
</div>
|
||||
<div class="stepper" id="log-level" title="minimum log level">
|
||||
<button id="log-level-down" title="more verbose">‹</button>
|
||||
<span id="log-level-label">all</span>
|
||||
<button id="log-level-up" title="less verbose">›</button>
|
||||
</div>
|
||||
<input id="log-search" class="search" type="search" placeholder="regex filter, e.g. ERROR|WARN">
|
||||
<button id="log-older" class="btn">load older</button>
|
||||
</div>
|
||||
<div id="log-panes"></div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<div id="drawer-backdrop" hidden></div>
|
||||
<div id="trace-modal" hidden>
|
||||
<aside id="tm-left">
|
||||
<div class="tm-head tm-stephead">
|
||||
<button id="tm-step-prev" class="btn tm-nav" title="previous step">‹</button>
|
||||
<span id="tm-step-label"></span>
|
||||
<button id="tm-step-next" class="btn tm-nav" title="next step">›</button>
|
||||
</div>
|
||||
<div class="tm-head tm-filterhead">
|
||||
<div class="seg" id="tm-kind">
|
||||
<button data-kind="train">Train</button>
|
||||
<button data-kind="eval">Eval</button>
|
||||
</div>
|
||||
<div class="seg" id="tm-subset">
|
||||
<button data-subset="all">All</button>
|
||||
<button data-subset="effective">Effective</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tm-head">
|
||||
<span class="t-label">episodes</span>
|
||||
<span id="tm-count" class="badge"></span>
|
||||
<div class="spacer"></div>
|
||||
<button id="tm-prev" class="btn tm-nav" title="previous episode">↑</button>
|
||||
<button id="tm-next" class="btn tm-nav" title="next episode">↓</button>
|
||||
</div>
|
||||
<div id="tm-list"></div>
|
||||
</aside>
|
||||
<section id="tm-main">
|
||||
<div class="tm-head">
|
||||
<span class="tm-title">Trace Viewer</span>
|
||||
<div class="spacer"></div>
|
||||
<select id="token-signal">
|
||||
<option value="">text view</option>
|
||||
<option value="advantage">tokens: advantage</option>
|
||||
<option value="logprob">tokens: logprob</option>
|
||||
<option value="mask">tokens: mask</option>
|
||||
<option value="is_content">tokens: is_content</option>
|
||||
</select>
|
||||
<button id="tm-collapse" class="btn">collapse</button>
|
||||
<button id="tm-expand" class="btn">expand</button>
|
||||
<button id="drawer-close" class="btn">✕</button>
|
||||
</div>
|
||||
<div class="tm-head tm-tabs-row" id="tm-tabs-row" hidden>
|
||||
<div id="tm-trace-tabs" class="seg" hidden></div>
|
||||
<div id="tm-branch-tabs" class="seg" hidden></div>
|
||||
</div>
|
||||
<div id="tm-messages"></div>
|
||||
</section>
|
||||
<aside id="tm-right">
|
||||
<div class="tm-head"><span class="tm-title">Overview</span></div>
|
||||
<div id="tm-meta"></div>
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
<script src="/static/vendor/uPlot.iife.min.js"></script>
|
||||
<script src="/static/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,803 @@
|
||||
/* This package is fully AI-generated and maintained by agents - it is not meant to be read or edited by humans. Change it by asking an agent, and verify through the browser smoke tests.
|
||||
|
||||
Prime Intellect design language (prime-context: colors_and_type.css / brand.md).
|
||||
Mono dominant, #111 canvas, lime accent used categorically, hairline dividers,
|
||||
border-radius 0 everywhere, no shadows or gradients. ABC Favorit Mono is licensed
|
||||
and not vendored here; the stack falls back to JetBrains Mono / system mono. */
|
||||
|
||||
:root {
|
||||
--grey-1: #111111;
|
||||
--grey-2: #1c1c1c;
|
||||
--grey-3: #3a3a3a;
|
||||
--grey-4: #767676;
|
||||
--grey-5: #bcbcbc;
|
||||
--grey-6: #ffffff;
|
||||
|
||||
--accent: #b6ff3c;
|
||||
--negative: #ff4539;
|
||||
--positive: #b6ff3c;
|
||||
--infra: #4a9eff;
|
||||
--risk: #ff6b4a;
|
||||
|
||||
--chart-1: #78f8a5;
|
||||
--chart-2: #b7a6fa;
|
||||
--chart-3: #fcdaa4;
|
||||
|
||||
--hairline: rgba(255, 255, 255, 0.1);
|
||||
--hairline-faint: rgba(255, 255, 255, 0.06);
|
||||
|
||||
--font-mono: "ABC Favorit Mono", "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
|
||||
|
||||
--track-mono: 0.04em;
|
||||
--track-caps: 0.12em;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
[hidden] { display: none !important; }
|
||||
summary { list-style: none; cursor: pointer; user-select: none; }
|
||||
summary::-webkit-details-marker { display: none; }
|
||||
html, body { height: 100%; }
|
||||
body {
|
||||
margin: 0;
|
||||
background: var(--grey-1);
|
||||
color: var(--grey-5);
|
||||
font: 400 13px/1.5 var(--font-mono);
|
||||
letter-spacing: var(--track-mono);
|
||||
font-variant-numeric: tabular-nums lining-nums;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.muted { color: var(--grey-4); font-size: 11px; }
|
||||
.spacer { flex: 1; }
|
||||
|
||||
/* mono caps label — the house label style */
|
||||
.t-label {
|
||||
font-size: 11px;
|
||||
letter-spacing: var(--track-caps);
|
||||
text-transform: uppercase;
|
||||
color: var(--grey-4);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------- topbar */
|
||||
#topbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
padding: 0 20px;
|
||||
height: 52px;
|
||||
border-bottom: 1px solid var(--hairline);
|
||||
background: var(--grey-1);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 20;
|
||||
}
|
||||
.brand { display: flex; align-items: center; gap: 10px; user-select: none; }
|
||||
.brand img { height: 18px; display: block; }
|
||||
#tabs { display: flex; gap: 2px; margin-left: 8px; align-self: stretch; }
|
||||
#tabs button {
|
||||
background: none;
|
||||
border: none;
|
||||
border-bottom: 1px solid transparent;
|
||||
margin-bottom: -1px;
|
||||
color: var(--grey-4);
|
||||
font: 400 11px var(--font-mono);
|
||||
letter-spacing: var(--track-caps);
|
||||
text-transform: uppercase;
|
||||
padding: 0 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
#tabs button:hover { color: var(--grey-6); }
|
||||
#tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
|
||||
#topbar .toggle { margin-left: auto; }
|
||||
|
||||
select, .search, .btn {
|
||||
background: transparent;
|
||||
color: var(--grey-5);
|
||||
border: 1px solid var(--grey-3);
|
||||
border-radius: 0;
|
||||
height: 28px;
|
||||
padding: 0 10px;
|
||||
font: 400 12px var(--font-mono);
|
||||
letter-spacing: var(--track-mono);
|
||||
outline: none;
|
||||
}
|
||||
/* flat selects: no native chrome, hairline chevron */
|
||||
select {
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
background-color: var(--grey-1);
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' fill='none' stroke='%23767676' stroke-width='1.2'/%3E%3C/svg%3E");
|
||||
background-repeat: no-repeat;
|
||||
background-position: right 9px center;
|
||||
padding-right: 26px;
|
||||
cursor: pointer;
|
||||
}
|
||||
select:hover { border-color: var(--grey-6); color: var(--grey-6); }
|
||||
option { background: var(--grey-1); color: var(--grey-5); }
|
||||
select:focus, .search:focus { border-color: var(--grey-6); }
|
||||
|
||||
/* dropdown-opening buttons carry a caret; menus share one flat panel style */
|
||||
.dd-btn { display: inline-flex; align-items: center; gap: 6px; }
|
||||
.dd-btn::after {
|
||||
content: "";
|
||||
width: 8px;
|
||||
height: 5px;
|
||||
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' fill='none' stroke='%23767676' stroke-width='1.2'/%3E%3C/svg%3E") no-repeat center;
|
||||
}
|
||||
.dd-wrap { position: relative; }
|
||||
.dd-btn.active { color: var(--accent); border-color: var(--accent); }
|
||||
/* selects dressed as dropdowns: lowercase label with ellipsis, scrollable options */
|
||||
.dd-select .dd-btn { text-transform: none; letter-spacing: var(--track-mono); font-size: 12px; max-width: 340px; }
|
||||
.dd-select .dd-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.dd-optlist { min-width: 100%; max-height: 320px; overflow-y: auto; padding: 4px 0; white-space: nowrap; }
|
||||
.dd-opt { padding: 5px 12px; font-size: 12px; cursor: pointer; color: var(--grey-5); }
|
||||
.dd-opt:hover { background: var(--grey-2); color: var(--grey-6); }
|
||||
.dd-opt.active { color: var(--accent); }
|
||||
.dd-opt.disabled { color: var(--grey-3); cursor: default; }
|
||||
.dd-menu {
|
||||
position: absolute;
|
||||
top: 34px;
|
||||
z-index: 40;
|
||||
background: var(--grey-1);
|
||||
border: 1px solid var(--grey-3);
|
||||
padding: 8px;
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
.btn {
|
||||
cursor: pointer;
|
||||
text-transform: uppercase;
|
||||
font-size: 11px;
|
||||
letter-spacing: var(--track-caps);
|
||||
color: var(--grey-5);
|
||||
}
|
||||
.btn:hover { border-color: var(--grey-6); color: var(--grey-6); }
|
||||
.btn:active { background: rgba(255, 255, 255, 0.04); }
|
||||
#run-select { max-width: 340px; font-size: 12px; }
|
||||
|
||||
.badge {
|
||||
font: 400 10px var(--font-mono);
|
||||
letter-spacing: var(--track-caps);
|
||||
text-transform: uppercase;
|
||||
padding: 3px 8px;
|
||||
border: 1px solid var(--grey-3);
|
||||
border-radius: 0;
|
||||
color: var(--grey-5);
|
||||
}
|
||||
|
||||
/* run overview card — platform-style run header shown on every tab */
|
||||
#run-overview {
|
||||
padding: 16px 20px 14px;
|
||||
border-bottom: 1px solid var(--hairline);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
}
|
||||
.ov-top { display: flex; align-items: flex-end; gap: 48px; flex-wrap: wrap; }
|
||||
.ov-field { display: flex; flex-direction: column; gap: 6px; }
|
||||
.ov-field .lbl {
|
||||
font-size: 10px;
|
||||
letter-spacing: var(--track-caps);
|
||||
text-transform: uppercase;
|
||||
color: var(--grey-4);
|
||||
}
|
||||
.ov-field .val {
|
||||
font-size: 13px;
|
||||
color: var(--grey-6);
|
||||
max-width: 280px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.st-running { color: var(--accent); border-color: rgba(182, 255, 60, 0.5); background: rgba(182, 255, 60, 0.08); }
|
||||
.st-completed { color: var(--chart-1); border-color: rgba(120, 248, 165, 0.4); }
|
||||
.st-stopped { color: var(--grey-4); }
|
||||
/* slider controls (smoothing, pane size) */
|
||||
.ctl {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 10px;
|
||||
letter-spacing: var(--track-caps);
|
||||
text-transform: uppercase;
|
||||
color: var(--grey-4);
|
||||
}
|
||||
.ctl input[type="range"] { width: 110px; accent-color: var(--accent); }
|
||||
.ctl span { color: var(--grey-5); min-width: 24px; }
|
||||
|
||||
.toggle {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
cursor: pointer;
|
||||
color: var(--grey-4);
|
||||
font-size: 11px;
|
||||
letter-spacing: var(--track-caps);
|
||||
text-transform: uppercase;
|
||||
user-select: none;
|
||||
}
|
||||
.toggle input { display: none; }
|
||||
.toggle .dot { width: 10px; height: 10px; border: 1px solid var(--grey-3); background: transparent; }
|
||||
.toggle input:checked + .dot { background: var(--accent); border-color: var(--accent); }
|
||||
|
||||
/* the LIVE indicator is a pulsing circle */
|
||||
#topbar .toggle .dot { width: 7px; height: 7px; border-radius: 50%; }
|
||||
#topbar .toggle input:checked + .dot { animation: live-pulse 2s ease-out infinite; }
|
||||
@keyframes live-pulse {
|
||||
0% { box-shadow: 0 0 0 0 rgba(182, 255, 60, 0.55); }
|
||||
70% { box-shadow: 0 0 0 5px rgba(182, 255, 60, 0); }
|
||||
100% { box-shadow: 0 0 0 0 rgba(182, 255, 60, 0); }
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ main */
|
||||
main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
|
||||
main > section { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 16px 20px; gap: 12px; }
|
||||
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
|
||||
|
||||
.seg { display: inline-flex; border: 1px solid var(--grey-3); flex-shrink: 0; }
|
||||
/* arrow stepper (log level): ‹ label › */
|
||||
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--grey-3); height: 28px; }
|
||||
.stepper button { background: none; border: none; color: var(--grey-4); width: 24px; height: 100%; cursor: pointer; font: 400 13px var(--font-mono); }
|
||||
.stepper button:hover:not(:disabled) { color: var(--grey-6); }
|
||||
.stepper button:disabled { opacity: 0.3; cursor: default; }
|
||||
.stepper span {
|
||||
font-size: 11px;
|
||||
letter-spacing: var(--track-caps);
|
||||
text-transform: uppercase;
|
||||
color: var(--grey-5);
|
||||
min-width: 52px;
|
||||
text-align: center;
|
||||
}
|
||||
.seg button {
|
||||
white-space: nowrap;
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: var(--grey-4);
|
||||
height: 26px;
|
||||
padding: 0 12px;
|
||||
font: 400 11px var(--font-mono);
|
||||
letter-spacing: var(--track-caps);
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
}
|
||||
.seg button + button { border-left: 1px solid var(--grey-3); }
|
||||
.seg button.active { background: var(--grey-2); color: var(--accent); }
|
||||
.seg button:disabled { opacity: 0.35; cursor: default; }
|
||||
|
||||
/* checkbox rows (compare menu, filter menus) */
|
||||
.file-item { display: flex; align-items: center; gap: 8px; padding: 3px 4px; cursor: pointer; font-size: 11px; }
|
||||
.file-item:hover { background: var(--grey-2); }
|
||||
.file-item input { appearance: none; width: 9px; height: 9px; border: 1px solid var(--grey-3); margin: 0; flex-shrink: 0; }
|
||||
.file-item input:checked { background: var(--accent); border-color: var(--accent); }
|
||||
|
||||
/* multi-run compare menu */
|
||||
#compare-menu {
|
||||
left: 0;
|
||||
min-width: 320px;
|
||||
max-height: 50vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------- metrics */
|
||||
/* stable gutter: no layout shift when collapsing sections hides the scrollbar */
|
||||
#metrics-body { flex: 1; overflow-y: auto; scrollbar-gutter: stable; min-height: 0; padding-right: 10px; }
|
||||
.chart-card.dragging { opacity: 0.45; }
|
||||
/* one 12px rhythm everywhere: section-to-section, header-to-panes, pane-to-pane */
|
||||
details.section { margin-bottom: 12px; }
|
||||
/* nested sections (all-mode key tree) indent one step */
|
||||
details.section details.section { margin-left: 14px; }
|
||||
details.section:not([open]) > summary { margin-bottom: 0; }
|
||||
/* section headers are full-width bars so the clickable region is obvious */
|
||||
details.section > summary {
|
||||
font: 400 11px var(--font-mono);
|
||||
letter-spacing: var(--track-caps);
|
||||
text-transform: uppercase;
|
||||
color: var(--grey-5);
|
||||
margin: 0 0 12px;
|
||||
padding: 7px 12px;
|
||||
background: var(--grey-2);
|
||||
border: 1px solid var(--hairline);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
details.section > summary:hover { color: var(--grey-6); border-color: var(--grey-3); }
|
||||
details.section .sec-chev { margin-left: auto; transition: transform 0.12s; font-size: 10px; color: var(--grey-4); }
|
||||
details.section[open] .sec-chev { transform: rotate(90deg); }
|
||||
.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--pane-min, 260px), 1fr)); gap: 12px; }
|
||||
/* eval runs: running-average stat cards instead of x/y chart panes */
|
||||
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
|
||||
.stat-card { background: var(--grey-2); border: 1px solid var(--hairline); padding: 12px 14px; min-width: 0; }
|
||||
.stat-card:hover { border-color: var(--grey-3); }
|
||||
.stat-label {
|
||||
font-size: 10px;
|
||||
letter-spacing: var(--track-caps);
|
||||
text-transform: uppercase;
|
||||
color: var(--grey-4);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.stat-value { font-size: 20px; color: var(--grey-6); margin: 6px 0 0; }
|
||||
.eval-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
|
||||
.ep-bar { flex: 1; height: 6px; background: var(--grey-2); border: 1px solid var(--hairline); }
|
||||
.ep-fill { height: 100%; background: var(--accent); }
|
||||
.ep-label {
|
||||
font-size: 10px;
|
||||
letter-spacing: var(--track-caps);
|
||||
text-transform: uppercase;
|
||||
color: var(--grey-4);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.chart-card {
|
||||
position: relative;
|
||||
background: var(--grey-2);
|
||||
border: 1px solid var(--hairline);
|
||||
padding: 8px 10px 8px;
|
||||
min-width: 0;
|
||||
}
|
||||
.chart-card:hover { border-color: var(--grey-3); }
|
||||
.chart-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 2px; cursor: grab; }
|
||||
.chart-title {
|
||||
font-size: 10px;
|
||||
letter-spacing: var(--track-mono);
|
||||
color: var(--grey-4);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
flex: 1;
|
||||
}
|
||||
.chart-last { font-size: 12px; font-weight: 500; color: var(--grey-6); }
|
||||
.chart-empty {
|
||||
height: 120px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--grey-4);
|
||||
font-size: 11px;
|
||||
letter-spacing: var(--track-caps);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
/* minimal empty state, shared by every "nothing here" case: just dim text */
|
||||
.empty-box {
|
||||
margin: 64px auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
text-align: center;
|
||||
white-space: normal;
|
||||
}
|
||||
.empty-title {
|
||||
font-size: 11px;
|
||||
letter-spacing: var(--track-caps);
|
||||
text-transform: uppercase;
|
||||
color: var(--grey-4);
|
||||
}
|
||||
.empty-detail {
|
||||
font-size: 11px;
|
||||
letter-spacing: var(--track-mono);
|
||||
color: var(--grey-4);
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.u-cursor-pt { display: none !important; }
|
||||
/* hover highlight dot on the snapped data point */
|
||||
.u-dot {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
pointer-events: none;
|
||||
will-change: transform;
|
||||
}
|
||||
/* drag-to-zoom selection highlight */
|
||||
.u-select { background: rgba(182, 255, 60, 0.1); outline: 1px solid rgba(182, 255, 60, 0.35); }
|
||||
|
||||
/* hover popover with x/y values */
|
||||
.u-tip {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 5;
|
||||
pointer-events: none;
|
||||
background: var(--grey-1);
|
||||
border: 1px solid var(--grey-3);
|
||||
padding: 6px 9px;
|
||||
font: 10.5px var(--font-mono);
|
||||
letter-spacing: var(--track-mono);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.u-tip-x {
|
||||
color: var(--grey-4);
|
||||
font-size: 9.5px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: var(--track-caps);
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
.u-tip-row { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
|
||||
.u-tip-row .sw { width: 7px; height: 7px; flex-shrink: 0; }
|
||||
.u-tip-row .sw-band { border: 1px dotted; background: transparent; }
|
||||
.u-tip-l { color: var(--grey-4); }
|
||||
.u-tip-v { color: var(--grey-6); margin-left: auto; padding-left: 10px; }
|
||||
|
||||
|
||||
/* metrics regex filter (overview + all) */
|
||||
#metrics-search, #config-search, #log-search { flex: 1; max-width: 460px; }
|
||||
|
||||
/* wandb-style resize handles on every chart card: right edge = width, bottom
|
||||
edge = height, corner = both. Resizing one pane resizes all of them. */
|
||||
.rz { position: absolute; opacity: 0; }
|
||||
.chart-card:hover .rz { opacity: 1; }
|
||||
.rz-e { top: 0; right: 0; bottom: 16px; width: 6px; cursor: ew-resize; }
|
||||
.rz-s { left: 0; right: 16px; bottom: 0; height: 6px; cursor: ns-resize; }
|
||||
.rz-e:hover, .rz-s:hover { background: rgba(255, 255, 255, 0.08); }
|
||||
.rz-se {
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
cursor: nwse-resize;
|
||||
background:
|
||||
linear-gradient(135deg, transparent 0 50%, var(--grey-3) 50% calc(50% + 1px), transparent calc(50% + 1px) 100%) no-repeat 3px 3px / 10px 10px,
|
||||
linear-gradient(135deg, transparent 0 50%, var(--grey-3) 50% calc(50% + 1px), transparent calc(50% + 1px) 100%) no-repeat 7px 7px / 10px 10px;
|
||||
}
|
||||
body.resizing { user-select: none; }
|
||||
|
||||
/* ---------------------------------------------------------------- config */
|
||||
#config-view {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
background: var(--grey-2);
|
||||
border: 1px solid var(--hairline);
|
||||
padding: 14px 16px;
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
line-height: 1.55;
|
||||
white-space: normal;
|
||||
}
|
||||
/* collapsible JSON tree */
|
||||
#config-view .j-line { white-space: pre; padding: 0 6px; }
|
||||
/* TOML (launch config) lines: whitespace preserved, minimal highlighting */
|
||||
#config-view .t-line { white-space: pre-wrap; padding: 0 6px; min-height: 1.55em; }
|
||||
#config-view .t-line:hover { background: rgba(255, 255, 255, 0.05); }
|
||||
.t-section { color: var(--accent); }
|
||||
#config-view div.j-line:hover, #config-view summary.j-line:hover { background: rgba(255, 255, 255, 0.05); }
|
||||
.j-ellip { color: var(--grey-4); }
|
||||
details.j-fold[open] > summary .j-ellip { display: none; }
|
||||
mark.hit {
|
||||
background: rgba(182, 255, 60, 0.22);
|
||||
color: var(--grey-6);
|
||||
outline: 1px solid rgba(182, 255, 60, 0.4);
|
||||
}
|
||||
.j-key { color: var(--grey-6); }
|
||||
.j-str { color: var(--chart-1); }
|
||||
.j-num { color: var(--chart-2); }
|
||||
.j-lit { color: var(--chart-3); }
|
||||
.j-punc { color: var(--grey-4); }
|
||||
|
||||
/* ------------------------------------------------------------------ logs */
|
||||
/* vertical stack of component panes (trainer / orchestrator / inference / envs) */
|
||||
/* split view always fills the tab: panes share the height equally */
|
||||
#log-panes { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
|
||||
.log-pane {
|
||||
flex: 1 1 0;
|
||||
min-height: 80px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border: 1px solid var(--hairline);
|
||||
background: var(--grey-1);
|
||||
min-width: 0;
|
||||
}
|
||||
#log-panes.maxed { overflow: hidden; }
|
||||
#log-panes.maxed .log-pane { display: none; }
|
||||
#log-panes.maxed .log-pane.maximized { display: flex; flex: 1; height: auto; }
|
||||
#log-comp-menu {
|
||||
left: 0;
|
||||
min-width: 220px;
|
||||
}
|
||||
.log-pane-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 5px 10px;
|
||||
border-bottom: 1px solid var(--hairline);
|
||||
background: var(--grey-2);
|
||||
}
|
||||
.lp-title {
|
||||
font-size: 10px;
|
||||
font-weight: 500;
|
||||
letter-spacing: var(--track-caps);
|
||||
text-transform: uppercase;
|
||||
color: var(--grey-5);
|
||||
}
|
||||
.lp-file { height: 24px; font-size: 11px; max-width: 280px; }
|
||||
.lp-count { font-size: 10px; color: var(--grey-4); }
|
||||
.lp-max { height: 24px; padding: 0 8px; }
|
||||
.log-pane-stream {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
padding: 8px 12px;
|
||||
font-size: 11.5px;
|
||||
line-height: 1.55;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
font-family: var(--font-mono);
|
||||
}
|
||||
.ll { display: flex; gap: 8px; }
|
||||
.ll:hover { background: var(--grey-2); }
|
||||
.ll .ltext { flex: 1; min-width: 0; }
|
||||
/* merge view: right-aligned component badge column */
|
||||
.ll .lgb {
|
||||
flex-shrink: 0;
|
||||
width: 112px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: flex-start;
|
||||
padding-top: 1px;
|
||||
user-select: none;
|
||||
}
|
||||
.ll .lgb-badge {
|
||||
font-size: 9px;
|
||||
letter-spacing: var(--track-caps);
|
||||
text-transform: uppercase;
|
||||
color: var(--grey-4);
|
||||
background: var(--grey-2);
|
||||
border: 1px solid var(--hairline);
|
||||
padding: 0 5px;
|
||||
line-height: 14px;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* ANSI — mapped onto the PI palette */
|
||||
.a-bold { font-weight: 500; color: var(--grey-6); }
|
||||
.a-dim { opacity: 0.55; }
|
||||
.fg30 { color: var(--grey-3); } .fg31 { color: var(--negative); } .fg32 { color: var(--chart-1); }
|
||||
.fg33 { color: var(--chart-3); } .fg34 { color: var(--infra); } .fg35 { color: var(--chart-2); }
|
||||
.fg36 { color: #7adfff; } .fg37 { color: var(--grey-5); }
|
||||
.fg90 { color: var(--grey-4); } .fg91 { color: var(--risk); } .fg92 { color: var(--chart-1); }
|
||||
.fg93 { color: var(--chart-3); } .fg94 { color: var(--infra); } .fg95 { color: var(--chart-2); }
|
||||
.fg96 { color: #7adfff; } .fg97 { color: var(--grey-6); }
|
||||
|
||||
/* ---------------------------------------------------------------- traces */
|
||||
/* step selector: one block per rollout step, filled up to the selection */
|
||||
#step-blocks { flex: 1; display: flex; gap: 2px; height: 16px; min-width: 0; margin-bottom: 4px; }
|
||||
.sb-cell { position: relative; flex: 1; min-width: 0; background: var(--grey-2); border: 1px solid var(--hairline); cursor: pointer; }
|
||||
.sb-cell:hover { border-color: var(--grey-6); }
|
||||
.sb-cell.on { background: var(--accent); border-color: var(--accent); }
|
||||
/* eval steps carry a small dot under the block (same mark as the step label) */
|
||||
.sb-cell.eval::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
bottom: -6px;
|
||||
width: 3px;
|
||||
height: 3px;
|
||||
margin-left: -1.5px;
|
||||
border-radius: 50%;
|
||||
background: var(--grey-5);
|
||||
}
|
||||
.sb-cell.eval:hover::after { background: var(--grey-6); }
|
||||
#trace-filter-menu {
|
||||
right: 0;
|
||||
min-width: 240px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
#step-label { display: inline-flex; align-items: center; gap: 7px; color: var(--grey-5); }
|
||||
.eval-dot { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--grey-5); }
|
||||
|
||||
#episode-table-wrap { flex: 1; overflow: auto; border: 1px solid var(--hairline); background: var(--grey-1); min-height: 0; }
|
||||
#episode-table .vpad td { padding: 0; border: 0; }
|
||||
#episode-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
|
||||
#episode-table th {
|
||||
text-align: left;
|
||||
font: 400 10px var(--font-mono);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: var(--track-caps);
|
||||
color: var(--grey-4);
|
||||
padding: 9px 10px;
|
||||
border-bottom: 1px solid var(--grey-3);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
background: var(--grey-1);
|
||||
z-index: 1;
|
||||
}
|
||||
#episode-table td { padding: 5px 10px; border-bottom: 1px solid var(--hairline-faint); white-space: nowrap; }
|
||||
#episode-table tbody tr { cursor: pointer; }
|
||||
#episode-table tbody tr:hover { background: var(--grey-2); }
|
||||
.r-pos { color: var(--positive); }
|
||||
.r-neg { color: var(--negative); }
|
||||
.r-zero { color: var(--grey-4); }
|
||||
.status-ok { color: var(--positive); }
|
||||
.status-err { color: var(--negative); }
|
||||
|
||||
/* ----------------------------------------------------- trace viewer modal */
|
||||
#drawer-backdrop { position: fixed; inset: 0; background: rgba(17, 17, 17, 0.8); z-index: 30; }
|
||||
#trace-modal {
|
||||
position: fixed;
|
||||
inset: 3vh 2vw;
|
||||
background: var(--grey-1);
|
||||
border: 1px solid var(--grey-3);
|
||||
z-index: 31;
|
||||
display: grid;
|
||||
grid-template-columns: 280px minmax(0, 1fr) 320px;
|
||||
}
|
||||
.tm-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 10px 14px;
|
||||
border-bottom: 1px solid var(--hairline);
|
||||
min-height: 48px;
|
||||
}
|
||||
.tm-title { font-size: 12px; font-weight: 500; color: var(--grey-6); white-space: nowrap; }
|
||||
#tm-left { border-right: 1px solid var(--hairline); display: flex; flex-direction: column; min-height: 0; }
|
||||
#tm-left .search { margin: 10px 14px 6px; }
|
||||
#tm-list { flex: 1; overflow-y: auto; padding: 4px 8px 10px; }
|
||||
.tm-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 5px 10px;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
font-size: 11.5px;
|
||||
color: var(--grey-5);
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
.tm-item .tm-num { flex-shrink: 0; }
|
||||
/* env names never wrap - they clip with an ellipsis so every row is one line */
|
||||
.tm-item .tm-env { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.tm-item .tm-reward { flex-shrink: 0; }
|
||||
.tm-item:hover { background: var(--grey-2); }
|
||||
.tm-item.active { background: var(--grey-2); border-color: var(--grey-3); color: var(--grey-6); }
|
||||
.tm-item .tm-reward { margin-left: auto; }
|
||||
.tm-nav { padding: 0 8px; height: 24px; }
|
||||
.tm-stephead { justify-content: space-between; background: var(--grey-2); min-height: 40px; }
|
||||
#step-label, #tm-step-label { white-space: nowrap; }
|
||||
#tm-step-label { color: var(--grey-6); }
|
||||
.tm-filterhead { gap: 8px; }
|
||||
.tm-filterhead .seg button { height: 22px; padding: 0 9px; font-size: 10px; }
|
||||
#tm-step-label {
|
||||
font-size: 11px;
|
||||
letter-spacing: var(--track-caps);
|
||||
text-transform: uppercase;
|
||||
color: var(--grey-6);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
#tm-step-label .muted { text-transform: none; letter-spacing: var(--track-mono); }
|
||||
|
||||
#tm-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
|
||||
#tm-messages { flex: 1; overflow-y: auto; padding: 14px 16px; }
|
||||
#tm-right { border-left: 1px solid var(--hairline); overflow-y: auto; min-height: 0; }
|
||||
#tm-meta { padding: 12px 14px; }
|
||||
|
||||
/* numbered collapsible message entries */
|
||||
details.entry { border: 1px solid var(--hairline); margin-bottom: 8px; }
|
||||
details.entry > summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 7px 12px;
|
||||
background: var(--grey-2);
|
||||
min-width: 0;
|
||||
}
|
||||
details.entry[open] > summary { border-bottom: 1px solid var(--hairline); }
|
||||
.entry-num { font-size: 10px; color: var(--grey-4); letter-spacing: var(--track-mono); }
|
||||
.entry-role {
|
||||
font-size: 10px;
|
||||
font-weight: 500;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: var(--track-caps);
|
||||
color: var(--accent);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.entry-preview {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: var(--grey-4);
|
||||
font-size: 11px;
|
||||
}
|
||||
details.entry[open] > summary > .entry-preview { visibility: hidden; }
|
||||
.entry-chev { color: var(--grey-4); font-size: 10px; transition: transform 0.12s; }
|
||||
details.entry[open] .entry-chev { transform: rotate(90deg); }
|
||||
.entry-body { padding: 10px 14px; font-size: 12px; white-space: pre-wrap; word-break: break-word; color: var(--grey-5); }
|
||||
.chip {
|
||||
font-size: 10px;
|
||||
border: 1px solid var(--grey-3);
|
||||
padding: 1px 7px;
|
||||
color: var(--grey-4);
|
||||
letter-spacing: var(--track-mono);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.icon-btn {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--grey-4);
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
padding: 2px 4px;
|
||||
line-height: 1;
|
||||
}
|
||||
.icon-btn:hover { color: var(--grey-6); }
|
||||
.icon-btn.copied { color: var(--accent); }
|
||||
|
||||
/* nested sub-blocks (reasoning) */
|
||||
details.sub { border: 1px solid var(--hairline); margin: 8px 12px; }
|
||||
details.sub > summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 5px 10px;
|
||||
font-size: 10.5px;
|
||||
color: var(--grey-5);
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
}
|
||||
details.sub .sub-name { font-weight: 500; color: var(--grey-6); }
|
||||
details.sub > .entry-body { border-top: 1px solid var(--hairline); }
|
||||
|
||||
/* right pane: overview metadata */
|
||||
.tm-reward-big { color: var(--positive); }
|
||||
.tm-reward-big.neg { color: var(--negative); }
|
||||
.tm-reward-big.na { color: var(--grey-4); }
|
||||
.meta-sec {
|
||||
font-size: 10px;
|
||||
letter-spacing: var(--track-caps);
|
||||
text-transform: uppercase;
|
||||
color: var(--accent);
|
||||
margin: 16px 0 6px;
|
||||
}
|
||||
.meta-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 11.5px; }
|
||||
.meta-row .k { color: var(--grey-4); }
|
||||
.meta-row .k .tree { color: var(--grey-3); }
|
||||
.meta-row .v { margin-left: auto; color: var(--grey-6); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
|
||||
.meta-row .v.id { font-size: 10.5px; color: var(--grey-5); border: 1px solid var(--hairline); padding: 2px 6px; }
|
||||
details.meta-fold { border: 1px solid var(--hairline); margin: 8px 0; }
|
||||
details.meta-fold > summary { padding: 6px 10px; font-size: 10.5px; color: var(--grey-5); }
|
||||
details.meta-fold > pre { margin: 0; border: none; border-top: 1px solid var(--hairline); }
|
||||
|
||||
/* tool calls: green-terminal block */
|
||||
.tool-call {
|
||||
margin: 8px 12px 10px;
|
||||
padding: 7px 10px;
|
||||
background: #0b1403;
|
||||
border: 1px solid rgba(182, 255, 60, 0.22);
|
||||
color: var(--accent);
|
||||
font-size: 12px;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.tok { padding: 0 1px; }
|
||||
.tok:hover { outline: 1px solid var(--grey-6); }
|
||||
.tok-tip {
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
pointer-events: none;
|
||||
background: var(--grey-1);
|
||||
border: 1px solid var(--grey-3);
|
||||
padding: 4px 8px;
|
||||
font: 400 11px var(--font-mono);
|
||||
color: var(--grey-5);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
pre.json { background: var(--grey-2); border: 1px solid var(--hairline); padding: 12px; font-size: 11px; overflow-x: auto; }
|
||||
|
||||
::-webkit-scrollbar { width: 10px; height: 10px; }
|
||||
::-webkit-scrollbar-thumb { background: var(--grey-3); }
|
||||
::-webkit-scrollbar-thumb:hover { background: var(--grey-4); }
|
||||
::-webkit-scrollbar-track { background: transparent; }
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
.uplot, .uplot *, .uplot *::before, .uplot *::after {box-sizing: border-box;}.uplot {font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";line-height: 1.5;width: min-content;}.u-title {text-align: center;font-size: 18px;font-weight: bold;}.u-wrap {position: relative;user-select: none;}.u-over, .u-under {position: absolute;}.u-under {overflow: hidden;}.uplot canvas {display: block;position: relative;width: 100%;height: 100%;}.u-axis {position: absolute;}.u-legend {font-size: 14px;margin: auto;text-align: center;}.u-inline {display: block;}.u-inline * {display: inline-block;}.u-inline tr {margin-right: 16px;}.u-legend th {font-weight: 600;}.u-legend th > * {vertical-align: middle;display: inline-block;}.u-legend .u-marker {width: 1em;height: 1em;margin-right: 4px;background-clip: padding-box !important;}.u-inline.u-live th::after {content: ":";vertical-align: middle;}.u-inline:not(.u-live) .u-value {display: none;}.u-series > * {padding: 4px;}.u-series th {cursor: pointer;}.u-legend .u-off > * {opacity: 0.3;}.u-select {background: rgba(0,0,0,0.07);position: absolute;pointer-events: none;}.u-cursor-x, .u-cursor-y {position: absolute;left: 0;top: 0;pointer-events: none;will-change: transform;}.u-hz .u-cursor-x, .u-vt .u-cursor-y {height: 100%;border-right: 1px dashed #607D8B;}.u-hz .u-cursor-y, .u-vt .u-cursor-x {width: 100%;border-bottom: 1px dashed #607D8B;}.u-cursor-pt {position: absolute;top: 0;left: 0;border-radius: 50%;border: 0 solid;pointer-events: none;will-change: transform;/*this has to be !important since we set inline "background" shorthand */background-clip: padding-box !important;}.u-axis.u-off, .u-select.u-off, .u-cursor-x.u-off, .u-cursor-y.u-off, .u-cursor-pt.u-off {display: none;}
|
||||
@@ -15,6 +15,9 @@ from prime_rl.utils.process import set_proc_title
|
||||
def main():
|
||||
set_proc_title("Evals")
|
||||
config = cli(EvalsConfig)
|
||||
from prime_rl.utils.pathing import write_launch_toml
|
||||
|
||||
write_launch_toml(config.output_dir, "evals")
|
||||
from prime_rl.evals.evals import run_evals
|
||||
|
||||
asyncio.run(run_evals(config))
|
||||
|
||||
@@ -26,6 +26,7 @@ from prime_rl.utils.pathing import (
|
||||
latest_log_dir,
|
||||
resolve_latest_ckpt_step,
|
||||
validate_run_dir,
|
||||
write_launch_toml,
|
||||
)
|
||||
from prime_rl.utils.process import (
|
||||
DEFAULT_COMMON_ENV_VARS,
|
||||
@@ -120,6 +121,7 @@ def rl_local(config: RLConfig):
|
||||
)
|
||||
|
||||
config_dir = get_config_dir(config.run_dir)
|
||||
write_launch_toml(config.run_dir, "rl")
|
||||
write_subconfigs(config, config_dir)
|
||||
logger.info(f"Wrote subconfigs to {config_dir}")
|
||||
|
||||
@@ -557,6 +559,7 @@ def rl_slurm(config: RLConfig):
|
||||
)
|
||||
|
||||
config_dir = get_config_dir(config.run_dir)
|
||||
write_launch_toml(config.run_dir, "rl")
|
||||
log_dir = latest_log_dir(config.run_dir)
|
||||
|
||||
if config.deployment.type == "single_node":
|
||||
|
||||
@@ -25,6 +25,7 @@ from prime_rl.utils.pathing import (
|
||||
latest_log_dir,
|
||||
resolve_latest_ckpt_step,
|
||||
validate_run_dir,
|
||||
write_launch_toml,
|
||||
)
|
||||
from prime_rl.utils.process import (
|
||||
DEFAULT_COMMON_ENV_VARS,
|
||||
@@ -248,6 +249,7 @@ def sft_slurm(config: SFTConfig):
|
||||
decoupled_eval = config.deployment.type == "multi_node" and config.eval is not None
|
||||
|
||||
config_dir = get_config_dir(config.run_dir)
|
||||
write_launch_toml(config.run_dir, "sft")
|
||||
config_path = config_dir / SFT_CONFIG
|
||||
exclude = (
|
||||
{"deployment", "slurm", "dry_run", "clean"}
|
||||
@@ -353,6 +355,7 @@ def sft_local(config: SFTConfig):
|
||||
logger = setup_logger(config.log.level or "info", json_logging=config.log.json_logging)
|
||||
|
||||
config_dir = get_config_dir(config.run_dir)
|
||||
write_launch_toml(config.run_dir, "sft")
|
||||
config_path = config_dir / SFT_CONFIG
|
||||
write_config(config, config_path)
|
||||
logger.info(f"Wrote config to {config_path}")
|
||||
|
||||
@@ -93,6 +93,7 @@ class Evals:
|
||||
|
||||
get_logger().info(f"Initializing monitors ({config.monitors})")
|
||||
await monitors.setup(
|
||||
producer="evals",
|
||||
wandb=config.monitors.wandb,
|
||||
file=config.monitors.file,
|
||||
output_dir=config.output_dir,
|
||||
@@ -167,11 +168,10 @@ class Evals:
|
||||
get_inflight=lambda: self.dispatcher.current_inflight,
|
||||
)
|
||||
# The collector always polls — it feeds the concurrency controller;
|
||||
# W&B mirroring is gated on the registered monitor.
|
||||
# metrics fan out to every registered monitor.
|
||||
self.inference_metrics = InferenceMetricsCollector(
|
||||
self.admin_clients.clients,
|
||||
on_load=self.concurrency.observe,
|
||||
log_to_wandb=wandb_enabled,
|
||||
)
|
||||
# Fail fast when adaptivity has no signal: external API endpoints
|
||||
# (e.g. Prime Inference) expose no vLLM /metrics, so without a probe
|
||||
|
||||
@@ -51,7 +51,7 @@ def receive_state_dict(communicator: PyNcclCommunicator) -> Generator[tuple[str,
|
||||
# Split concatenated tensor back into individual tensors
|
||||
offset = 0
|
||||
for key, shape, numel in tensor_info_list:
|
||||
tensor = concatenated[offset : offset + numel].view(shape).clone()
|
||||
tensor = concatenated[offset : offset + numel].view(shape)
|
||||
offset += numel
|
||||
try:
|
||||
yield key, tensor
|
||||
|
||||
@@ -45,6 +45,7 @@ async def setup(
|
||||
file: FileMonitorConfig | None = None,
|
||||
*,
|
||||
output_dir: Path,
|
||||
producer: str | None = None,
|
||||
run_config: BaseConfig | None = None,
|
||||
train_env_names: list[str] | None = None,
|
||||
eval_env_names: list[str] | None = None,
|
||||
@@ -79,7 +80,7 @@ async def setup(
|
||||
)
|
||||
)
|
||||
if file is not None:
|
||||
monitors.append(("file", FileMonitor(file), dict(output_dir=output_dir)))
|
||||
monitors.append(("file", FileMonitor(file), dict(output_dir=output_dir, producer=producer)))
|
||||
if not monitors:
|
||||
return
|
||||
|
||||
@@ -99,7 +100,7 @@ def get(monitor_cls: type[Monitor]) -> Monitor | None:
|
||||
|
||||
|
||||
@overload
|
||||
async def log(data: dict[str, Any], step: int) -> None: ...
|
||||
async def log(data: dict[str, Any], step: int | None) -> None: ...
|
||||
|
||||
|
||||
@overload
|
||||
@@ -108,7 +109,7 @@ async def log(data: vf.Episode | list[vf.Episode], step: int, kind: Kind, subset
|
||||
|
||||
async def log(
|
||||
data: dict[str, Any] | vf.Episode | list[vf.Episode],
|
||||
step: int,
|
||||
step: int | None,
|
||||
kind: Kind = "train",
|
||||
subset: Subset = "effective",
|
||||
) -> None:
|
||||
|
||||
@@ -24,7 +24,7 @@ class Monitor(ABC):
|
||||
"""Initialize run. Overrides name their own kwargs."""
|
||||
|
||||
@overload
|
||||
async def log(self, data: dict[str, Any], step: int) -> None: ...
|
||||
async def log(self, data: dict[str, Any], step: int | None) -> None: ...
|
||||
|
||||
@overload
|
||||
async def log(self, data: vf.Episode | list[vf.Episode], step: int, kind: Kind, subset: Subset) -> None: ...
|
||||
@@ -32,7 +32,7 @@ class Monitor(ABC):
|
||||
async def log(
|
||||
self,
|
||||
data: dict[str, Any] | vf.Episode | list[vf.Episode],
|
||||
step: int,
|
||||
step: int | None,
|
||||
kind: Kind = "train",
|
||||
subset: Subset = "effective",
|
||||
) -> None:
|
||||
@@ -41,11 +41,13 @@ class Monitor(ABC):
|
||||
await self.log_metrics(data, step=step)
|
||||
else:
|
||||
episodes = data if isinstance(data, list) else [data]
|
||||
assert step is not None
|
||||
await self.log_episodes(episodes, step=step, kind=kind, subset=subset)
|
||||
|
||||
@abstractmethod
|
||||
async def log_metrics(self, metrics: dict[str, Any], step: int) -> None:
|
||||
"""Log scalar metrics."""
|
||||
async def log_metrics(self, metrics: dict[str, Any], step: int | None) -> None:
|
||||
"""Log scalar metrics. ``step=None`` logs a time-keyed row (e.g. inference
|
||||
metrics, which are sampled on wall time rather than the training step)."""
|
||||
|
||||
@abstractmethod
|
||||
async def log_episodes(self, episodes: list[vf.Episode], step: int, kind: Kind, subset: Subset) -> None:
|
||||
|
||||
@@ -22,15 +22,18 @@ class FileMonitor(Monitor):
|
||||
config: FileMonitorConfig
|
||||
file: TextIO
|
||||
|
||||
async def init(self, output_dir: Path) -> None:
|
||||
async def init(self, output_dir: Path, producer: str | None = None) -> None:
|
||||
self.output_dir = output_dir
|
||||
self.producer = producer
|
||||
self.path = output_dir / self.config.path
|
||||
self.path.parent.mkdir(parents=True, exist_ok=True)
|
||||
# Line-buffered append so a concurrently-running dashboard can tail the file.
|
||||
self.file = open(self.path, "a", buffering=1) # noqa: SIM115
|
||||
self.logger.info(f"Logging metrics and episodes to the local filesystem ({output_dir})")
|
||||
|
||||
async def log_metrics(self, metrics: dict[str, Any], step: int) -> None:
|
||||
async def log_metrics(self, metrics: dict[str, Any], step: int | None) -> None:
|
||||
"""``step=None`` logs a time-keyed row (e.g. inference metrics, which are
|
||||
sampled on wall time rather than the training step)."""
|
||||
sanitized, dropped = sanitize(metrics)
|
||||
if dropped:
|
||||
self.logger.warning(
|
||||
@@ -38,6 +41,8 @@ class FileMonitor(Monitor):
|
||||
)
|
||||
|
||||
row = {"step": step, "time": time.time(), **sanitized}
|
||||
if self.producer is not None:
|
||||
row["producer"] = self.producer
|
||||
self.file.write(json.dumps(row) + "\n")
|
||||
|
||||
async def log_episodes(self, episodes: list[vf.Episode], step: int, kind: Kind, subset: Subset) -> None:
|
||||
|
||||
@@ -5,6 +5,7 @@ import atexit
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
import time
|
||||
from datetime import datetime, timezone
|
||||
from typing import Any, Coroutine
|
||||
|
||||
@@ -87,10 +88,13 @@ class PrimeMonitor(Monitor):
|
||||
)
|
||||
await self.run.create(name=self.config.name, **run_fields)
|
||||
|
||||
async def log_metrics(self, metrics: dict[str, Any], step: int) -> None:
|
||||
async def log_metrics(self, metrics: dict[str, Any], step: int | None) -> None:
|
||||
metrics, dropped = sanitize(metrics)
|
||||
if dropped:
|
||||
self.logger.warning(f"Dropping {len(dropped)} non-finite metric value(s): {', '.join(dropped[:5])}")
|
||||
# every monitor stamps its own wall time; without it, step=None rows
|
||||
# (e.g. inference metrics) reach the platform with no time anchor
|
||||
metrics["_timestamp"] = time.time()
|
||||
self.run.submit("metrics upload", self.run.log_metrics(metrics))
|
||||
|
||||
async def log_episodes(self, episodes: list[vf.Episode], step: int, kind: Kind, subset: Subset) -> None:
|
||||
|
||||
@@ -113,6 +113,9 @@ class WandbMonitor(Monitor):
|
||||
self.wandb = init_wandb(max_retries)
|
||||
|
||||
wandb.define_metric("*", step_metric="step")
|
||||
# key prefixes that arrived via step=None (wall-time rows); their time axis
|
||||
# is defined lazily on first sight in log_metrics
|
||||
self._time_prefixes: set[str] = set()
|
||||
|
||||
# Provision the curated "overview" saved view once per project (the run's primary process
|
||||
# in shared mode, else the single master). Best-effort: a workspaces/API failure must never
|
||||
@@ -133,8 +136,18 @@ class WandbMonitor(Monitor):
|
||||
|
||||
self.logger.info(f"Logging metrics to W&B ({self.wandb.url})")
|
||||
|
||||
async def log_metrics(self, metrics: dict[str, Any], step: int) -> None:
|
||||
wandb.log({**metrics, "step": step})
|
||||
async def log_metrics(self, metrics: dict[str, Any], step: int | None) -> None:
|
||||
# every log carries the monitor's own wall-time stamp
|
||||
if step is None:
|
||||
# time-keyed rows chart against wall time; whichever key prefixes show
|
||||
# up this way get their time axis defined on first sight
|
||||
for prefix in {key.split("/")[0] for key in metrics}:
|
||||
if prefix not in self._time_prefixes:
|
||||
self._time_prefixes.add(prefix)
|
||||
wandb.define_metric(f"{prefix}/*", step_metric="_timestamp")
|
||||
wandb.log({**metrics, "_timestamp": time.time()})
|
||||
else:
|
||||
wandb.log({**metrics, "step": step, "_timestamp": time.time()})
|
||||
|
||||
async def log_episodes(self, episodes: list[vf.Episode], step: int, kind: Kind, subset: Subset) -> None:
|
||||
pass
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
"""Curated "overview" W&B saved view.
|
||||
|
||||
The dashboard mirrors these sections in `prime_rl/dashboard/static/app.js`
|
||||
(buildSections + the *_METRICS/INFERENCE_PANELS constants) — keep the two in
|
||||
sync when editing panels here.
|
||||
|
||||
prime-rl logs many metrics; the default workspace auto-generates a panel per key, which buries the
|
||||
few that matter. These build a named saved view grouping the important metrics into sections, so a
|
||||
new project gets a usable overview without hand-picking panels. Panels are untitled — each shows
|
||||
|
||||
@@ -7,10 +7,10 @@ from collections.abc import Callable
|
||||
from dataclasses import dataclass, field
|
||||
from statistics import mean, median
|
||||
|
||||
import wandb
|
||||
from httpx import AsyncClient
|
||||
from prometheus_client.parser import text_string_to_metric_families
|
||||
|
||||
from prime_rl import monitors
|
||||
from prime_rl.orchestrator.concurrency import EngineLoadSample
|
||||
from prime_rl.utils.logger import get_logger
|
||||
|
||||
@@ -279,7 +279,7 @@ class InferenceMetricsCollector:
|
||||
admin_clients: list[AsyncClient],
|
||||
roles: list[str | None] | None = None,
|
||||
on_load: Callable[[list[EngineLoadSample]], None] | None = None,
|
||||
log_to_wandb: bool = True,
|
||||
log_metrics: bool = True,
|
||||
):
|
||||
self.endpoints = build_metrics_endpoints(admin_clients, roles=roles)
|
||||
self.previous: dict[tuple[str, str], TimedSnapshot] = {}
|
||||
@@ -287,16 +287,13 @@ class InferenceMetricsCollector:
|
||||
self.task: asyncio.Task | None = None
|
||||
self.has_pd_roles = {endpoint.role for endpoint in self.endpoints if endpoint.role is not None} == PD_ROLES
|
||||
self.on_load = on_load
|
||||
self.log_to_wandb = log_to_wandb
|
||||
self.log_metrics = log_metrics
|
||||
get_logger().info(
|
||||
"Collecting inference metrics from "
|
||||
+ ", ".join(f"{endpoint.name}={endpoint.key}" for endpoint in self.endpoints)
|
||||
)
|
||||
|
||||
async def start(self):
|
||||
if self.log_to_wandb:
|
||||
wandb.define_metric("inference/*", step_metric="_timestamp")
|
||||
|
||||
async def poll_loop():
|
||||
while True:
|
||||
try:
|
||||
@@ -346,7 +343,7 @@ class InferenceMetricsCollector:
|
||||
return
|
||||
|
||||
await asyncio.gather(*[self.fetch_max_model_len(endpoint) for endpoint in self.endpoints])
|
||||
metrics = self.build_metrics(samples) if self.log_to_wandb else {}
|
||||
metrics = self.build_metrics(samples) if self.log_metrics else {}
|
||||
load_samples = [self.build_load_sample(sample) for sample in samples]
|
||||
for sample in samples:
|
||||
self.previous[sample.key] = TimedSnapshot(timestamp=sample.timestamp, snapshot=sample.snapshot)
|
||||
@@ -355,8 +352,10 @@ class InferenceMetricsCollector:
|
||||
self.on_load(load_samples)
|
||||
|
||||
if metrics:
|
||||
metrics["_timestamp"] = time.time()
|
||||
wandb.log(metrics)
|
||||
# Time-keyed rows (step=None): inference metrics are sampled on wall
|
||||
# time, not the training step. Fans out to every registered monitor;
|
||||
# each monitor stamps its own timestamp.
|
||||
await monitors.log(metrics, step=None)
|
||||
|
||||
async def fetch_max_model_len(self, endpoint: MetricsEndpoint) -> None:
|
||||
"""Cache the engine's max context length from ``/v1/models`` (set
|
||||
|
||||
@@ -212,6 +212,7 @@ class Orchestrator:
|
||||
self.admin_clients = AdminClients(config.model.client)
|
||||
|
||||
await monitors.setup(
|
||||
producer="orch",
|
||||
wandb=config.monitors.wandb,
|
||||
prime=config.monitors.prime,
|
||||
file=config.monitors.file,
|
||||
@@ -363,13 +364,12 @@ class Orchestrator:
|
||||
on_overload=self.dispatcher.cancel_inflight,
|
||||
)
|
||||
# The collector always polls — it feeds the concurrency controller;
|
||||
# W&B mirroring is gated on the registered monitor (the collector logs
|
||||
# to the global W&B session, which only exists when init succeeded).
|
||||
# metrics fan out to every registered monitor when collection is on.
|
||||
self.inference_metrics = InferenceMetricsCollector(
|
||||
self.admin_clients.clients,
|
||||
roles=config.inference_metrics_roles,
|
||||
on_load=self.concurrency.observe,
|
||||
log_to_wandb=wandb_enabled and config.collect_inference_metrics,
|
||||
log_metrics=config.collect_inference_metrics,
|
||||
)
|
||||
await self.inference_metrics.start()
|
||||
# One awaited scrape so the concurrency controller derives (and logs) its
|
||||
|
||||
@@ -84,7 +84,11 @@ def train(config: TrainerConfig):
|
||||
# Setup the monitors
|
||||
asyncio.run(
|
||||
monitors.setup(
|
||||
wandb=config.monitors.wandb, file=config.monitors.file, output_dir=config.output_dir, run_config=config
|
||||
producer="trainer",
|
||||
wandb=config.monitors.wandb,
|
||||
file=config.monitors.file,
|
||||
output_dir=config.output_dir,
|
||||
run_config=config,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ def train(config: SFTConfig):
|
||||
# Setup the monitors
|
||||
asyncio.run(
|
||||
monitors.setup(
|
||||
producer="trainer",
|
||||
wandb=config.monitors.wandb,
|
||||
file=config.monitors.file,
|
||||
output_dir=config.run_dir,
|
||||
|
||||
@@ -91,7 +91,29 @@ def format_log_message(
|
||||
|
||||
|
||||
def get_config_dir(output_dir: Path) -> Path:
|
||||
return output_dir / "configs"
|
||||
"""Resolved per-component config dumps (JSON). The launch TOML copy lives one
|
||||
level up, at `configs/<entrypoint>.toml`."""
|
||||
return output_dir / "configs" / "resolved"
|
||||
|
||||
|
||||
def write_launch_toml(run_dir: Path, name: str) -> None:
|
||||
"""Copy the launch `@` TOML file(s) verbatim to `configs/<name>.toml`."""
|
||||
import sys
|
||||
|
||||
argv = sys.argv[1:]
|
||||
paths = []
|
||||
for i, arg in enumerate(argv):
|
||||
# root config references only: `@ file`; a `--flag @ file` / `--flag @file`
|
||||
# is a nested reference and belongs under its flag, not in the launch copy
|
||||
if arg == "@" and i + 1 < len(argv) and (i == 0 or not argv[i - 1].startswith("--")):
|
||||
paths.append(Path(argv[i + 1]))
|
||||
tomls = [(p, p.read_text()) for p in paths if p.suffix == ".toml" and p.is_file()]
|
||||
if not tomls:
|
||||
return
|
||||
texts = [text for _, text in tomls] if len(tomls) == 1 else [f"# @ {p}\n{text}" for p, text in tomls]
|
||||
config_dir = run_dir / "configs"
|
||||
config_dir.mkdir(parents=True, exist_ok=True)
|
||||
(config_dir / f"{name}.toml").write_text("\n".join(texts))
|
||||
|
||||
|
||||
def get_ckpt_dir(output_dir: Path) -> Path:
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
"""Browser smoke test for the run dashboard, run against real integration-run artifacts.
|
||||
|
||||
Launched at the end of each integration test so that any change to the on-disk
|
||||
artifacts (metrics.jsonl rows, Episode records, config JSONs, log layout) that
|
||||
breaks the dashboard fails the same CI run that produced them.
|
||||
"""
|
||||
|
||||
import socket
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
DASHBOARD_STARTUP_TIMEOUT_S = 30
|
||||
PAGE_SETTLE_MS = 4000
|
||||
|
||||
|
||||
def _free_port() -> int:
|
||||
with socket.socket() as sock:
|
||||
sock.bind(("127.0.0.1", 0))
|
||||
return sock.getsockname()[1]
|
||||
|
||||
|
||||
def _install_browser() -> None:
|
||||
subprocess.run(
|
||||
["uv", "run", "playwright", "install", "--with-deps", "--only-shell", "chromium"],
|
||||
check=True,
|
||||
capture_output=True,
|
||||
timeout=600,
|
||||
)
|
||||
|
||||
|
||||
def check_dashboard_smoke(output_dir: Path, run_name: str) -> None:
|
||||
"""Serve ``output_dir`` and assert the dashboard renders the run end to end."""
|
||||
from playwright.sync_api import sync_playwright
|
||||
|
||||
_install_browser()
|
||||
port = _free_port()
|
||||
server = subprocess.Popen(
|
||||
["uv", "run", "dashboard", output_dir.as_posix(), "--port", str(port)],
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.STDOUT,
|
||||
)
|
||||
try:
|
||||
deadline = time.monotonic() + DASHBOARD_STARTUP_TIMEOUT_S
|
||||
while time.monotonic() < deadline:
|
||||
try:
|
||||
with socket.create_connection(("127.0.0.1", port), timeout=1):
|
||||
break
|
||||
except OSError:
|
||||
time.sleep(0.5)
|
||||
else:
|
||||
raise AssertionError("dashboard did not start listening")
|
||||
|
||||
errors: list[str] = []
|
||||
with sync_playwright() as playwright:
|
||||
browser = playwright.chromium.launch()
|
||||
page = browser.new_page(viewport={"width": 1600, "height": 1000})
|
||||
page.on("console", lambda m: errors.append(f"console: {m.text}") if m.type == "error" else None)
|
||||
page.on("pageerror", lambda e: errors.append(f"page: {e}"))
|
||||
base = f"http://127.0.0.1:{port}"
|
||||
|
||||
# metrics: the run resolves and the overview renders charts with data
|
||||
page.goto(f"{base}/#run={run_name}&tab=metrics")
|
||||
page.wait_for_timeout(PAGE_SETTLE_MS)
|
||||
status = page.locator("#run-overview .badge").first.inner_text()
|
||||
assert status, "overview card did not render a status"
|
||||
fields = page.evaluate(
|
||||
"""() => Object.fromEntries([...document.querySelectorAll('#run-overview .ov-field')]
|
||||
.map(f => [f.querySelector('.lbl').innerText, f.querySelector('.val, .badge').innerText]))"""
|
||||
)
|
||||
run_type = fields.get("TYPE")
|
||||
assert run_type in ("RL", "SFT", "EVAL"), f"overview type field did not render: {fields!r}"
|
||||
if run_type == "EVAL":
|
||||
assert fields.get("EPISODES", "").isdigit(), f"overview episodes field did not render: {fields!r}"
|
||||
cards = page.locator(".stat-card").count()
|
||||
assert cards >= 5, f"expected >=5 stat cards, got {cards}"
|
||||
else:
|
||||
assert "/" in fields.get("STEP", ""), f"overview step field did not render: {fields!r}"
|
||||
charts = page.locator(".chart-card").count()
|
||||
assert charts >= 5, f"expected >=5 metric panels, got {charts}"
|
||||
with_data = page.evaluate("""() => [...document.querySelectorAll('.chart-card .u-wrap')].length""")
|
||||
assert with_data >= 5, f"expected >=5 mounted charts, got {with_data}"
|
||||
|
||||
# config: the default view renders (launch TOML on new runs), and the
|
||||
# resolved concatenated document renders as a tree
|
||||
page.click("#tabs [data-tab=config]")
|
||||
page.wait_for_timeout(1500)
|
||||
assert page.eval_on_selector("#config-view", "e => e.innerText.length") > 100, "config view did not render"
|
||||
page.click("#config-format [data-fmt=json]")
|
||||
page.wait_for_timeout(1500)
|
||||
assert page.locator("#config-view .j-line").count() > 10, "resolved config tree did not render"
|
||||
|
||||
# traces: when the run saved rollouts, episodes must render and open
|
||||
rollout_steps = page.evaluate(
|
||||
f"""fetch('{base}/api/runs/{run_name}/rollouts').then(r => r.json()).then(d => d.steps.length)"""
|
||||
)
|
||||
if rollout_steps:
|
||||
page.click("#tabs [data-tab=traces]")
|
||||
page.wait_for_timeout(3000)
|
||||
rows = page.locator("#episode-table tbody tr").count()
|
||||
assert rows > 0, "traces table rendered no episodes"
|
||||
page.click("#episode-table tbody tr >> nth=0")
|
||||
page.wait_for_timeout(3000)
|
||||
entries = page.locator("#tm-messages details.entry").count()
|
||||
assert entries > 0, "episode viewer rendered no messages"
|
||||
reward = page.locator(".tm-reward-big").first.inner_text()
|
||||
assert reward not in ("", "n/a"), f"episode reward did not render: {reward!r}"
|
||||
page.keyboard.press("Escape")
|
||||
|
||||
# logs: the merged pane shows lines
|
||||
page.click("#tabs [data-tab=logs]")
|
||||
page.wait_for_timeout(PAGE_SETTLE_MS)
|
||||
log_lines = page.locator(".log-pane .ll").count()
|
||||
assert log_lines > 10, f"log pane rendered only {log_lines} lines"
|
||||
|
||||
browser.close()
|
||||
|
||||
assert not errors, f"dashboard raised browser errors: {errors[:5]}"
|
||||
finally:
|
||||
server.terminate()
|
||||
try:
|
||||
server.wait(timeout=10)
|
||||
except subprocess.TimeoutExpired:
|
||||
server.kill()
|
||||
print(f"Dashboard smoke passed for {run_name} ({output_dir})", file=sys.stderr)
|
||||
|
||||
|
||||
def make_dashboard_test(process_fixture: str, run_name: str):
|
||||
"""The per-file dashboard smoke: `test_dashboard = make_dashboard_test("rl_process", RUN_NAME)`.
|
||||
Depends on the module's (module-scoped) training-process fixture, so it runs
|
||||
against the artifacts that run just produced."""
|
||||
import pytest
|
||||
|
||||
@pytest.mark.usefixtures(process_fixture)
|
||||
def test_dashboard(output_dir: Path) -> None:
|
||||
check_dashboard_smoke(output_dir, run_name)
|
||||
|
||||
return test_dashboard
|
||||
@@ -4,6 +4,7 @@ from typing import Callable
|
||||
import pytest
|
||||
|
||||
from tests.conftest import ProcessResult
|
||||
from tests.integration.dashboard_smoke import make_dashboard_test
|
||||
from tests.utils import (
|
||||
check_avg_mismatch_kl_in_range,
|
||||
check_no_error,
|
||||
@@ -83,3 +84,6 @@ def test_mismatch_kl_in_range(rl_process: ProcessResult, test_no_error, run_dir:
|
||||
with open(run_dir / "logs" / "latest" / "trainer.log", "r") as f:
|
||||
trainer_stdout = strip_escape_codes(f.read()).splitlines()
|
||||
check_avg_mismatch_kl_in_range(trainer_stdout, last_n_steps=5, max_threshold=0.15)
|
||||
|
||||
|
||||
test_dashboard = make_dashboard_test("rl_process", RUN_NAME)
|
||||
|
||||
@@ -4,6 +4,7 @@ from typing import Callable
|
||||
import pytest
|
||||
|
||||
from tests.conftest import ProcessResult
|
||||
from tests.integration.dashboard_smoke import make_dashboard_test
|
||||
from tests.utils import (
|
||||
check_avg_mismatch_kl_in_range,
|
||||
check_no_error,
|
||||
@@ -126,3 +127,6 @@ def test_reward_in_range_resume(rl_resume_process: ProcessResult, test_no_error_
|
||||
with open(run_dir / "logs" / "latest" / "orchestrator.log", "r") as f:
|
||||
orchestrator_stdout = strip_escape_codes(f.read()).splitlines()
|
||||
check_reward_in_range(orchestrator_stdout, min_threshold=0.6)
|
||||
|
||||
|
||||
test_dashboard = make_dashboard_test("rl_process", RUN_NAME)
|
||||
|
||||
@@ -10,6 +10,7 @@ import pytest
|
||||
|
||||
from prime_rl.utils.process import cleanup_process
|
||||
from tests.conftest import ProcessResult
|
||||
from tests.integration.dashboard_smoke import make_dashboard_test
|
||||
from tests.utils import check_final_eval_reward_above, check_no_error, strip_escape_codes
|
||||
|
||||
pytestmark = [pytest.mark.gpu, pytest.mark.slow]
|
||||
@@ -122,3 +123,6 @@ def test_eval_reward_converges(rl_opd_process: ProcessResult, test_no_error, run
|
||||
with open(run_dir / "logs" / "latest" / "orchestrator.log", "r") as f:
|
||||
orchestrator_stdout = strip_escape_codes(f.read()).splitlines()
|
||||
check_final_eval_reward_above(orchestrator_stdout, env_name="reverse-text", min_threshold=0.5)
|
||||
|
||||
|
||||
test_dashboard = make_dashboard_test("rl_opd_process", RUN_NAME)
|
||||
|
||||
@@ -10,6 +10,7 @@ import pytest
|
||||
|
||||
from prime_rl.utils.process import cleanup_process
|
||||
from tests.conftest import ProcessResult
|
||||
from tests.integration.dashboard_smoke import make_dashboard_test
|
||||
from tests.utils import check_final_eval_reward_above, check_no_error, strip_escape_codes
|
||||
|
||||
pytestmark = [pytest.mark.gpu, pytest.mark.slow]
|
||||
@@ -121,3 +122,6 @@ def test_eval_reward_converges(rl_sft_process: ProcessResult, test_no_error, run
|
||||
with open(run_dir / "logs" / "latest" / "orchestrator.log", "r") as f:
|
||||
orchestrator_stdout = strip_escape_codes(f.read()).splitlines()
|
||||
check_final_eval_reward_above(orchestrator_stdout, env_name="reverse-text", min_threshold=0.5)
|
||||
|
||||
|
||||
test_dashboard = make_dashboard_test("rl_sft_process", RUN_NAME)
|
||||
|
||||
@@ -6,6 +6,7 @@ import torch
|
||||
from torch.distributed.checkpoint.format_utils import dcp_to_torch_save
|
||||
|
||||
from tests.conftest import ProcessResult
|
||||
from tests.integration.dashboard_smoke import make_dashboard_test
|
||||
from tests.utils import check_loss_goes_down, strip_escape_codes
|
||||
|
||||
pytestmark = [pytest.mark.slow, pytest.mark.gpu]
|
||||
@@ -170,3 +171,6 @@ def test_full_offload_model_only_resume_preserves_weights(
|
||||
assert torch.equal(before[key].to(torch.bfloat16), after[key].to(torch.bfloat16)), (
|
||||
f"Weight mismatch after model-only resume: {key}"
|
||||
)
|
||||
|
||||
|
||||
test_dashboard = make_dashboard_test("sft_process", RUN_NAME)
|
||||
|
||||
@@ -4,6 +4,7 @@ from typing import Callable
|
||||
import pytest
|
||||
|
||||
from tests.conftest import ProcessResult
|
||||
from tests.integration.dashboard_smoke import make_dashboard_test
|
||||
from tests.utils import check_loss_goes_down, strip_escape_codes
|
||||
|
||||
pytestmark = [pytest.mark.slow, pytest.mark.gpu]
|
||||
@@ -112,3 +113,6 @@ def test_loss_goes_down_resume(sft_lora_resume_process: ProcessResult, run_dir:
|
||||
with open(trainer_log_path, "r") as f:
|
||||
trainer_stdout = strip_escape_codes(f.read()).splitlines()
|
||||
check_loss_goes_down(trainer_stdout)
|
||||
|
||||
|
||||
test_dashboard = make_dashboard_test("sft_lora_process", RUN_NAME)
|
||||
|
||||
@@ -50,8 +50,10 @@ members = [
|
||||
"charxiv",
|
||||
"clbench",
|
||||
"color-codeword",
|
||||
"deep-swe",
|
||||
"deepdive",
|
||||
"deepseek-prover",
|
||||
"deshuffle-papers",
|
||||
"drug-discovery-bench",
|
||||
"enterprise-ops-gym",
|
||||
"forth-lang",
|
||||
@@ -1305,6 +1307,17 @@ wheels = [
|
||||
{ url = "https://github.com/PrimeIntellect-ai/prime-rl/releases/download/v0.5.0/deep_gemm-2.5.0+891d57b-cp312-cp312-linux_x86_64.whl", hash = "sha256:3a9e4472b86e8e7e2c77cc76951c886bbe7a23a1f5908958969ab5b9c707a2f3" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "deep-swe"
|
||||
version = "0.1.0"
|
||||
source = { editable = "deps/prime-envs/environments/swe/deep_swe" }
|
||||
dependencies = [
|
||||
{ name = "verifiers", extra = ["harbor"] },
|
||||
]
|
||||
|
||||
[package.metadata]
|
||||
requires-dist = [{ name = "verifiers", extras = ["harbor"], specifier = ">=0.3.0" }]
|
||||
|
||||
[[package]]
|
||||
name = "deepdiff"
|
||||
version = "9.1.0"
|
||||
@@ -1375,6 +1388,21 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/cf/65/4df6936130b56e1429114e663e7c1576cf845f3aef1b2dd200c0a5d19dba/depyf-0.20.0-py3-none-any.whl", hash = "sha256:d31effad4261cebecb58955d832e448ace88f432328f95f82fd99c30fd9308d4", size = 39381, upload-time = "2025-10-13T12:33:33.647Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "deshuffle-papers"
|
||||
version = "0.1.0"
|
||||
source = { editable = "deps/prime-envs/environments/reasoning/deshuffle_papers" }
|
||||
dependencies = [
|
||||
{ name = "huggingface-hub" },
|
||||
{ name = "verifiers" },
|
||||
]
|
||||
|
||||
[package.metadata]
|
||||
requires-dist = [
|
||||
{ name = "huggingface-hub", specifier = ">=0.20" },
|
||||
{ name = "verifiers", specifier = ">=0.3.0" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "detect-installer"
|
||||
version = "0.1.0"
|
||||
@@ -2113,6 +2141,18 @@ requires-dist = [
|
||||
{ name = "verifiers", specifier = ">=0.2.0" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "greenlet"
|
||||
version = "3.5.5"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/0b/d8/7cc97c142388aef03f622e001c572c4f84e9252a439549d483f555771970/greenlet-3.5.5.tar.gz", hash = "sha256:adb4bae02e91a8e863e48b177e4014bdcac8a6b5e047ea1df687a61534b85e6c", size = 207585, upload-time = "2026-08-10T15:09:36.136Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/35/73/60e4bbcc89252037b18087f2ec16405d5b2d5be42dde191bbf3667e96102/greenlet-3.5.5-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:55272212cbc5f43d1d723725ab931f1939969b7e9523882ca58b55061769d053", size = 611910, upload-time = "2026-08-10T14:14:35.18Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/78/ac/5c5b959999b6f09c3026b5dfe171575bc3121c5236ce74f495096f25b203/greenlet-3.5.5-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:147b25a42e5ca5be3d42356e8f608b37af715a1c196e9bf9d1627f3341adfe1d", size = 621439, upload-time = "2026-08-10T13:40:49.391Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c8/8b/6acf112ed8aee499f25b4d6949820fb02ac950ff9c1f3d793bd5be0599f2/greenlet-3.5.5-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:27493374cff1d1b7919dc8126547f2aea582737e3046147b434b1e12de56389b", size = 1581342, upload-time = "2026-08-10T14:15:05.653Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b8/d7/734e5f198888876b42d7616ff6644c075baf6b8a2412deadd6b0e1b8b20c/greenlet-3.5.5-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:12e2ee66c2aba86133f10fd99d6a8856c6d351ffb7be0e4d52ef2cc5fbb705b2", size = 1645744, upload-time = "2026-08-10T13:40:30.353Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "griffelib"
|
||||
version = "2.0.2"
|
||||
@@ -3365,7 +3405,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "mcp-atlas"
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
source = { editable = "deps/prime-envs/environments/tool_use/mcp_atlas" }
|
||||
dependencies = [
|
||||
{ name = "datasets" },
|
||||
@@ -3378,7 +3418,7 @@ dependencies = [
|
||||
requires-dist = [
|
||||
{ name = "datasets", specifier = ">=4.0.0,<5" },
|
||||
{ name = "httpx" },
|
||||
{ name = "prime-sandboxes", specifier = ">=0.2.19" },
|
||||
{ name = "prime-sandboxes", specifier = ">=0.2.37" },
|
||||
{ name = "verifiers", specifier = ">=0.3.0" },
|
||||
]
|
||||
|
||||
@@ -4668,6 +4708,19 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/7d/68/d8d58938dfb1370b266a1a729e6d77a985be23689a0496498ee17b2cbf90/platformdirs-4.11.0-py3-none-any.whl", hash = "sha256:360ccded2b7fce0af0ff80cc8f5942a1c5d99b0e856033acb030bfc634709e74", size = 23247, upload-time = "2026-07-21T13:09:35.422Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "playwright"
|
||||
version = "1.62.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "greenlet" },
|
||||
{ name = "pyee" },
|
||||
]
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/43/6b/b24aebc2b04bffcb342bccf96e287c78b363e1615bed5cea97500cc0393a/playwright-1.62.0-py3-none-manylinux1_x86_64.whl", hash = "sha256:ba33bae6a13b3d9d354c751cb618af357d20fe1d57767cbcce52079bbef17ad3", size = 47748926, upload-time = "2026-07-31T17:00:56.438Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/36/43/b4b18bdc87e1949568fffdcde3ff9a0456266b2d0c6d4432cc34d89ea6eb/playwright-1.62.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:db2d76613a57ad844362ce42f7d0c2fa26b19a4f7a46d4f76b891c631e6e5aff", size = 47441423, upload-time = "2026-07-31T17:01:00.404Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "plotly"
|
||||
version = "6.7.0"
|
||||
@@ -4906,6 +4959,10 @@ all = [
|
||||
{ name = "vllm-router", version = "0.2.0", source = { url = "https://github.com/PrimeIntellect-ai/router/releases/download/v0.2.0/vllm_router-0.2.0-cp38-abi3-manylinux_2_28_aarch64.whl" }, marker = "platform_machine != 'x86_64'" },
|
||||
{ name = "vllm-router", version = "0.2.0", source = { url = "https://github.com/PrimeIntellect-ai/router/releases/download/v0.2.0/vllm_router-0.2.0-cp38-abi3-manylinux_2_28_x86_64.whl" }, marker = "platform_machine == 'x86_64'" },
|
||||
]
|
||||
dashboard = [
|
||||
{ name = "fastapi" },
|
||||
{ name = "uvicorn" },
|
||||
]
|
||||
disagg = [
|
||||
{ name = "deep-ep", version = "1.1.0+1fd57b0", source = { url = "https://github.com/PrimeIntellect-ai/prime-rl/releases/download/v0.5.0/deep_ep-1.1.0+1fd57b0-cp312-cp312-linux_aarch64.whl" }, marker = "platform_machine != 'x86_64'" },
|
||||
{ name = "deep-ep", version = "1.2.1+29d31c0", source = { url = "https://github.com/PrimeIntellect-ai/prime-rl/releases/download/v0.5.0/deep_ep-1.2.1+29d31c0-cp312-cp312-linux_x86_64.whl" }, marker = "platform_machine == 'x86_64'" },
|
||||
@@ -4941,6 +4998,7 @@ quack = [
|
||||
dev = [
|
||||
{ name = "ipykernel" },
|
||||
{ name = "ipywidgets" },
|
||||
{ name = "playwright" },
|
||||
{ name = "pre-commit" },
|
||||
{ name = "pytest" },
|
||||
{ name = "pytest-asyncio" },
|
||||
@@ -4961,6 +5019,7 @@ requires-dist = [
|
||||
{ name = "deep-gemm", marker = "platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'disagg'" },
|
||||
{ name = "deep-gemm", marker = "platform_machine == 'x86_64' and extra == 'disagg'", url = "https://github.com/PrimeIntellect-ai/prime-rl/releases/download/v0.5.0/deep_gemm-2.5.0+891d57b-cp312-cp312-linux_x86_64.whl" },
|
||||
{ name = "dion", git = "https://github.com/samsja/dion.git?rev=d891eeb" },
|
||||
{ name = "fastapi", marker = "extra == 'dashboard'", specifier = ">=0.115" },
|
||||
{ name = "flash-attn", marker = "platform_machine == 'aarch64' and extra == 'flash-attn'", url = "https://github.com/mjun0812/flash-attention-prebuild-wheels/releases/download/v0.9.22/flash_attn-2.8.3+cu128torch2.11-cp312-cp312-linux_aarch64.whl" },
|
||||
{ name = "flash-attn", marker = "platform_machine == 'x86_64' and extra == 'flash-attn'", url = "https://github.com/mjun0812/flash-attention-prebuild-wheels/releases/download/v0.9.4/flash_attn-2.8.3+cu128torch2.11-cp312-cp312-linux_x86_64.whl" },
|
||||
{ name = "flash-attn-3", marker = "extra == 'flash-attn-3'", index = "https://download.pytorch.org/whl/test/cu128" },
|
||||
@@ -5009,6 +5068,7 @@ requires-dist = [
|
||||
{ name = "torchtitan", git = "https://github.com/pytorch/torchtitan?rev=23e4dfc" },
|
||||
{ name = "torchvision", index = "https://download.pytorch.org/whl/cu128" },
|
||||
{ name = "transformers", specifier = "==5.6.2" },
|
||||
{ name = "uvicorn", marker = "extra == 'dashboard'", specifier = ">=0.30" },
|
||||
{ name = "uvloop", specifier = ">=0.21.0" },
|
||||
{ name = "verifiers", extras = ["harbor"], editable = "deps/verifiers" },
|
||||
{ name = "vllm", marker = "platform_machine != 'aarch64' and platform_machine != 'x86_64'", specifier = ">=0.26.0" },
|
||||
@@ -5020,12 +5080,13 @@ requires-dist = [
|
||||
{ name = "wandb", specifier = ">=0.26.1" },
|
||||
{ name = "wandb-workspaces", specifier = ">=0.4.3" },
|
||||
]
|
||||
provides-extras = ["flash-attn", "flash-attn-3", "flash-attn-cute", "disagg", "gpt-oss", "quack", "kernels", "all"]
|
||||
provides-extras = ["dashboard", "flash-attn", "flash-attn-3", "flash-attn-cute", "disagg", "gpt-oss", "quack", "kernels", "all"]
|
||||
|
||||
[package.metadata.requires-dev]
|
||||
dev = [
|
||||
{ name = "ipykernel", specifier = ">=6.29.5" },
|
||||
{ name = "ipywidgets", specifier = ">=8.1.7" },
|
||||
{ name = "playwright", specifier = ">=1.49" },
|
||||
{ name = "pre-commit", specifier = ">=4.2.0" },
|
||||
{ name = "pytest", specifier = ">=8.4.1" },
|
||||
{ name = "pytest-asyncio", specifier = ">=0.23" },
|
||||
@@ -5050,7 +5111,7 @@ dependencies = [
|
||||
requires-dist = [
|
||||
{ name = "prime-pydantic-config", specifier = ">=0.4.3" },
|
||||
{ name = "pydantic", specifier = ">=1.10.13" },
|
||||
{ name = "renderers", specifier = ">=0.1.9" },
|
||||
{ name = "renderers", specifier = ">=0.1.10" },
|
||||
{ name = "tomli", specifier = ">=2.2.1" },
|
||||
{ name = "tomli-w", specifier = ">=1.2.0" },
|
||||
{ name = "verifiers", specifier = ">=0.3.0" },
|
||||
@@ -5437,6 +5498,18 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/ae/8d/f1af3832f5e6eb13ba94ee809e72b8ecb5eef226d27ee0bef7d963d943c7/pydantic_settings-2.14.1-py3-none-any.whl", hash = "sha256:6e3c7edfd8277687cdc598f56e5cff0e9bfff0910a3749deaa8d4401c3a2b9de", size = 60964, upload-time = "2026-05-08T13:40:04.958Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pyee"
|
||||
version = "13.0.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/8b/04/e7c1fe4dc78a6fdbfd6c337b1c3732ff543b8a397683ab38378447baa331/pyee-13.0.1.tar.gz", hash = "sha256:0b931f7c14535667ed4c7e0d531716368715e860b988770fc7eb8578d1f67fc8", size = 31655, upload-time = "2026-02-14T21:12:28.044Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/a0/c4/b4d4827c93ef43c01f599ef31453ccc1c132b353284fc6c87d535c233129/pyee-13.0.1-py3-none-any.whl", hash = "sha256:af2f8fede4171ef667dfded53f96e2ed0d6e6bd7ee3bb46437f77e3b57689228", size = 15659, upload-time = "2026-02-14T21:12:26.263Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pyelftools"
|
||||
version = "0.32"
|
||||
@@ -6610,7 +6683,7 @@ source = { git = "https://github.com/SWE-bench/SWE-smith.git?rev=9b74ac0#9b74ac0
|
||||
|
||||
[[package]]
|
||||
name = "swesmith-env"
|
||||
version = "0.1.2"
|
||||
version = "0.1.3"
|
||||
source = { editable = "deps/prime-envs/environments/swe/swesmith_env" }
|
||||
dependencies = [
|
||||
{ name = "datasets" },
|
||||
@@ -6622,7 +6695,7 @@ dependencies = [
|
||||
[package.metadata]
|
||||
requires-dist = [
|
||||
{ name = "datasets" },
|
||||
{ name = "swebench" },
|
||||
{ name = "swebench", specifier = ">=4.1.0,<5" },
|
||||
{ name = "swesmith", git = "https://github.com/SWE-bench/SWE-smith.git?rev=9b74ac0" },
|
||||
{ name = "verifiers", specifier = ">=0.2.2.dev27" },
|
||||
]
|
||||
@@ -7541,7 +7614,7 @@ requires-dist = [
|
||||
{ name = "python-dotenv", marker = "extra == 'browser'", specifier = ">=1.0.0" },
|
||||
{ name = "pyzmq", specifier = ">=27.1.0" },
|
||||
{ name = "reasoning-gym", marker = "extra == 'rg'", specifier = ">=0.1.8" },
|
||||
{ name = "renderers", specifier = ">=0.1.9" },
|
||||
{ name = "renderers", specifier = ">=0.1.10" },
|
||||
{ name = "requests" },
|
||||
{ name = "rich", specifier = ">=11.0.0" },
|
||||
{ name = "setproctitle", specifier = ">=1.3.0" },
|
||||
|
||||
Reference in New Issue
Block a user