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

+32 -43
View File
@@ -59,9 +59,6 @@ struct KernelRow {
bool reference = false;
/* rad_kernel_chain: its launches can wait in the kernel instead of behind the barrier bit. */
bool chain = false;
/* rad_kernel_fetches_rows: it reads a mapped table's rows itself, so the engine does not read
* them ahead through the page cache (runtime/rowprefetch.h). */
bool fetches_rows = false;
};
/* A kernel bound to one geometry, one domain and one variant, with init() already run. */
@@ -217,9 +214,6 @@ struct WeightInfo {
void* ptr = nullptr;
void* host_ptr = nullptr;
uint64_t file_offset = 0;
/* Each selected plane's offset in the container (file_offset is plane_offset[0]), for a
* file-tier weight the loader relayouts on every read (weight_file_relaid). */
uint64_t file_plane_offset[RAD_ENC_MAX_PLANES] = {0};
/* First and last op index that read the weight. Prefetch runs off these, so layer offload is
* scheduling rather than prediction (spec §5). */
@@ -380,6 +374,9 @@ public:
/* The step's pooled vectors (rad_declare_pooled): set only by an embedding program, which has
* no logits buffer. */
rad_buf pooled_buf = 0;
/* The most words one request hands the plugin (rad_declare_plugin_words,
* RadBatch::plugin_words); 0 when the plugin reads none. */
int64_t plugin_words = 0;
/* Runtime LoRA (core/lora/), empty unless the engine was started with adapters enabled. */
std::vector<LoraIssueSite> lora_sites;
@@ -538,30 +535,6 @@ public:
};
/* The kernel whose layout hook settled `w`'s stored form, or null when it is stored as is or
* widened. */
inline const RadKernelInfo* weight_layout_kernel(const Program& prog, const WeightInfo& w) {
if (w.identity || w.widen || w.lay_op < 0 || (size_t)w.lay_op >= prog.ops.size()) return nullptr;
const OpInfo& op = prog.ops[(size_t)w.lay_op];
if (w.lay_band < 0 || (size_t)w.lay_band >= op.bands.size() || w.lay_dom < 0 ||
w.lay_dom >= RAD_N_DOMAINS)
return nullptr;
const KernelRow* row = op.bands[(size_t)w.lay_band].dom[w.lay_dom].row;
return row ? row->info : nullptr;
}
/* Whether the file tier can serve `w` by relayouting it on every read, as the loader does once
* for a resident weight: whole planes (no shard at a world above one, so each plane is one range
* of the container), not widened, and a kernel that relayouts. The selected planes are read from
* the container and the kernel's relayout writes the stored form into the pinned stage the copy
* to the card reads. The mapped tier cannot do this: it hands kernels the container's bytes. */
inline bool weight_file_relaid(const Program& prog, const WeightInfo& w, int world_size) {
if (w.identity || w.widen) return false;
if (w.decl.shard != RAD_SHARD_NONE && world_size > 1) return false;
const RadKernelInfo* ki = weight_layout_kernel(prog, w);
return ki && ki->relayout;
}
/* ================================================================== requests */
enum class ReqState { Waiting, Running, Preempted, Finished, Failed, Cancelled };
@@ -785,6 +758,12 @@ struct Request {
* The request still samples the one token max_tokens allows; the caller discards it. */
std::shared_ptr<TokenScores> token_scores;
/* Words the plugin reads on the step that samples the prompt's first token
* (RadBatch::plugin_words): word 0 is the engine's, the rest the caller's. At most
* Program::plugin_words of them, which the server checks before submission; clef's are laid
* out by abi/rad_clef.h. Empty for every other request. */
std::vector<int32_t> plugin_words;
/* An embedding request: the whole prompt in one step, never split (a bidirectional encoder
* cannot take half its input), finished at that step with its pooled vector in the sink
* (Sink::embedding). Nothing is generated. Only an embedding program (rad_declare_pooled)
@@ -893,14 +872,6 @@ struct Config {
* exact prefetch, a routed expert a routed layer at a time). Off by default because disk
* paces the step, so an accidental spill makes the server orders of magnitude slower. */
bool weights_disk_tier = false;
/* --row-prefetch on|off: a host gather's rows on the mapped tier (a table on disk, read
* through the container's mapping) are asked for ahead of its kernel (runtime/rowprefetch.h,
* CtxDesc::row_prefetch). Output-neutral; on is the default. */
bool row_prefetch = true;
/* --mapped-rewarm on|off: at startup, the mapped tier's pages an earlier run left in the page
* cache and the load's allocations reclaimed are asked for again, at most half of
* MemAvailable (RadFile::rewarm). Output-neutral; on is the default. */
bool mapped_rewarm = true;
std::string placement = "auto"; /* all_vram | layer_offload | expert_tiered | auto */
/* --embedding-placement and --ngram-placement as given (see TablePlacement), and their
@@ -1002,8 +973,8 @@ struct Config {
int n_spec = -1; /* --num-speculative-tokens; -1 = auto, 0 = off */
/* --spec-ngram K: speculate by prompt lookup alone, K drafts a step (core/sched/ngram.h), each
* proposal verified only when it pays for its verify rows (core/sched/lookup.h).
* Sets the window to K and tells the plugin to declare no draft head
* (RadBuildCtx::draft_head_off), so a head the container carries costs no memory. 0 (the
* Sets the window to K; a container that declares a draft head is refused at startup, since
* the head would draft in lookup's place. 0 (the
* default) is off: a deployment that speculates still uses prompt lookup for any sequence its
* head declines, and a container without a head speculates by prompt lookup at
* --num-speculative-tokens N. */
@@ -1037,6 +1008,17 @@ struct Config {
std::string kld_lora; /* --kld-lora NAME: score through this --lora adapter */
std::string kld_lora_sources; /* --kld-lora-sources PREFIX: only documents whose source starts so */
std::string kld_corpus; /* --kld-corpus FILE, read by --kld-record only */
int kld_top = 0; /* --kld-top N: record the N most likely tokens and the tail; 0 the whole vocabulary */
/* ---------------- CALIBRATION (GPTQ Hessians) ----------------
* `--calib-corpus FILE` replaces the server like the KL mode: every document of a JSONL corpus
* goes through prefill once, nothing is scored, and a plugin that keeps calibration statistics
* records them into --calib-dir (RadBuildCtx::calib_dir) for --calib-layers. */
std::string calib_corpus; /* --calib-corpus FILE */
std::string calib_dir; /* --calib-dir DIR */
int32_t calib_layer_lo = 0; /* --calib-layers LO:HI, HI exclusive; 0:0 every layer */
int32_t calib_layer_hi = 0;
bool calib() const { return !calib_corpus.empty(); }
std::string kld_out; /* --kld-out FILE: the report as JSON, rows beside it */
bool kld() const { return !kld_record.empty() || !kld_ref.empty(); }
@@ -1045,6 +1027,11 @@ struct Config {
* when the container carries a vision tower and 0 when it does not. 0 serves text only and
* keeps a tower the container carries off the card. */
int64_t mm_max_patches = -1;
/* An image generator's bounds (RadBuildCtx::gen_max_pixels, gen_max_refs): the largest image it
* makes, in pixels, and the reference pictures a request. 0: the model's own. A smaller image
* shrinks the buffers the generator sizes for it, the activation arena with them. */
int64_t image_gen_max_pixels = 0;
int64_t image_gen_max_refs = 0;
/* The audio encoder's pass in frames, resolved at bring-up from the plugin's probe when the
* container carries an audio encoder; --mm-max-patches 0 (text only) turns it off too. */
int64_t mm_audio_frames = -1;
@@ -1146,9 +1133,6 @@ struct Config {
bool debug_graph = false;
bool debug_selection = false;
bool debug_placement = false;
/* --debug-tape-dump: each rank lists the dispatches of the first recorded pass of each kind
* (CtxDesc::tape_dump). */
bool debug_tape_dump = false;
/* --debug-draft-oracle FILE: prompt lookup proposes from these token ids, 30% of its drafts
* corrupted -- the verify path's test harness (Scheduler::draft_ngram). Empty is off. */
std::string debug_draft_oracle;
@@ -1179,6 +1163,11 @@ struct Config {
* (startup.h, rad_gate_reference_kernels). */
bool accept_reference_kernels = false;
/* A machine setting known to break radiance (compute wave save/restore off where cards serve)
* stops startup with what to change (core/diag/checks.cpp, incompatible()). This starts anyway:
* unsupported, with a banner at the top of the log and of the startup report. */
bool proceed_incompatible = false;
/* Where each operator-set option came from, keyed by the option table's spelling: "command
* line" or the supplying environment variable. Absent means default or resolved at startup;
* the startup report (core/diag/diag.h) prints this beside every value. */