radiance 1.15.0

New models and formats:
- IQR for Qwen3.8-27B: weights on the int8 grid under GPTQ, a trellis down each GPTQ column
  (IQR-V2), and IQR-V3, a computed trellis code under one scale a row, kept at its codes' width in
  VRAM and decoded in the GEMM; 15 IQR-V3 recipes from ~2 to ~7 bits a weight
  (data/recipes/q38-27b-*-v3.recipe, docs/IQR.md)
- libhalo: a kernel library for Strix Halo (gfx1151), preferred there over libr3d
- Nemotron 3.5 Embed 1B and 8B (nemotron35_embed): text and image embeddings through a Pixtral
  tower, on the card and on the CPU
- Nemotron 3.5 Rerank 8B
- /v1/systemone: Cloudflare's clef and clef-flash, Convai Innovations' Laya and Mica beside
  LiquidAI d1; scored steps read the candidates' logits from the head table with no lm_head pass
- LFM2's 8-bit trunk: block-fp8 or int8 linears with the fused producers, and the d1-3B recipe
- DeepSeek-V4.1's reply format with DSML tool calls and typed argument tags

Weights on the drive:
- The file tier reads only the experts the pass routes rows to; the draft head's weights stay in
  the host pool
- A hot VRAM cache for routed experts read off the drive, reads deposited straight into free host
  pool slots, and copyless evictions; the file tier's counters are now ssd_*
- GLM-5 Next shards its routed experts by expert, not by width, so they can live on the drive
- The stall watch counts drive reads as progress, and the DMA lane's room check reads the lane's
  own completion fence

Quantisation tooling:
- --calib-corpus, --calib-dir and --calib-layers record each linear's input Hessian; beside
  --kld-record the reference's own run records them
- --kld-top N records a sparse KL reference (the N most likely tokens and the tail's mass)
- GPTQ in a third of the time with the same codes, trellis GPTQ on the card, vector codebooks
  with coordinate descent, and rad-convert --reuse repeated, each container supplying what the
  earlier ones lack

Speculation:
- Prompt lookup alone (--spec-ngram K, --spec-ngram-min/-max): each sequence keeps an index of its
  n-grams, and a proposal is verified only when its measured step cost says it pays;
  --draft-window adaptive follows it

Speed:
- IQR decode: the narrow tile splits K for four times the int8 tile's waves and folds each 128-K
  block once; at 8 tokens down and the output projections run in 0.61-0.82x and 0.70-0.92x FP8's
  time (2-6 bits); IQ6R-S-V3 with its DFlash2 drafter steps in 26.3 ms at TP2, against 29.4 ms
  before and FP8's 27.3
- Qwen MXFP4 feed-forward: the gated fold up to 16 rows, not 8
- libr4d: the gated prefill fold, the short-prompt split row, and the rows forms of rmsnorm and
  rope; KLATE again for the head-256 gqa6 paged prefill; gram_accum on the matrix cores

Features:
- /health, /v1/health and /ping answer 503 with "status": "stuck" once the device has advanced
  nothing for a minute or a queue has faulted, so a supervisor can restart a wedged server (#356)
- --image-gen-max-pixels and --image-gen-max-refs size an image generator's buffers (#344)
- The startup report lists only the options not at their default, with a count; -v lists all
  (#250)
- --preempt-wait-ms bounds how long a preempted prefill waits for its whole-recompute room
- --placement layer_offload spills dense layers so one --max-model-len sequence fits
- Startup refuses amdgpu with CWSR off and says how to fix it;
  --proceed-with-incompatible-configuration starts anyway under an UNSUPPORTED banner

Fixes:
- The n-gram read-ahead hands each row to the reader once and reads only as far ahead as the row
  cache holds, and pauses while decode reads: about one drive read a row instead of two (#355)
- A file-tier window reads each of its runs once, not once a run per run
- The decode split law's verify floor is bounded by the batch's workgroups: max_seqs 256 no longer
  declares 64x the scratch (#342)
- A prefetch DMA list's mark stays out of the signal pool until the engine has read it, and a
  prefill stage copies only the blocks its own tables name (#343)
- The split-KV row sum is read with fetch-inactive (#328)
- LFM2 on the host backend: libref and libavx serve the row-form ops it declares (#348)
- The preempted-prefill gate skips a KV group that holds no blocks (#352)
- Every request entry point bounded, gated and sanitised (JSON depth, invalid UTF-8, control bytes
  in the log, the dashboard's CSP, cross-origin browsers on the loopback-only routes); a prompt id
  outside the vocabulary refused at admission; --api-key "" refused at startup
- The telemetry the HTTP thread reads is atomic
- An RMS norm row no longer depends on how many rows its launch carries; prefill attention's
  rescale is decided by live rows only
- A --kld-record prefill chunk that finishes no sequence gets its logits on a tied-head model
- A kernel's lazily made counter block is zeroed outside the lock other ranks take (a TP2 first-step
  hang)

Changes: Plugin ABI 32. Every plugin exports a layout fingerprint of the ABI structs and the loader
refuses a plugin without it or with another (#302), so out-of-tree plugins must be rebuilt.
Appended: RadBuildCtx calib_* and gen_max_*, RadArchProbe gen_max_*, RadBatch score_only and
plugin_words, RadDeviceProps::unified, RadChatFormat arg_json_value_prefix.
This commit is contained in:
Deadcode committed 2026-10-30 22:01:01 +01:00
commit 9ed3ef7a7b
452 files changed
+167762 -1346

No files matched your search

+98
View File
@@ -25,6 +25,7 @@
#include "runtime/residency.h"
#include "runtime/wtab.h"
#include <algorithm>
#include <atomic>
#include <chrono>
#include <cstdlib>
@@ -1808,6 +1809,103 @@ TEST(kv_pools_bind_each_layer_to_its_place_in_the_group) {
CHECK_EQ(b[3].layer_slot[2], 0);
}
/* A staged pass copies the ranges its own tables occupy (kvstream/stage.h, "Volume"). Every id a
* table names must lie in a range, or the attention reads another layer's bytes there; the ranges
* are sorted, disjoint and at most kStageMaxRuns. Over random tables, a range never starts or ends
* on a block more than kStageGapBlocks from a named one unless the cap forced the join. */
TEST(the_stage_ranges_cover_every_block_a_table_names) {
const int64_t bb = 1024;
auto covered = [&](const std::vector<rad::KVStageRun>& r, int64_t id) {
for (const rad::KVStageRun& x : r)
if (id * bb >= x.off && id * bb + bb <= x.off + x.bytes) return true;
return false;
};
auto well_formed = [&](const std::vector<rad::KVStageRun>& r) {
bool ok = (int64_t)r.size() <= rad::kStageMaxRuns;
for (size_t i = 0; i < r.size(); ++i) {
ok = ok && r[i].bytes > 0 && r[i].off % bb == 0 && r[i].bytes % bb == 0;
if (i) ok = ok && r[i].off > r[i - 1].off + r[i - 1].bytes;
}
return ok;
};
/* Two tables, one gap within the join distance, one past it, a duplicate and an unused -1. */
const std::vector<int32_t> a = { 0, 1, 2, 3, 40, 41 }, b = { 3, 4, 5, 10, -1, 41, 42 };
std::vector<rad::KVStageRun> r;
rad::kvstream_runs({ &a, &b }, bb, &r);
REQUIRE_EQ((int)r.size(), 2);
CHECK_EQ(r[0].off, (int64_t)0);
CHECK_EQ(r[0].bytes, 11 * bb); /* 0..5 and 10, the gap of 4 copied through */
CHECK_EQ(r[1].off, 40 * bb);
CHECK_EQ(r[1].bytes, 3 * bb);
std::vector<rad::KVStageRun> e = { rad::KVStageRun{ 7, 7 } };
rad::kvstream_runs({}, bb, &e);
CHECK(e.empty());
const std::vector<int32_t> none = { -1, -1 };
rad::kvstream_runs({ &none }, bb, &e);
CHECK(e.empty());
uint32_t rng = 0x5eed;
auto next = [&] { rng = rng * 1664525u + 1013904223u; return rng >> 8; };
for (int round = 0; round < 200; ++round) {
std::vector<std::vector<int32_t>> ts((size_t)(1 + next() % 8));
const bool sparse = round % 4 == 3; /* isolated ids: the cap has to join */
for (auto& t : ts) {
int32_t id = (int32_t)(next() % 50000);
const int n = 1 + (int)(next() % 3000);
for (int k = 0; k < n; ++k) {
t.push_back(id);
id += sparse ? 1 + (int32_t)(next() % 400) : (next() % 64 ? 1 : 1 + (int32_t)(next() % 100));
}
std::reverse(t.begin() + (ptrdiff_t)(t.size() / 3), t.end()); /* not ascending */
}
std::vector<const std::vector<int32_t>*> tp;
for (const auto& t : ts) tp.push_back(&t);
std::vector<rad::KVStageRun> got;
rad::kvstream_runs(tp, bb, &got);
CHECK(well_formed(got));
int64_t missed = 0;
for (const auto& t : ts)
for (const int32_t id : t) missed += !covered(got, id);
CHECK_EQ(missed, 0ll);
if ((int64_t)got.size() < rad::kStageMaxRuns) {
/* No forced join: each range's ends are named blocks. */
std::vector<int32_t> all;
for (const auto& t : ts) all.insert(all.end(), t.begin(), t.end());
std::sort(all.begin(), all.end());
for (const rad::KVStageRun& x : got) {
CHECK(std::binary_search(all.begin(), all.end(), (int32_t)(x.off / bb)));
CHECK(std::binary_search(all.begin(), all.end(), (int32_t)((x.off + x.bytes) / bb - 1)));
}
}
}
}
/* Blocks no table of the step names are not copied, however low their ids: a prefix cache that
* retains a long conversation in blocks 0..29999 leaves a new 2K-token prompt in the ids above,
* and the prompt's pass copies its own 500 blocks, not the 30 500 below its highest id. */
TEST(the_stage_ranges_leave_out_blocks_no_table_of_the_step_names) {
const int64_t bb = 1024;
std::vector<int32_t> fresh;
for (int32_t id = 30000; id < 30500; ++id) fresh.push_back(id);
std::vector<rad::KVStageRun> r;
rad::kvstream_runs({ &fresh }, bb, &r);
REQUIRE_EQ((int)r.size(), 1);
CHECK_EQ(r[0].off, 30000 * bb);
CHECK_EQ(r[0].bytes, 500 * bb);
/* A prefix hit names the retained blocks it resumes from, and those are copied. */
std::vector<int32_t> hit;
for (int32_t id = 0; id < 4000; ++id) hit.push_back(id);
for (int32_t id = 30500; id < 30600; ++id) hit.push_back(id);
std::vector<rad::KVStageRun> h;
rad::kvstream_runs({ &fresh, &hit }, bb, &h);
REQUIRE_EQ((int)h.size(), 2);
CHECK_EQ(h[0].off, (int64_t)0);
CHECK_EQ(h[0].bytes, 4000 * bb);
CHECK_EQ(h[1].off, 30000 * bb);
CHECK_EQ(h[1].bytes, 600 * bb);
}
/* A streamed group's prefill pool is ONE layer deep and every layer of the group addresses it.
*
* Above `qsa_exact_to` one prefill launch selects 70-100% of the live history (docs/KV-STREAMING.md