Archived
radiance 1.11.0
New models: - GLM-5.3-Flash reads pictures: its vision tower and processor (--image-tokens sets the budget), with decode kernels for a few rows and the DSA indexer split over the ranks - Sage-A1.5 (fp8 and MXFP4) with its vision tower and a DFlash2 drafter - Unlimited-OCR (bf16) - Gemma 4 31B with z-lab's DFlash and RedHatAI's DFlash2 drafters; at four cards its all-reduces are fused with the junctions, overlapped with the compute and sent compressed - Ornith-1.5-35B-A3B w4a8 compose files Speed: - Block drafters (DFlash, DFlash2) accept their drafts on the card, and the next step is issued ahead - The four-rank all-reduce is faster for every --tp 4 model - qwen35_w8a8: the norms and SiLU write the int8 linears' operands directly - --attn-prefill-fp8 off|qk|pv|both: fp8 QK and PV legs for the h256 prefill attention (about +20% prefill on a 221K-token prompt for the 27B MXFP4 at TP2); lossy, off by default Features: - Control vectors: --control-vector off|on|disabled (disabled by default), a per-request switch, and the published Qwen3.8-Flash-Next refusal-direction vector (its license is in NOTICE) - Krea 2: the `rebalance` request field, as ComfyUI's ConditioningKrea2Rebalance - Cards with a small PCI BAR run, with kernel arguments kept in host memory - Dashboard: live acceptance figures; statsdump rotates its file at a size cap - KV caches every rank holds whole (GLM-5.3's latent and index caches) take one host-tier slot Fixes: - Long conversations taking turns no longer fall back to an early snapshot: a host-tier restore makes room as memory pressure does and waits a step for the previous turn's release (two conversations of 142K and 147K tokens sent back to back: 31.3 s per turn before, 2.8 s now) - Kernels before Linux 6.16 (amdgpu below 3.64) no longer hang at startup: virtual memory management is turned off there, with a warning - Gemma 4 dense scales its token embeddings as Hugging Face does (bf16), which changes its output - The four-rank all-reduce fences prefill-sized messages, for a rare divergence after a fresh start - GLM-5.3: every refusal names the setting and the reason; its template keeps string content - Several pictures in one request no longer refuse processors that take one image at a time Changes: Plugin ABI 26: out-of-tree plugins must be rebuilt. The environment switches the PRs added are fixed rules or flags now (R4D_ATTN_FP8 is --attn-prefill-fp8).
This commit is contained in:
commit
9eaf10da6e
210 files changed
+14363
-2138
No files matched your search
+36
-58
@@ -1,47 +1,32 @@
|
||||
#!/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.
|
||||
# statsdump.py -- record /stats to a JSONL file, so the dashboard's figures can be read back over
|
||||
# time. /metrics carries most of them for a Prometheus scrape; this is for a machine without one:
|
||||
# one JSON object per poll, appended, python3's standard library only.
|
||||
#
|
||||
# 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 8000] [--every 1] [--seconds 3600] [--out stats.jsonl]
|
||||
# scripts/statsdump.py --url http://host:8000 --every 2 --out week.jsonl
|
||||
# RADIANCE_API_KEY=... scripts/statsdump.py
|
||||
#
|
||||
# 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
|
||||
# A row is the engine's snapshot verbatim plus `t` (the poll's unix time) and `dt_s` (seconds since
|
||||
# the previous successful poll, from the monotonic clock). Nothing is derived: the dashboard's
|
||||
# best/recent/now lines are computed from the same stream by whatever reads the file.
|
||||
#
|
||||
# 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.
|
||||
# A restart shows in the rows: `uptime_s` falls and `startup_s` is the restart's cost. The decode
|
||||
# floor resets with the process, so `step_ns_decode_best` compares across restarts only against a
|
||||
# known-good value for the same hardware.
|
||||
#
|
||||
# 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.
|
||||
# A failed poll leaves no row. Failures are reported on stderr as they happen and counted in the
|
||||
# exit summary, and a run that wrote no row exits 1.
|
||||
import argparse, json, os, sys, time, urllib.error, urllib.request
|
||||
|
||||
class RecorderDead(Exception):
|
||||
"""The output handle could not be reopened; recording cannot continue.
|
||||
|
||||
A closed handle raises ValueError on the next write/tell, which the OSError
|
||||
handlers do not catch -- the poller would die with a traceback and no exit
|
||||
summary (judge-4 slices B R1/R2). Dying HERE, loudly, with the summary, is
|
||||
the honest terminal state: the recorder cannot record."""
|
||||
"""The output file could not be reopened, so recording cannot continue. Raised instead of
|
||||
writing to a closed handle, whose ValueError would end the run without the exit summary."""
|
||||
|
||||
|
||||
def main():
|
||||
ap = argparse.ArgumentParser(add_help=True)
|
||||
ap.add_argument("--port", type=int, default=8800)
|
||||
ap.add_argument("--port", type=int, default=8000)
|
||||
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")
|
||||
@@ -57,20 +42,18 @@ def main():
|
||||
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.
|
||||
# Append, never truncate: the rows carry their own timestamps.
|
||||
out = open(a.out, "a")
|
||||
prev, ok, lost, streak, rotated = None, 0, 0, 0, 0
|
||||
dead = False
|
||||
|
||||
def rotate():
|
||||
"""Size cap (audit 2026-10-20 §6): an append-only recorder with no cap is a
|
||||
disk-full timer. Shift .1->.2 ... keep 5, start fresh; rows carry their own
|
||||
timestamps so the chain stays readable in order."""
|
||||
"""Moves the file to .1 (and .1 to .2, up to .5) and starts a new one."""
|
||||
nonlocal out, rotated
|
||||
try:
|
||||
out.close() # close() flushes; on a full disk the dirty buffer fails to land
|
||||
except OSError:
|
||||
pass # those rows are already counted lost -- the fresh handle is the point
|
||||
pass # those rows are already counted lost
|
||||
try:
|
||||
for i in range(4, 0, -1):
|
||||
src = "%s.%d" % (a.out, i)
|
||||
@@ -81,16 +64,14 @@ def main():
|
||||
rotated += 1
|
||||
sys.stderr.write("statsdump: rotated %s (generation %d)\n" % (a.out, rotated))
|
||||
except OSError:
|
||||
# The shift or the reopen failed (ENOSPC can bite when the directory must
|
||||
# grow). out is CLOSED here -- and a closed handle raises ValueError on the
|
||||
# next write, which the OSError handler does not catch (auditor ringer Q2).
|
||||
# Reopen best-effort before re-raising: append-open needs no disk space, so
|
||||
# this succeeds even on a full disk, and the poller keeps counting losses.
|
||||
# The shift or the reopen failed (ENOSPC when the directory must grow). `out` is
|
||||
# closed here, so reopen it before re-raising: opening for append needs no disk
|
||||
# space, and the poller keeps counting losses.
|
||||
try:
|
||||
out = open(a.out, "a")
|
||||
except OSError as reopen_err:
|
||||
raise RecorderDead("reopen after failed rotation: %s" % reopen_err) from None
|
||||
raise # reopen succeeded: the ORIGINAL error is now safe to swallow upstream
|
||||
raise # the caller's size check swallows it
|
||||
sys.stderr.write("statsdump: %s/stats every %.1fs -> %s\n" % (base, a.every, a.out))
|
||||
try:
|
||||
while True:
|
||||
@@ -101,17 +82,15 @@ def main():
|
||||
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.
|
||||
# The first failure of a streak, then every tenth.
|
||||
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
|
||||
# dt_s from the MONOTONIC clock: a wall-clock step (NTP) could make it
|
||||
# negative, and a consumer dividing counters by dt_s would inherit the
|
||||
# step. t stays wall-clock: it is the row's timestamp, not a delta.
|
||||
# dt_s from the monotonic clock, so a wall-clock step cannot make it negative;
|
||||
# t is the row's wall-clock timestamp.
|
||||
row["dt_s"] = round(time.monotonic() - prev, 3) if prev is not None else 0.0
|
||||
prev = time.monotonic()
|
||||
line = json.dumps(row, separators=(",", ":")) + "\n"
|
||||
@@ -120,15 +99,13 @@ def main():
|
||||
out.flush() # a killed poller must not lose the polls it did get
|
||||
ok += 1
|
||||
except OSError as e:
|
||||
# Disk full mid-write: loud, counted, and the poller SURVIVES to
|
||||
# report it (audit §6: this path used to die with a traceback and
|
||||
# no exit summary). The partial line, if any, is detectable JSONL.
|
||||
# A failed write (disk full) is counted and recording goes on; a partial
|
||||
# line, if any, is an unparseable JSONL row.
|
||||
lost += 1; streak += 1
|
||||
sys.stderr.write("statsdump: write failed (%s), %d lost\n"
|
||||
% (type(e).__name__, lost))
|
||||
# Drop the dirty buffer and reopen: a flush on the same full disk fails
|
||||
# again, and a later tell() would flush it and die OUTSIDE this handler
|
||||
# (judge slice 23: the cap check's tell() was the actual killer).
|
||||
# Drop the unwritten buffer and reopen: on a full disk a later tell() would
|
||||
# flush it and fail outside this handler.
|
||||
try:
|
||||
out.close()
|
||||
except OSError:
|
||||
@@ -152,7 +129,8 @@ def main():
|
||||
except KeyboardInterrupt:
|
||||
sys.stderr.write("statsdump: interrupted\n")
|
||||
except RecorderDead as e:
|
||||
sys.stderr.write("statsdump: DEAD (%s) -- exiting with summary\n" % e)
|
||||
sys.stderr.write("statsdump: stopped, the output cannot be written (%s)\n" % e)
|
||||
dead = True
|
||||
finally:
|
||||
try:
|
||||
out.close()
|
||||
@@ -160,8 +138,8 @@ def main():
|
||||
pass # a flush failing at exit must not eat the summary line below
|
||||
sys.stderr.write("statsdump: %d rows written, %d polls lost, %d rotations, %s\n"
|
||||
% (ok, lost, rotated, 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
|
||||
# A run that wrote nothing, or could not go on writing, exits 1.
|
||||
return 1 if ok == 0 or dead else 0
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Reference in new issue
Block a user