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

+29 -10
View File
@@ -862,14 +862,6 @@ const RadBatch* BatchBuilder::build(const StepPlan& plan, const IKVManager& kv,
(long long)max_seqs_, (long long)max_tok_);
return nullptr;
}
if (plan.spec_is_tree) {
/* spec_parent is in the ABI and allocated, but no drafter emits a tree, so tree parents
* and positions are not written. Filling in the linear-chain answer would verify a tree
* against the wrong causal mask. */
RAD_ERR("tree-layout speculation was requested but is not implemented in this build");
return nullptr;
}
Set& s = set_;
const int64_t n_seq = (int64_t)plan.e.size();
@@ -957,6 +949,29 @@ const RadBatch* BatchBuilder::build(const StepPlan& plan, const IKVManager& kv,
s.h_tok[k + j] = token_at(e, (int64_t)e.ctx_len + j + shift);
s.h_pos[k + j] = e.ctx_len + j;
}
/* A tree verify (RadBatch::spec_parent): every verify block of a tree step is staged as
* a tree, a chain proposal (prompt lookup) as the tree whose node j hangs off j - 1, so
* the card's acceptance and the host's agree on every row. Node j stores its K and V at
* its row's position (the slots below are unchanged) and rotates at the anchor + its
* depth. A parent is named by its row within the sequence's rows (from cu_seqlens), the
* index an attention kernel has. A card row is restaged by ADV_TRUNK from its StepSlot. */
if (plan.spec_is_tree) {
for (int32_t j = 0; j < e.n_tokens; ++j) s.h_parent[k + j] = -2;
if (e.produces_token && !e.is_prefill && e.n_spec > 0 &&
e.n_spec < e.n_tokens && e.n_spec <= RAD_SCHED_MAX_SPEC) {
const int32_t a0 = e.n_tokens - 1 - e.n_spec; /* the anchor's row */
int32_t dep[1 + RAD_SCHED_MAX_SPEC];
dep[0] = 0;
s.h_parent[k + a0] = -1;
for (int32_t j = 1; j <= e.n_spec; ++j) {
int32_t p = e.draft_parent ? e.draft_parent[j - 1] : j - 1;
if (p < 0 || p >= j) p = j - 1;
dep[j] = dep[p] + 1;
s.h_parent[k + a0 + j] = a0 + p;
s.h_pos[k + a0 + j] = e.ctx_len + a0 + dep[j];
}
}
}
/* Every row of a sequence runs with its request's adapter (RadBatch::lora_slot), fixed at
* admission; a placeholder row with no request is a base row. */
if (lora_on_) {
@@ -973,7 +988,8 @@ const RadBatch* BatchBuilder::build(const StepPlan& plan, const IKVManager& kv,
(e.req && e.req->media && !e.req->media->rope.empty()) ? &e.req->media->rope : nullptr;
for (int32_t j = 0; j < e.n_tokens; ++j) {
int32_t v[3];
const int64_t p = (int64_t)e.ctx_len + j;
/* h_pos, not ctx_len + j: a tree verify's rows rotate at their depth. */
const int64_t p = (int64_t)s.h_pos[k + j];
if (rl) rl->at(p, v);
else v[0] = v[1] = v[2] = (int32_t)p;
s.h_rope[k + j] = v[0];
@@ -1166,7 +1182,8 @@ const RadBatch* BatchBuilder::build(const StepPlan& plan, const IKVManager& kv,
* without drafts may follow one that had drafts, and the linear kernels need its accepted
* count instead of their absent-operand default of 1. */
B.num_accepted = cfg_.n_spec > 0 ? on_rank(base, b0, s.d_acc) : nullptr;
B.spec_parent = nullptr; /* a linear chain; the tree case is refused above */
/* Staged above on a tree step: each row's parent row, -2 for an ordinary causal one. */
B.spec_parent = plan.spec_is_tree ? on_rank(base, b0, s.d_parent) : nullptr;
B.rope_pos = mm_on_ ? on_rank(base, b0, s.d_rope) : nullptr;
B.rope_mixed = rope_mixed;
B.n_mm_rows = n_mm;
@@ -1205,6 +1222,7 @@ const RadBatch* BatchBuilder::build(const StepPlan& plan, const IKVManager& kv,
++ring_.live;
last_n_seq_ = n_seq;
last_n_tok_ = n_tok;
last_tree_ = plan.spec_is_tree;
ring_.head = off + used;
out_last_ = out_next_;
out_next_ = (out_next_ + 1) % kOut;
@@ -1236,6 +1254,7 @@ AdvanceArgs BatchBuilder::advance_args(int rank) const {
a.cu_off = off(s.d_cu);
a.q_off = off(s.d_q);
a.row_off = off(s.d_rows);
a.parent_off = last_tree_ ? off(s.d_parent) : -1;
a.row_pitch = (int32_t)max_seqs_;
a.grp_off = off(s.d_grp);
if (mm_on_) {