dashboard: triple-tile rework, acceptance live-leads, Speculation bullet

metrics: export radiance:decode_step_seconds_best/_recent (omitted until measured)
scripts: statsdump.py -- /stats to JSONL verbatim recorder

Base: pr/decode-floor tip 14c5c8a (PR #142 content). Rebase onto v1.9.0 owed at
review time: upstream dashboard.cpp moved +87 lines in 1.9.0, expect conflicts.
NOT pushed, NOT merged. Turnstone review pending (Qwen busy).

Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (level not visible) via Open WebUI

(cherry picked from commit 4a8b8fabdd834f8eb59320e1945471a8caff47c9)
This commit is contained in:
Memoria (Noblistic) authored and StillDeadcode committed 2026-10-21 09:27:48 +02:00
1 parent 7e1f73c2a0
commit 8bc457d7e7
6 files changed
+324 -6

No files matched your search

+1
View File
@@ -38,6 +38,7 @@ and `agentreplay.py` need `python3`. Scripts find each other through `$(dirname
| `mctrace.sh` | A MiniCPM5-2B decode trace under `rocprofv3`, on its own server, formatted for `libr4d/isa/tsum.sh`, mainly for its `blocks` column. |
| `ident.sh` | Run-to-run reproducibility at a fixed configuration: one hash per (temperature, question), to compare against another run of the same configuration. A speculative run need not match a non-speculative one byte for byte (the split-K count is chosen from M, so reduction orders differ and a near-tie can flip late in a long answer), but a divergence within the first sentence or two is a defect. |
| `cardclock.py` | What holds each card's clock under sustained load, and which card a tensor-parallel step waits for (the slowest rank ends the step). Reads every AMD card's `gpu_metrics` table ten times a second and counts a throttler bit only when the clock is lower while it is set (some firmware keeps a bit on at idle). Shows the engine's step counters per window, so a slow window is attributed to slower steps, fewer tokens per step or host time between steps. Drives its own greedy load, or with `--watch` only samples a server under real traffic; `--compare` shows two saved runs side by side. Read-only on the cards. |
| `statsdump.py` | Record `/stats` to JSONL so the dashboard's figures can be measured over time instead of only watched: one object per poll, appended, `python3` only. Records the engine's snapshot verbatim plus the poll's own time and the gap since the last good poll -- it derives nothing, because the page's best/recent/now lines are computed from this same stream and a second copy of that arithmetic is a second thing that can drift. A failed poll leaves no row (a gap in the file is the honest record of a gap in the data) and an empty run exits non-zero, so a dead server cannot be mistaken for a quiet hour. The decode floor resets with the process: `step_ns_decode_best` improving across a restart is a new process finding its own best moment, not a faster machine. |
| `oracle.sh` | Every op compared against libref on the operands the model issued, which rad-kbench cannot do: its operands are its own (dense, rank 2), while the engine's are arena slices and weights loaded from a file. Starts its own server on :8302. Read it for `MISMATCH` lines, and for `NOT CHECKED` lines naming rows whose weight layout has no published inverse and so cannot be compared. |
## Regression checks against a live server
+90
View File
@@ -0,0 +1,90 @@
#!/usr/bin/env python3
# statsdump.py -- record /stats to a JSONL file, so the dashboard's figures can be measured over
# time instead of only watched.
#
# The dashboard answers "what is this process doing right now". Answering "what was it doing at
# 3 a.m., and is its best step time worse than last week's" needs the same numbers kept. /stats
# already carries them -- the decode floor, throughput per window, cache behaviour, the draft
# counters -- and /metrics carries most of them for a Prometheus scrape. This is the third option,
# for anyone who does not run a scraper: one JSON object per poll, appended, no dependencies beyond
# python3.
#
# scripts/statsdump.py [--port 8800] [--every 1] [--seconds 3600] [--out stats.jsonl]
# scripts/statsdump.py --url http://host:8800 --every 2 --out week.jsonl
# RADIANCE_API_KEY=... scripts/statsdump.py --port 8800
#
# WHAT IS RECORDED: the engine's own snapshot, verbatim, plus `t` (the poll's own unix time) and
# `dt_s` (seconds since the previous successful poll). Nothing is derived. The page's best/recent/
# now lines are computed in the browser from this same stream, and recomputing them here would put
# a second copy of that arithmetic where it could drift from the first -- so the analysis step
# derives them, from data that cannot disagree with the engine.
#
# Restarts are visible in the rows themselves: `uptime_s` falls and `startup_s` is the cost of the
# restart that just happened. The decode floor resets with the process, so `step_ns_decode_best`
# improving across a restart is a new process finding its own best moment, not a faster machine --
# compare `best` across restarts only against a known-good value for the same hardware.
#
# A poll that fails leaves NO row: a gap in the file is the honest record of a gap in the data, and
# a fabricated row would be a measurement. Consecutive failures are reported on stderr as they
# happen, and the exit summary states how many polls were lost, so an empty file cannot be mistaken
# for a quiet hour.
import argparse, json, os, sys, time, urllib.error, urllib.request
def main():
ap = argparse.ArgumentParser(add_help=True)
ap.add_argument("--port", type=int, default=8800)
ap.add_argument("--url", default=None, help="full base URL; overrides --port")
ap.add_argument("--every", type=float, default=1.0, help="seconds between polls")
ap.add_argument("--seconds", type=float, default=0.0, help="stop after this long; 0 = run until interrupted")
ap.add_argument("--out", default="stats.jsonl")
ap.add_argument("--api-key", default=os.environ.get("RADIANCE_API_KEY"),
help="or set RADIANCE_API_KEY; the key is never echoed")
a = ap.parse_args()
base = (a.url or "http://127.0.0.1:%d" % a.port).rstrip("/")
hdr = {"Authorization": "Bearer " + a.api_key} if a.api_key else {}
deadline = time.time() + a.seconds if a.seconds > 0 else None
# Append, never truncate: a file that already holds last week's data is worth more than a clean
# start, and the rows carry their own timestamps.
out = open(a.out, "a")
prev, ok, lost, streak = None, 0, 0, 0
sys.stderr.write("statsdump: %s/stats every %.1fs -> %s\n" % (base, a.every, a.out))
try:
while True:
t0 = time.time()
try:
req = urllib.request.Request(base + "/stats", headers=hdr)
with urllib.request.urlopen(req, timeout=max(5.0, 4 * a.every)) as r:
row = json.loads(r.read().decode())
except (urllib.error.URLError, OSError, ValueError) as e:
lost += 1; streak += 1
# Report the first failure and then every tenth: one bad hour should be visible
# without the file's own signal being buried in identical lines.
if streak == 1 or streak % 10 == 0:
sys.stderr.write("statsdump: poll failed (%s), streak %d, %d lost\n"
% (type(e).__name__, streak, lost))
else:
streak = 0
row["t"] = t0
row["dt_s"] = round(t0 - prev, 3) if prev is not None else 0.0
prev = t0
out.write(json.dumps(row, separators=(",", ":")) + "\n")
out.flush() # a killed poller must not lose the polls it did get
ok += 1
if deadline is not None and time.time() >= deadline:
break
# Sleep from the poll's START, so a slow engine does not walk the schedule later.
left = a.every - (time.time() - t0)
if left > 0:
time.sleep(left)
except KeyboardInterrupt:
sys.stderr.write("statsdump: interrupted\n")
finally:
out.close()
sys.stderr.write("statsdump: %d rows written, %d polls lost, %s\n" % (ok, lost, a.out))
# An empty file is a failure, not a quiet run: say so with the exit status, not only in prose.
return 1 if ok == 0 else 0
if __name__ == "__main__":
sys.exit(main())