Skip to content

feat: add local run dashboard - #3351

Draft
mikasenghaas wants to merge 34 commits into
mainfrom
feat/run-dashboard
Draft

feat: add local run dashboard#3351
mikasenghaas wants to merge 34 commits into
mainfrom
feat/run-dashboard

Conversation

@mikasenghaas

@mikasenghaas mikasenghaas commented Aug 23, 2026

Copy link
Copy Markdown
Member

Summary

  • Add dashboard/, a local web dashboard for run output directories: ./dashboard/dashboard.py <output_dir> (default outputs/), with a run selector for every run in the directory and four tabs: Metrics · Config · Traces · Logs.
  • Run overview card on every tab: a step N headline (naturally fits unbounded runs; of max shown when set) with STATUS (running/completed/stopped, inferred from metrics.jsonl freshness), DURATION (live-ticking), MODEL, RESUMES (attempt count), TRAIN/EVAL ENVS (long lists fold into +N with a tooltip), and CREATED.
  • Design: Prime Intellect language from prime-context (colors_and_type.css / brand.md) — #111 canvas, lime #B6FF3C accent used categorically, mono-dominant type with mono-caps labels, hairline dividers, zero border radii, butterfly mark top-left. Chart lines default to the brand palette purple (#B7A6FA); extra series pull from the rest of the palette. ABC Favorit is licensed and not vendored — the stack falls back to JetBrains Mono / system mono.
  • Metrics (default screen): replicates the W&B overview sections (monitors/wandb/overview.py, RL and SFT flavors) from metrics.jsonl. Rows merge by step; the trainer/orchestrator time/step and time/save_ckpt collisions render as separate labeled series. Charts show a hover popover with x/y values, panel titles show the matched keys, sections are collapsible, panes reorder by dragging their header (persisted), a plain click resets drag-zoom, and a rolling-average smoothing slider (window 1–50) overlays the smoothed line on a faint raw ghost; and wandb-style resize handles on every pane (bottom edge = height, right edge = width, corner = both) resize all panes together — both persisted in localStorage. The all-metrics mode charts every logged key in nested collapsible sections along key paths (train → env → all/effective) behind a prominent regex filter; off-screen charts mount lazily. Reward/advantage columns in the trace table are green/red coded, episodes scroll without pagination, every empty case (no runs, no configs, no rollouts, no matching lines) shows a shared fixed-width empty-state box, and the live indicator is a pulsing dot. Inference metrics now fan out to every registered monitor as time-keyed rows (step: null) — W&B, the file monitor, and the Prime monitor alike (monitors.log(..., step=None); Monitor.log_metrics accepts step: int | None, and the inference/* define_metric moved into the W&B monitor init); the dashboard plots the overview inference panels (fleet aggregate + cross-engine tail) against relative wall time with s/m/h/d ticks. Step charts use integer x ticks and axes anchored at zero.
  • Config: the run's resolved config JSONs (configs/**/*.json, rl.json first), pretty-printed with syntax highlighting and a regex search that prunes the JSON to matching subtrees (a matching key keeps its whole dict) with highlighted hits and a count.
  • Traces: per-step rollout viewer over rollouts/step_N/{train,eval}/{all,effective}/traces.jsonl with a full-width block step selector (one block per step, filled through the selection, eval steps marked) + prev/next, fixed-width reward/advantage columns, env and error filters, env/sort/errors-only filters in a popup, and a platform-style trace viewer: prev/next step navigation with a step header, rollout selector with search and prev/next on the left, numbered collapsible message entries (per-message copy, collapse/expand all, reasoning and tool-call sub-blocks) in the center, and an overview pane (reward with per-component rewards and env metrics, copyable ids incl. runtime, turns and tool calls, token usage, tool definitions, state, timing tree) on the right — plus a per-token heatmap (advantage / logprob / mask / is_content) via server-side tokenizer decode.
  • Logs: one merged pane by default, interleaving the selected components by timestamp, with a components dropdown (trainer / orchestrator / inference / evals / envs) and a merge/split toggle that switches to stacked per-component panes (per-pane file select, maximize). Masters are the default files, the inference view is engine-only (single-node router lines hidden, viewable via a virtual "router" entry), env logs merge, follow is always on, shared regex + level filters, attempt selector (latest by default), abbreviated line counts, byte-range reads only (an 8 MB inference.log is never read whole). ANSI colors render as HTML and torchrun tee prefixes are stripped.
  • Works for SFT runs (SFT overview flavor; traces are eval-only) and tolerates the older episode schema (run.metadata, no token arrays).
  • Standalone PEP 723 uv script (FastAPI + uvicorn + tokenizers); project pyproject.toml untouched. uPlot is vendored, so the browser needs no internet. Live updates poll incrementally, so it works over a plain SSH tunnel (ssh -L 7788:localhost:7788 <host>).
  • Document the dashboard in the monitor-run skill.

Verification

The orchestrator-side inference-metrics mirroring is import-checked and exercised in the dashboard via synthetic time-keyed rows appended to a copy of a real metrics.jsonl; it has not yet run against a live training run (GPUs were occupied).

Against real runs on disk (no GPU involved): outputs/info-logs and outputs/bcast2-nccl (RL, current schema, 2 attempts) and an older run with eval rollouts. Exercised all API endpoints with curl and drove the UI with headless Chromium (all four tabs, overview card, smoothing slider, corner drag-resize, all-metrics regex filtering, merged multi-file logs, episode drawer, token heatmap) with zero console errors. Overview values match the trainer's own step logs (grad norm 0.0304, MFU 24.0%, entropy 0.0118 at step 10 of info-logs).

🤖 Generated with Claude Code

Serve a web dashboard from a run's output directory: a W&B-overview
replica read from metrics.jsonl, a merged ANSI-colored log stream
across all components, and a per-step rollout trace viewer with a
token-level advantage/logprob view. Works for RL and SFT runs, live
via polling, and over a plain SSH tunnel.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

mikasenghaas and others added 28 commits August 23, 2026 01:06
Restyle to the PI design language (prime-context): #111 canvas, lime
accent used categorically, mono-dominant type, hairline dividers, zero
radii, butterfly mark, segmented step progress bar, brand line-chart
palette. Add a Config tab showing the run's resolved config JSONs; tab
order is metrics, config, traces, logs. ABC Favorit is licensed and
not vendored - the type stack falls back to system mono.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add a platform-style run overview card shown on every tab: completion
percentage, step count, status/duration/objective/model/created
fields, and a full-width finely-segmented progress bar. Violet is now
the interactive accent and the default chart line color; lime remains
the semantic positive color. Metrics gain a rolling-average smoothing
slider and a global pane-size slider (wandb-style), both persisted in
localStorage.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Return the interactive accent to lime; chart lines keep the brand
purple. Replace the pane-size slider with a wandb-style corner drag
that resizes every pane together. The all-metrics view drops the
sidebar key list for sectioned charts of every key, grouped by
namespace, behind a prominent regex filter; charts below the fold
mount lazily.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Resize handles on all four card affordances wandb-style: bottom edge
for height only, right edge for width only, corner for both - still
applied to every pane together. The config tab gains a regex search
that highlights all hits and shows a count. The overview card drops
the objective field.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The inference router binds 8000 by default, so a dashboard left
running silently swallows all rollout requests with 404s. Use 7788,
the same default as the miles dashboard.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mirror inference metrics to the file monitor as time-keyed rows
(step=None) whenever a FileMonitor is registered; the dashboard plots
them in an overview inference section on relative wall time with
s/m/h/d ticks. Polish across the UI: shared fixed-width empty-state
boxes for every nothing-here case, a pulsing live indicator, tighter
chart cards with integer step ticks and axes anchored at zero,
green/red reward and advantage coding, scroll instead of pagination
for episodes, and a config-tab regex search with highlighted hits.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Rebuild the episode view as a three-pane popup modeled on the
platform's evaluation trace viewer: rollout selector with search and
prev/next on the left, numbered collapsible message entries with
per-message copy and collapse/expand-all in the center, and an
overview pane (reward, identity with copyable ids, activity counts,
tool definitions, state, rewards, sampling, timing) on the right.
Metrics: the regex filter now also applies to the overview, lines use
the accent color, axes auto-range to the data, and control heights
align. New runs register without a page refresh, the brand is the
logo alone, and the live dot is smaller. Tab order: config first,
metrics still the default.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Charts gain a hover popover with the x and y values (replacing the
uPlot legend) and smoothing now overlays the smoothed line on a faint
raw ghost. Overview and all-mode sections are collapsible and the
plain key count is gone. The traces step selector becomes a slider
with prev/next buttons and a step label; the episode count stays in
the status text. More bottom room for x-axis labels.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Metrics: multi-run comparison via a compare menu (per-run colors,
metrics only), drag a pane header to reorder panes (persisted), a
plain click resets drag-zoom, panel titles show matched keys instead
of regexes, and the scrollbar gets breathing room. Logs: the sidebar
is gone - trainer/orchestrator/inference/evals/envs render as a
vertical stack of panes (masters by default, env logs merged), each
maximizable, with a shared regex filter, always-on follow, abbreviated
line counts, and per-pane file selects. Traces: env/sort/errors-only
move into a filter popup on the right. Trace viewer: prev/next step
navigation with a clear step header, and the overview pane is
reordered - rewards and metrics under the big reward, runtime ID,
activity trimmed to turns + tool calls, a usage section, timing as a
tree, sampling dropped.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Single-node inference.log interleaves Rust router lines with the vLLM
engine output. The inference pane now hides router lines by default
and offers a virtual "router" entry in its file select that shows
only them; separate multi-node router.log files are untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The traces step selector becomes a full-width block bar in the
progress-bar style: one block per rollout step, filled through the
selection, eval steps marked, click or scrub to select. Runs without
max_steps show the step count with an unfilled track that carries a
lime sweep while running instead of a fake percentage. Log panes get
a fixed 300px height with the stack scrolling - maximize still fills
the tab.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Rewards and advantages render with exactly three decimals everywhere
(table, rollout list, overview reward and rewards rows) so columns
stay aligned - 1 shows as 1.000.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The config regex now filters the JSON to matching subtrees - a
matching key keeps its whole dict, nested matches keep their
ancestors - instead of only highlighting in the full file. The
traces subset preference (all/effective) re-applies as soon as the
preferred file exists at a step instead of sticking on a fallback,
so advantages reappear when returning to shipped steps. Drop the
redundant config path caption; revert the step-arrow sizing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The logs tab defaults to a single merged pane interleaving the
selected components by timestamp; a components dropdown toggles
trainer/orchestrator/inference/evals/envs and a merge/split seg
switches to the stacked per-component panes. Drop the disp.step
column from the trace table.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The run card drops the progress bar and percentage for a plain step
headline that also fits unbounded runs, and gains resumes plus train/
eval env fields (long lists fold into +N with a tooltip). Section
headers become full-width bars so the clickable region is obvious,
and y-axis labels use K-notation above 1000 to stop gutter overflow.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Panes share the available height equally instead of a fixed 300px
stack - toggle components off for more room per pane.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Two significant digits below 0.1 (0.001234 was 8 chars) and a
slightly wider gutter so labels like 0.0025 never clip.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Collapsed metric sections stack directly. One collapse/expand toggle
drives all sections on the metrics tab and all message entries in the
trace viewer, whose left pane now says episodes instead of rollouts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Run card: status leads, step is a regular field (79/200, unbounded
shows inf), duration and created sit on the right, resumes dropped.
Trace overview pane: reward and advantage headline together (n/a when
missing), accent section titles, is_truncated in state, identity at
the bottom, env/dispatch-step rows dropped, message roles all accent.
The episode table gains a branches column, the preferred subset
re-applies automatically when a live step ships its effective file,
and a shared fmtCompact helper renders counts as 1.1K/2.2M/3.3B.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Selects drop the native chrome for a flat hairline-chevron style,
dropdown buttons carry a caret and the floating menus share one panel
style. The drag-zoom selection shows a lime highlight, and pane
reordering moves the card the moment the cursor enters another pane.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
All view selections survive a refresh via localStorage: metrics mode,
filters, collapsed sections, trace kind/subset preference, sort and
errors-only, log view, components, level and search, config search,
and the token signal. The traces tab now defaults to the newest step
whose preferred subset has shipped, so advantages are visible on open
instead of landing on the in-flight step. Merge-view log lines carry
a minimal grey component prefix.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Drop the tunnel hint; print the serving path and the URL, underlined
in the accent green when attached to a terminal.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mikasenghaas and others added 5 commits August 23, 2026 04:45
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The config view renders as a JSON tree: any object or array line
folds on click (collapsed lines show an ellipsis with the entry
count), with a hover highlight marking the clickable row. Regex
pruning and hit marking work unchanged on the tree.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Inference metrics previously went only to W&B (directly) and, since
the dashboard branch, the file monitor (by reaching into the
registry). Route them through the monitors fan-out instead: every
registered monitor receives them as time-keyed rows (step=None), the
fan-out's exception isolation applies, and the collector no longer
knows about wandb or concrete monitor classes. The inference
define_metric moves into the W&B monitor init.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Apply a four-angle cleanup pass over the branch: dead CSS/JS from
earlier iterations removed (old drawer styles, percent header, pager,
unused formatters and response fields), shared helpers replace
copy-paste (regex-or-substring filter, debounce, seg-active sync,
reward class, preview truncation, dropdown wiring now one delegated
handler on .dd-wrap), the dd-menu/dd-btn classes own the popup styling
they were created for, one global summary rule covers every details
variant, and the backend drops unused params and fields, shares config
resolution, caches the immutable started timestamp, and gains one
path-safety helper. Efficiency: incremental retime and per-pane log
re-renders, O(n) rolling mean, parallel compare fetches, an in-flight
tick guard, cached step maximum, and render skips when nothing
changed. The all-metrics view now nests sections along key paths
(train -> env -> all/effective) so large key fleets stay navigable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants