radiance 1.14.0

New models and formats:
- libr3d: a kernel library for RDNA3 (gfx11) cards
- nomic-embed-text-v2-moe (the nomicbert plugin)
- Gemma 4 E2B with its per-layer MLP width, and Google's unmodified E2B/E4B directories in bf16
- DeepSeek-V4.1-Flash converted straight from its release: the Engram tables, the fused imatrix and
  rad-convert --chat-template for a release that ships no template
- GGUF Q8_0, Q4_K and Q6_K tensors import as their planes; rad-convert writes them without a recipe
- Qwen3.8-Flash-Next-FP8 converts and serves through qwen4exp_fp8

Speed:
- hc_read's decode kernels as one grid (34.7 -> 25.2 us at 4 rows) and its tiled up-mix pipelined
- gemm_fp8a8: the narrow form's scales staged through LDS (Flash-Next int8 at 32 rows 83.6 -> 68.3
  us), the gated three-tile form at 8 waves (gate_up at 48 rows 272.9 -> 180.6 us)
- Qwen3.8-27B: the delta net's out-projection read beside its decode recurrent update (x1 19.40 ->
  19.10 ms a step), and the verify's split-KV attention sized by context depth (x3 at 180K 42.4 ->
  40.3 ms a step)
- Hy-Memory (HYV3) decode: fused QK norm, RoPE and KV store, residual adds folded into the norms,
  coalesced one-token expert GEMMs
- spechub: the coupled verify walks the live candidates only (151 -> 31 us a launch)

Speculation:
- DFlash2: lossless coupled acceptance at T > 0 (--draft-coupling on)
- A block drafter's proposals verified as a tree, on by default for the Gemma 4 31B's DFlash2, with
  a block-16 tree that runs its short block under load

Features:
- Decode-hot residency: --draft-expert-placement host, --expert-profile, --expert-pin-top, and
  --expert-stats FILE for the routed experts each layer selects
- --ngram-placement ram=DIR: one n-gram table shared by engines on separate cards
- Prefix cache: --prefix-resume exact (default) resumes a hit on the cold run's own chunk grid, so it
  answers bit-identically; snapshots at a head other prompts share, from 528-token prompts, and for
  tip-only one drafter window below the tip; hits on models whose KV groups have different block
  sizes; the snapshot store keeps a floor of 8 ahead of --host-headroom-mib
- Typed tool-call argument tags; rad-chatparse --request renders and reads back one request as the
  server does
- MiniMax-H3: keyframes ride a latent upscale
- Gemma 3's fused all-reduce junction on the lossy wire

Fixes:
- A speculative step shorter than its band (an MTP step of 4 rows at gqa 8) no longer stops the
  engine with a scratch refusal at issue (#293)
- --p2p off: prefill back to 1.12.0's rate; 1.13.0's push check read a host-memory slot over the link
  twice (#323)
- A chat template that cannot render a conversation is refused at load, not mid-request
- imatrix entries found under llama.cpp's spelling; the W4A8 prefill's tail scale read; the GDN conv
  kernels on an f32 weight; dense integer rows at the group they compute (a Q8_0 weight at group 32)
- --expert-profile refuses a profile recorded on another model
- hc_read's one-grid wait traps past its deadline instead of reading a stale value

Changes: Plugin ABI 31, unchanged. RADIANCE_DRAFT_TREE, DFLASH2_TREE_NODES, DFLASH2_TREE_TEMP and
DFLASH_Q_TEMP are gone (trees run where the probe says they pay; temperatures 1.25 / 0.6).
This commit is contained in:
Deadcode committed 2026-10-29 12:04:24 +01:00
1 parent 481fcd5df0
commit 4a61d7296b
160 files changed
+8790 -6819

No files matched your search

+78 -28
View File
@@ -462,6 +462,9 @@ HttpResponse Server::handle_stats(const HttpRequest&) {
l["prefetch_bytes"] = s.link.prefetch_bytes;
l["staged_bytes"] = s.link.staged_bytes;
l["stream_bytes"] = s.link.stream_bytes;
l["kv_stream_bytes"] = s.link.kv_stream_bytes;
l["kv_streaming"] = s.link.kv_streaming;
l["kv_stream_active"] = s.link.kv_stream_active;
o["link"] = std::move(l);
}
if (s.passes.present) {
@@ -1182,7 +1185,7 @@ nav button.on { color:var(--fg); background:var(--track); }
otherwise have had, and a percentage of the paged pool's token capacity says nothing
about it: it is a preemption signal, so it is kept, underneath, where it reads as one. -->
<div class="cell"><div class="n" id="m-kv">–<u></u></div>
<span class="cap">kv cache in vram</span>
<span class="cap" id="m-kvcap">kv cache in vram</span>
<span class="det" id="m-kvdet"></span>
<svg viewBox="0 0 200 22" preserveAspectRatio="none"><path/></svg></div>
<div class="cell"><div class="n" id="m-accept">–<u>%</u></div>
@@ -1353,7 +1356,7 @@ nav button.on { color:var(--fg); background:var(--track); }
<span class="cap">conversations can resume</span>
<span class="det" id="s-livedet"></span></div>
<div class="cell"><div class="n" id="s-vram">–<u>tok</u></div>
<span class="cap">context in vram</span>
<span class="cap" id="s-vramcap">context in vram</span>
<span class="det" id="s-vramdet"></span></div>
<div class="cell" id="s-hostcell"><div class="n" id="s-host">–<u></u></div>
<span class="cap">moved to host ram</span>
@@ -1638,6 +1641,9 @@ const RECENT = 30; /* 15 s at the 500 ms poll for a figure sampled every poll;
const RECENT_PREFILL = 10; /* 5 s */
const extAt = {}, winAt = {};
let lastActiveC = 0;
/* Whether the server streams its KV (--kv-resident). Settled at bringup, so it cannot change under
* a running page: the cells that name a memory tier read it instead of guessing. */
let kvStreamOn = false;
/* `win` false records the extreme only: acceptance pools its window in accPool and reads only
* `highest` from extAt. */
function noteSample(key, c, value, cap, win) {
@@ -1867,7 +1873,7 @@ const linkSegs = segs("linkbar", "linkrows");
* own mapping, read in place -- so it is the one that is not a grey. */
const TIER_INK = ["#f5f5f5", "#9a9a9a", "#5e5e5e", "#2b2b2b", "#3f6fa8"];
const INK_AR = "#60a5fa", INK_UP = "#4ade80", INK_DOWN = "#fbbf24", INK_SSD = "#a78bfa";
const INK_STREAM = "#f472b6", INK_PREFETCH = "#2dd4bf";
const INK_STREAM = "#f472b6", INK_PREFETCH = "#2dd4bf", INK_KV = "#fb923c";
/* The plane is painted as raw pixels, so the same inks are wanted as RGB triples. Parsed from
* TIER_INK rather than written out a second time: two lists of five colours is one list that
* will drift, and the drift is a legend that names the wrong band of the picture. */
@@ -2243,7 +2249,13 @@ function update(s, dt) {
* wrong headline: the drafter's own window group is sized one block-run per slot and therefore
* sits at 100% for the whole life of the server, so a headline reading the max reads 100% on a
* server using 4% of its cache. */
const kvFrac = s.kv_tokens_total > 0 ? s.kv_tokens_used / s.kv_tokens_total : 0;
/* ONE UNIT FOR ONE METER. The figure is bytes -- every group's, which is the only unit groups
* can be summed in -- and the bar used to be TOKENS, the binding group's. Groups hold different
* bytes per token, so the two were answering at different rates: the figure reached its total
* while the bar was half full and then the figure stood still while the bar went on climbing.
* A streamed group's host mirror, whose pages arrive in their own order, made the gap wide
* enough to read as a bug, and it was one. Both are bytes now, and the percentage is the bar. */
const kvFrac = s.kv_bytes_total > 0 ? (s.kv_bytes_used || 0) / s.kv_bytes_total : 0;
/* HELD, NOT READ. A finished turn's blocks stay held by the prefix cache so the next turn can
* reuse them, and they occupy the card for exactly as long as they are held -- so they belong
* in this figure. What leaves it is a block that reached the free list, which is where an
@@ -2255,14 +2267,31 @@ function update(s, dt) {
* holds, in place, so what it keeps for itself is below what the carve gave it -- and the gap is
* the expert plane's "Borrowed VRAM". The line says both numbers rather than one, because
* "of 3.1 GiB" alone would read as a smaller budget. */
const kvGave = (s.kv_bytes_carved || 0) - s.kv_bytes_total;
/* TWO LINES, because the slot is two lines and a third is clipped rather than drawn. The share
of the pool is not among them: it is the bar in the memory panel, and repeating it here cost
the line that says how much context the bytes are actually holding. */
const kvGave = (s.kv_bytes_carved || 0) - (s.kv_bytes_total || 0);
/* KV STREAMING CHANGES WHAT THESE BYTES ARE -- but only where it is switched on in fact, not
* where it was asked for: --kv-resident is a preference (zeroed when the architecture refuses
* it, and a no-op at or above the group's context), while kv_stream_active says a group really
* keeps a resident window under its context. Without it every block the cache holds is on the
* card, so "of <total>" is VRAM and the carve is its ceiling. With it the card holds only the
* ring and every other block's K/V sits in a pinned host mirror: the figure above is the
* mirror, which is the whole context and therefore larger than the carve -- printing the carve
* beside it as a "max", or below as "can grow to", put a smaller number next to the larger one,
* and the pool read full the moment the mirror did. The line names the tier instead, and the
* ring keeps its own figure. */
const kvStream = !!(s.link && s.link.kv_stream_active);
/* THE TIER THE NUMBER IS IN, spelled. A streamed group's held context lives in the host mirror,
* so the same figure is "in ram" on this card; without streaming every block is on the card and
* it stays "in vram". The sessions view asks the same question of the same pool and renames its
* cell from the flag this poll settles. `kvStream` is the ring's actual state, not the switch. */
kvStreamOn = kvStream;
$("m-kvcap").textContent = kvStream ? "kv cache in ram" : "kv cache in vram";
$("m-kvdet").textContent = s.kv_bytes_total > 0
? "of " + hb(s.kv_bytes_total) + " (max " + hb(s.kv_bytes_carved || 0) + ") · "
+ cnt3(s.kv_tokens_used) + " tok"
+ (kvGave > 0 ? " · " + hb(kvGave) + " lent to experts" : "")
? (kvStream
? "of " + hb(s.kv_bytes_total) + " in host mirror · " + cnt3(s.kv_tokens_used) + " tok"
+ " · " + hb(s.kv_bytes_carved || 0) + " VRAM ring"
: "of " + hb(s.kv_bytes_total) + " (max " + hb(s.kv_bytes_carved || 0) + ") · "
+ cnt3(s.kv_tokens_used) + " tok"
+ (kvGave > 0 ? " · " + hb(kvGave) + " lent to experts" : ""))
: "";
const aw = accWindow(s);
const awR = aw ? aw.ratio : null;
@@ -2298,29 +2327,31 @@ function update(s, dt) {
/* ONE MERGED FIGURE. The pool is carved into groups by state kind -- paged attention, the
* linear state, the drafter's own window -- and which of them a token landed in is an
* implementation detail of the carve, not a question anybody watching a server is asking. */
/* THE BAR IS THE BYTES BECAUSE THE PANEL IS ABOUT THE CARD, and it is filled from every group
* -- the recurrent ones included -- while the token figure beside it is the binding paged
* group's alone. They are not a unit conversion of each other and the panel says both.
*
* THE FILL IS IN TWO PARTS, and the second is the one that answers "why is the pool full when
* one conversation is running". The bytes are apportioned by the token split rather than
* measured, because the cache counts in blocks of the shared token axis and the bytes are
* every group's -- the ratio is what is being drawn, and it is exact in the unit it is taken
* in. */
/* THE FILL IS IN TWO PARTS, and the second is the one that answers "why is the pool full when
* one conversation is running". The share comes from the tokens (which blocks a running request
* reads versus which only the cache keeps is a fact about blocks) and is then spent in BYTES,
* the unit the figure and the percentage beside it are in, so the three cannot disagree. */
const kvCached = Math.min(s.kv_tokens_cached || 0, s.kv_tokens_used || 0);
const kvLive = Math.max(0, (s.kv_tokens_used || 0) - kvCached);
const kvCachedShare = (s.kv_tokens_used || 0) > 0 ? kvCached / s.kv_tokens_used : 0;
mKv.v.textContent = hbOf(s.kv_bytes_used, s.kv_bytes_total, " / ") + " · " + pct(kvFrac);
setSplit(mKv, kvLive, kvCached, s.kv_tokens_total || 0);
/* The two shares are FRACTIONS OF THE FILL, not of the track: spent as widths against a total
* of 1 they would draw a full bar for a pool holding 29 KiB. */
setSplit(mKv, (1 - kvCachedShare) * kvFrac, kvCachedShare * kvFrac, 1);
/* The segments named by what reclaiming them would cost, since a dimmer bar is not
self-explanatory. The split is by who references the blocks: the first part is context a
request on the card is reading, the second context nothing reads and the next eviction frees. */
mKvSub.textContent = s.kv_tokens_used > 0
? cnt3(kvLive) + " tok read by running requests · " + cnt3(kvCached) + " kept for reuse"
: "";
mKvMax.textContent = s.kv_tokens_max > 0
? "can grow to " + hb(s.kv_bytes_carved || 0) + " · " + cnt3(s.kv_tokens_max)
+ " tok, with what the experts borrowed taken back"
: "";
mKvMax.textContent = kvStream
? (s.kv_tokens_max > 0
? "a miss streams the missing blocks from the mirror into the ring"
: "")
: (s.kv_tokens_max > 0
? "can grow to " + hb(s.kv_bytes_carved || 0) + " · " + cnt3(s.kv_tokens_max)
+ " tok, with what the experts borrowed taken back"
: "");
mPc.v.textContent = pct(s.prefix_hit_rate); setBar(mPc.i, s.prefix_hit_rate, false);
/* ---- draft. The bar is the CONDITIONAL acceptance at that position; the reach row under the
@@ -2498,6 +2529,8 @@ function update(s, dt) {
const pre = (f) => lk[f] || 0;
const dP = (f) => prev.link[f] == null ? 0 : Math.max(0, (pre(f) - prev.link[f]) / dt);
const ar = d("ar_bytes"), dn = d("d2h_bytes"), sd = d("ssd_bytes"), st = d("stream_bytes");
/* Null-safe until a server reports it: an older one, or the switch off, reads as zero. */
const kv = lk.kv_streaming ? dP("kv_stream_bytes") : 0;
const pf = dP("staged_bytes") + dP("prefetch_bytes");
const up = Math.max(0, d("h2d_bytes") - pf);
const pfAll = pre("staged_bytes") + pre("prefetch_bytes");
@@ -2508,7 +2541,7 @@ function update(s, dt) {
* proportion then falls back to the CUMULATIVE bytes, which is the same question asked over
* the whole run, and the panel says out loud which of the two it is showing. The rates stay
* in the rows either way: they are never wrong, only sometimes zero. */
const live = ar + up + pf + dn + sd + st > 0;
const live = ar + up + pf + dn + sd + st + kv > 0;
const w = (now, all) => live ? now : all;
linkSegs([
{ name: "All-reduce", ink: INK_AR, w: w(ar, lk.ar_bytes),
@@ -2531,6 +2564,16 @@ function update(s, dt) {
a: rate(sd), b: hb(lk.ssd_bytes) },
{ name: "Expert streaming", ink: INK_STREAM, w: w(st, lk.stream_bytes),
a: rate(st), b: hb(lk.stream_bytes) },
/* KV STREAMING, --kv-resident (core/kvstream): each step's resolve copies the blocks a
* streamed group missed from the pinned host mirror into the VRAM ring. The row rides the
* switch, not the traffic: a server that took --kv-resident but never streams -- a pipeline
* that never enters the streaming path -- is exactly what a zero row with the switch on
* says, and that is a question worth answering at a glance. The bytes are rank 0's resolve
* counters times the world: the ranks see the same misses through maps brought up
* identically, so each card's link carries one rank's figure. */
...(lk.kv_streaming ? [{ name: "KV streaming", ink: INK_KV,
w: w(kv, pre("kv_stream_bytes")),
a: rate(kv), b: hb(pre("kv_stream_bytes")) }] : []),
]);
/* THE HEADLINE IS THE PCIe TOTAL, which is the all-reduce plus the moves. The SSD tier is
* left out of it on purpose: those bytes come off a disk into host memory and only the ones
@@ -2540,8 +2583,12 @@ function update(s, dt) {
* EXPERT STREAMING IS IN IT. A routed expert that was not resident is read by the MoE GEMM
* where it lies, which for every tier above VRAM means crossing the link on the critical
* path of the step. It is not a move and not a collective, and it is the traffic a promotion
* is spent to remove -- so the two belong on one axis. */
const lr = rates(ar + up + pf + dn + st);
* is spent to remove -- so the two belong on one axis.
*
* KV STREAMING IS IN IT WHILE THE SWITCH IS ON. Its resolve copies cross the same PCIe the
* movers use, already summed over the cards; with the switch off the term is zero and the
* headline reads as it did without the counter. */
const lr = rates(ar + up + pf + dn + st + kv);
$("lnk_n").firstChild.nodeValue = lr.n;
$("lnk_n").querySelector("u").textContent = lr.u;
/* WHAT IS SUMMED AND WHAT IS NOT. The move and stream rows are every card's added up,
@@ -3462,6 +3509,9 @@ async function loadSessions() {
/* VRAM IN TOKENS, HOST MEMORY IN BYTES. The pool's token count is the context the card can
serve without a copy; the host tier is sized by --prefix-cache-mib and read against it. A
tier that is off has no cell. */
/* A streamed server holds that context in its host mirror, not on the card, so the cell says
* where the tokens are; the flag comes from the stats poll (kvStreamOn). */
$("s-vramcap").textContent = kvStreamOn ? "context in ram" : "context in vram";
$("s-vram").firstChild.nodeValue = cnt3(pool.tokens_used || 0);
$("s-vramdet").textContent = pool.tokens_total ? "of " + cnt3(pool.tokens_total) + " tok" : "";
for (const [id, used, cap] of [["s-host", occ.host_bytes, occ.host_cap_bytes]]) {