radiance 1.13.0

New models:
- Tencent Hy-Memory (HYV3) from its BF16, FP8 and GGUF checkpoints, with its native tool calls
- M2XFP4: metadata-augmented MXFP4 weights for Qwen3.8-27B and its DFlash2 drafter (top-1 89.1% ->
  92.4% against plain MXFP4), its quantiser and recipe, and ParoQuant's M2XFP4 checkpoints
- Gemma 4 E2B/E4B audio input; NVIDIA-Nemotron-3.5-Bolt-E4B in int8 and 4-bit, on two cards by
  default; Ornith-1.5-122B compose files

Speed:
- Weight reads beside the decode all-reduces (qwen35_fp8, gemma3; --weight-prefetch, on by default):
  the 27B MXFP4 with DFlash2 61.2 -> 67.9 tok/s at c1, TranslateGemma 27B +13%
- Head-256 split-KV decode attention at 256 workgroups and without bank conflicts (27B: +3-5% a
  step at 25-41K context), and the prefill KV split for small launches (a short turn over a long
  context decodes the other sequences 27% faster in that step)
- MXFP4 decode gate_up, activation and fp8 quantiser in one launch (27B, Gemma 3 up to 64 rows:
  TranslateGemma +2-5% at 2-8 streams)
- ParoQuant int4/int5 tiled GEMMs 6-9% faster
- Speculation: a step's tokens are sent before the drafter's passes end, no step waits behind one
  that ends its requests, and the MTP head's first draft no longer collapses after short chats in
  the prefix cache

Features:
- --kv-resident N: KV streaming for a context bigger than VRAM (qwen4exp_fp8, GLM-5.3)
- MiniMax-H3: reference media and keyframe conditioning with the VAE encoders
- Krea 2 rebalance presets balanced, detail and subtle
- The dashboard's request history; a stall watch that reports a frozen step's thread and stack
- rad-tune at the served configuration, collectives measured as the exchange; Gemma 4 E2B/E4B's
  per-layer embeddings read ahead off the step path
- A GPTQ calibration tap and recipe for Gemma 4 31B's w4a8 container

Fixes:
- The two-rank all-reduce checks that a peer's push has landed before reducing it
- z-lab's DFlash drafter on Gemma 4 31B keeps drafting after a prefix-cache hit
- MiniMax-H3's modulation rows

Changes: Plugin ABI 31: out-of-tree plugins must be rebuilt. RADIANCE_PREFETCH_BESIDE is
--weight-prefetch now; RADIANCE_NO_HUGE_PAGES, RADIANCE_IDS_EARLY, RADIANCE_ATTN_BAND_SPLIT,
R4D_PREFILL_SPLITS, RAD_PLE_TIMING and RAD_PLE_CACHE_ROWS are gone.
This commit is contained in:
Deadcode committed 2026-10-27 16:47:35 +01:00
198 files changed
+20904 -3240

No files matched your search

+57 -3
View File
@@ -20,6 +20,7 @@
* request by the other.
*/
#pragma once
#include "kvstream/mirror.h"
#include "mem/hostarena.h"
#include "mem/pools.h"
#include "rad_core.h"
@@ -54,6 +55,9 @@ struct BundleComparison {
};
BundleComparison compare_bundling(const std::vector<int64_t>& bundles);
/* A RAD_KV_* kind's name, for reports and refusals. */
const char* kv_kind_name(int kind);
/* ------------------------------------------------------------------ the runtime window */
/* A sequence's per-sequence window on a RAD_KV_WINDOW group, set at runtime (R-SWA, the
* "reference + ring" attention of Unlimited-OCR: a full causal prefill over the prompt and image
@@ -123,11 +127,25 @@ struct KVGroupPlan {
* snapshot would be read. */
bool win_snap = false;
int64_t n_blocks = 0; /* paged groups: blocks carved from the pool */
int64_t n_blocks = 0; /* paged groups: blocks the group addresses (its context) */
/* Paged groups: blocks the device pool backs, fewer than `n_blocks` when the group streams
* (docs/KV-STREAMING.md). Block ids stay dense over `n_blocks`: the allocator, refcounts, block
* table, prefix cache and every `id < n_blocks` guard count the context. Only addressing uses
* this: the pool and its layer stride are `n_slots` blocks deep, and the residency map turns a
* block into a slot. Equal to `n_blocks` otherwise. */
int64_t n_slots = 0;
/* Layer stripes the staged view presents: 0 means `n_layers` (the ring, and every group that
* does not stream), 1 means one stripe that every layer aliases. A depth rather than a
* rewritten `layer_slot`, which is also the host mirror's row (docs/KV-STREAMING.md §3.5.1). Set
* by carve() when the ring is smaller than the context. */
int64_t depth = 0;
/* rad_kv_group_zero: this rank keeps no cache for the group. The plan keeps its position and
* block count (one block table serves every rank); its costs are zero and nothing is carved.
* No op on this rank names it (issue refuses a group with no pool bound). */
bool zero = false;
/* rad_kv_group_dense_read: read over the whole history every step, so it cannot stream; while a
* sibling streams its carve is a floor of max_seqs full contexts (kvstream/carve.h). */
bool dense_read = false;
/* rad_kv_group_replicated: every rank holds the same bytes, so a tier slot carries this
* group once, in a window at its front that rank 0 writes and every rank reads
* (TierExec::slot_layout). The pool is carved as for any group. */
@@ -147,13 +165,19 @@ struct KVGroupPlan {
bool paged() const { return kind == RAD_KV_FULL || kind == RAD_KV_WINDOW; }
bool stateful() const { return kind == RAD_KV_LINEAR || kind == RAD_KV_CONV; }
/* Blocks of device pool this group owns: `n_slots`, which is `n_blocks` unless the group
* streams. Every carve and stride goes through here; every allocation and guard uses
* `n_blocks`. */
int64_t pool_blocks() const { return n_slots > 0 ? n_slots : n_blocks; }
/* The pool holds fewer blocks than the group addresses; a residency map says which. */
bool streamed() const { return paged() && n_slots > 0 && n_slots < n_blocks; }
/* The pool is layer-major, as the ABI requires: a RAD_OPK_KV operand carries the layer as its
* offset and resolves to `base + layer * layer_stride` (RadOperand in rad_runtime.h,
* KVPoolBinding in core/runtime/ctx.h), so a kernel gets one base pointer per layer and
* indexes it with the block table and slot mapping.
*
* Layer i owns [base + i*layer_stride, + layer_stride): n_blocks blocks of
* Layer i owns [base + i*layer_stride, + layer_stride): pool_blocks() blocks of
* `bytes_per_block / n_layers` for a paged group, n_states states of
* `bytes_per_state / n_layers` for a stateful one. */
int64_t layer_bytes_per_block() const {
@@ -163,7 +187,8 @@ struct KVGroupPlan {
return n_layers > 0 ? bytes_per_state / n_layers : bytes_per_state;
}
int64_t layer_stride() const {
return paged() ? n_blocks * layer_bytes_per_block() : n_states * layer_bytes_per_state();
return paged() ? pool_blocks() * layer_bytes_per_block()
: n_states * layer_bytes_per_state();
}
};
@@ -224,6 +249,28 @@ public:
* because paged_split is monotone in the budget. */
int64_t pool_mib_for_tokens(int64_t tokens, int64_t max_mib) const;
void cap_paged_tokens(int64_t tokens) { tokens_cap_ = tokens > 0 ? tokens : 0; }
/* ---- KV streaming: KVStreamStore's state and lifecycle under the manager's names, so callers
* need not include kvstream/mirror.h, which documents each. */
using StreamMap = RadKVStream; /* the ABI's view: the mirror and the ring's maps */
using StreamCost = KVStreamCost;
using StreamStats = KVStreamStats;
void cap_resident_tokens(int32_t group, int64_t tokens) { stream_.cap(group, tokens); }
void set_stream_map(int32_t group, const StreamMap& m) { stream_.set_map(group, m); }
const StreamMap* stream_map(int32_t group) const { return stream_.map(group); }
const RadKVStream* stream_view(int32_t group) const {
return stream_.view(plan(group), group);
}
StreamCost stream_cost() const { return stream_.cost(plans_, max_ctx_, max_seqs_); }
int alloc_stream(MemAllocator& host_alloc, Pool& kv_pool) {
return stream_.alloc(plans_, max_ctx_, max_seqs_, host_alloc, kv_pool);
}
int init_stream(RadStream s) { return stream_.init(plans_, s); }
void free_stream(MemAllocator& host_alloc) { stream_.release(host_alloc); }
StreamStats stream_stats() const { return stream_.stats(plans_); }
void note_stream_traffic(int64_t misses, int64_t bytes) {
stream_.note_traffic(misses, bytes);
}
int carve(Pool& kv_pool);
const std::vector<KVGroupPlan>& plans() const { return plans_; }
@@ -368,6 +415,10 @@ public:
/* The carve: the range every block id is addressed against. live_blocks() is what the cache
* keeps unlent. */
int64_t total_blocks(int32_t group) const;
/* One past the highest held block, rounded up to a `held_hist_` bucket (0 when nothing is held):
* an upper bound on every id a block table can name, which a streamed group's stage copies up
* to (kvstream/stage.h). It counts blocks the prefix cache and other sequences hold too. */
int64_t held_top_blocks(int32_t group) const;
int64_t free_states(int32_t group) const;
/* Pool size in bytes, the only unit in which groups can be summed: paged and stateful groups
@@ -622,6 +673,9 @@ private:
int64_t fixed_ = 0; /* the non-negotiable floor: states, conv slots, padding */
int64_t ckpts_ = 0; /* --checkpoint-slots, kept for the warning on a model with none */
int64_t tokens_cap_ = 0; /* cap_paged_tokens(): the least any rank can carve; 0 is none */
/* KV streaming's state by group handle (kvstream/mirror.h); empty when nothing streams. */
KVStreamStore stream_;
/* declare_runtime_window(): group -> W. Survives forget(), which plan_groups() calls at its
* start: it is a declaration about the program, not about a plan. */
std::unordered_map<int32_t, int64_t> runtime_decl_;