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

+59 -6
View File
@@ -28,6 +28,7 @@
#include <atomic>
#include <chrono>
#include <csignal>
#include <cstdio>
#include <cstring>
#include <cstdint>
#include <cstdlib>
@@ -488,9 +489,11 @@ int Engine::prepare_release(const RadBatch* b) {
step_status_.store(RAD_E_NOMEM, std::memory_order_release);
}
if (ranks_.size() > 1) (void)rad_dev_set(ranks_[0]->device);
/* The stage bound for every rank (kvstream/stage.h, "Volume"). Rank 0's allocator hands out the
* block ids every rank uses, and the ranks are parked, so no allocation races the read. */
for (auto& rk : ranks_) kvstream_bound_live(&rk->ctx, ranks_[0]->kv);
/* The stage's ranges for every rank (kvstream/stage.h, "Volume"): the blocks the step's own
* tables name. Rank 0's allocator hands out the block ids every rank uses, and the ranks are
* parked, so no allocation races the read. */
kvstream_step_runs(ranks_[0]->kv, b, sched_.step_seqs(b), &stage_runs_);
for (auto& rk : ranks_) kvstream_bound_live(&rk->ctx, stage_runs_);
return RAD_OK;
}
@@ -552,7 +555,7 @@ int Engine::step_loop() {
std::vector<uint64_t> cancel;
/* Not in KL mode: its scored rows are copied out of the logits buffer after collection, and a
* pass issued ahead would overwrite them. */
pipelining_ = !cfg_.kld() && !embedding_ &&
pipelining_ = !cfg_.kld() && !cfg_.calib() && !embedding_ &&
(serial_drafting() || block_drafting() || cfg_.n_spec <= 0);
early_ids_ = !cfg_.kld() && !embedding_;
/* A tree's acceptance moves K and V on the card behind the step issued ahead. The KL mode
@@ -2037,11 +2040,11 @@ int Engine::serve(std::unique_ptr<StallWatch> watch) {
for (int i = 0; i < cfg_.tp; ++i) rank_threads_.emplace_back([this, i] { rank_loop(i); });
std::thread stepper([this] { if (gen_) gen_loop(); else step_loop(); });
if (cfg_.kld()) {
if (cfg_.kld() || cfg_.calib()) {
print_startup_report(RAD_OK);
startup_watch_.reset();
}
int s = cfg_.kld() ? run_kld() : run_server();
int s = cfg_.kld() ? run_kld() : cfg_.calib() ? run_calib() : run_server();
startup_watch_.reset();
/* Stop the step loop before the server's storage is destroyed: Request::sink points into it,
@@ -2506,6 +2509,7 @@ int Engine::run_server() {
d.tok = &tok_bridge;
d.grammar = &grammar_bridge;
d.live = snap;
d.stuck_ms = [] { return dev_stuck_ms(); };
/* The control vector, when one was found. The admin endpoint flips the
* default through this; nothing rebuilds a graph, so a toggle takes effect on the next request
* and leaves the running ones alone. */
@@ -2575,6 +2579,42 @@ int Engine::run_server() {
o.audio_model = aud_gen_ != nullptr;
o.video_model = vid_gen_ != nullptr;
o.decision_type = rad_meta_gets(&meta_, "decision.type", "");
/* clef's learned scalars, which the server applies to what the head returns (server/clef.h);
* rad-convert writes them beside decision.type. */
if (o.decision_type == "clef") {
const char* const keys[3] = { "decision.clef.prior_logit_scale",
"decision.clef.joint_logit_scale",
"decision.clef.residual_gate" };
o.clef_scalars = true;
for (const char* k : keys) o.clef_scalars = o.clef_scalars && rad_meta_gets(&meta_, k, nullptr);
o.clef_prior_logit_scale = rad_meta_getf(&meta_, keys[0], 0.0);
o.clef_joint_logit_scale = rad_meta_getf(&meta_, keys[1], 0.0);
o.clef_residual_gate = rad_meta_getf(&meta_, keys[2], 0.0);
}
/* Laya's sequence lengths, special tokens and fitted temperatures, which the server builds
* and reads each question with (server/laya.h); rad-convert writes them from the checkpoint's
* rl_agent_config.json and tokenizer/. */
/* Mica's calibration: one temperature, and a bias on a noul's true logit (server/mica.h). */
if (o.decision_type == "mica") {
o.mica.temperature = rad_meta_getf(&meta_, "decision.mica.temperature", 1.0);
o.mica.noul_logit_bias = rad_meta_getf(&meta_, "decision.mica.noul_logit_bias", 0.0);
}
if (o.decision_type == "laya") {
server::LayaSettings& l = o.laya;
l.max_len = rad_meta_geti(&meta_, "decision.laya.max_len", 0);
l.head_max_len = rad_meta_geti(&meta_, "decision.laya.head_max_len", 0);
l.cls = (int32_t)rad_meta_geti(&meta_, "decision.laya.cls", -1);
l.sep = (int32_t)rad_meta_geti(&meta_, "decision.laya.sep", -1);
l.mask = (int32_t)rad_meta_geti(&meta_, "decision.laya.mask", -1);
l.mask_token = rad_meta_gets(&meta_, "decision.laya.mask_token", "");
std::sscanf(rad_meta_gets(&meta_, "decision.laya.temperature", "1 1 1"), "%lf %lf %lf",
&l.temperature[0], &l.temperature[1], &l.temperature[2]);
const std::string tbo = "decision.laya.temperature_by_options.";
for (int i = 0; i < meta_.n_kv; ++i)
if (std::strncmp(meta_.kv_key[i], tbo.c_str(), tbo.size()) == 0)
l.temperature_by_options[meta_.kv_key[i] + tbo.size()] = std::strtod(meta_.kv_val[i], nullptr);
}
o.plugin_words = ranks_.empty() ? 0 : ranks_[0]->program.plugin_words;
o.model_id = !cfg_.served_model_name.empty() ? cfg_.served_model_name
: meta_.name && *meta_.name ? meta_.name : "radiance";
o.host = cfg_.host;
@@ -2946,10 +2986,23 @@ int Engine::run_server() {
int64_t queued() const override { return drv->queued(); }
int64_t running() const override { return drv->running(); }
} image_bridge;
if (!img_gen_ && (cfg_.image_gen_max_pixels > 0 || cfg_.image_gen_max_refs > 0))
RAD_WARN("--image-gen-max-pixels / --image-gen-max-refs: this model makes no images; "
"ignored");
if (img_gen_) {
const Program& pg = ranks_[0]->program;
const RadGeneratorDecl& gd = pg.generator;
server::ImageGenInfo& in = image_bridge.inf;
/* The bounds are the plugin's to apply: one that keeps fixed buffers is named. */
const int64_t px = gd.max_tokens * gd.latent_scale * gd.latent_scale;
if (cfg_.image_gen_max_pixels > 0 && px > cfg_.image_gen_max_pixels)
RAD_WARN("--image-gen-max-pixels %lld: '%s' sizes its buffers for %lld pixels and does "
"not take the bound", (long long)cfg_.image_gen_max_pixels,
pg.gen_str.name.c_str(), (long long)px);
if (cfg_.image_gen_max_refs > 0 && gd.max_refs > cfg_.image_gen_max_refs)
RAD_WARN("--image-gen-max-refs %lld: '%s' takes %lld reference pictures and does not "
"take the bound", (long long)cfg_.image_gen_max_refs, pg.gen_str.name.c_str(),
(long long)gd.max_refs);
in.name = pg.gen_str.name;
in.tmpl_text = pg.gen_str.tmpl_text;
in.tmpl_edit = pg.gen_str.tmpl_edit;