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

+122 -25
View File
@@ -559,6 +559,16 @@ int ref_pool_rows_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out
return o.finish("pool_rows", operand, out);
}
int ref_pool_cols_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out) {
const uint32_t D = act_dt(p, n_p);
const int64_t n = gi(p, n_p, "n", 0), k = gi(p, n_p, "k", 0), M = gi(p, n_p, "M", 0);
if (M <= 0 || n <= 0 || k <= 0 || n % k) return RAD_E_UNSUPPORTED;
Opd o;
o.t(D, { M, n }); /* x */
o.t(D, { M, n / k }); /* y */
return o.finish("pool_cols", operand, out);
}
int ref_relu_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out) {
const uint32_t D = act_dt(p, n_p);
const int64_t M = gi(p, n_p, "M", 0), n = gi(p, n_p, "n", 0);
@@ -1455,16 +1465,11 @@ int ref_kv_store_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out)
return o.finish("kv_store", operand, out);
}
/* The streamed store. Same geometry as `kv_store`, with the mirror and the residency map beside
* the ring: the mirror is one block a row of the same byte pitch.
*
* The described call touches ONE block, resident in ring slot 0. The draw vocabulary cannot express
* an injective residency map (block -> slot is a permutation, and a draw is a free choice per
* entry), and two blocks drawing one slot would make two tokens write the same ring byte -- a race
* the parallel rerun rightly reports. So the generated case exercises the conversion, the positions
* within a block, the mirror write and the resident ring write; a partly resident map and the
* mirror-only step are built by hand in tests/ref_test.cpp and libavx's hand cases. `M <= block_size`
* keeps every token on its own position of that one block. */
/* The streamed store: kv_store's geometry plus the mirror (one block a row at the ring's pitch)
* and the residency map. The described call touches one block, resident in slot 0: the draw
* cannot express an injective map, and two blocks drawing one slot would race on a ring byte.
* Partly resident maps and mirror-only writes are built by hand in tests/ref_test.cpp and in
* libavx's hand cases. `M <= block_size` keeps every token on its own position of that block. */
int ref_kv_store_streamed_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out) {
const int64_t M = gi(p, n_p, "M", 0);
const int64_t hd = gi(p, n_p, "head_dim", 0);
@@ -1674,15 +1679,10 @@ int ref_qsa_work_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out)
return o.finish("qsa_work", operand, out);
}
/* The residency map and the two byte planes. `sel` is described as block ids, which is what
* `qsa_select` leaves there; past `nsel` it is -1 padding the op does not touch.
*
* A described residency map can only be an all-resident one: the description vocabulary draws an
* index in [0, idx_max) or a non-negative constant, and a cold entry is -1 (`res[b] == -1`, an
* absent block), which no draw expresses. So a tool that calls this op cold sees every block
* resident, which exercises the epoch, the rewrite and the bookkeeping but never a miss, an
* eviction or a copy. The service-shaped cases (a partly resident pool, a second chance, an
* eviction, an overflow) are built by hand in tests/ref_test.cpp and in libavx's hand cases. */
/* The residency map and the two byte planes. `sel` is block ids, -1 past `nsel`. A described map
* can only be all-resident (no draw expresses -1), so a tool's cold call exercises the epoch, the
* rewrite and the bookkeeping, never a miss, eviction or copy; those cases are built by hand in
* tests/ref_test.cpp and in libavx's hand cases. */
int ref_kv_resolve_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out) {
const int64_t M = gi(p, n_p, "M", 0), blocks = gi(p, n_p, "blocks", 0);
const int64_t slots = gi(p, n_p, "slots", 0), pitch = gi(p, n_p, "sel_pitch", 0);
@@ -2643,6 +2643,7 @@ int ref_rms_mod_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out)
o.t_idx({ 2 }, 0, -1, (uint32_t)RAD_OPD_F_IDX_CU); /* cu_seqlens */
o.t(D, { M, n }); /* x, INOUT */
o.t(D, { M, n }); /* z */
o.skip(); /* colmap: the sweep passes none */
return o.finish("rms_mod", operand, out);
}
int ref_rms_mod_quant_fp8_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out) {
@@ -2666,6 +2667,7 @@ int ref_rms_mod_quant_fp8_shape(const RadParam* p, int n_p, int operand, RadOpdD
o.t((uint32_t)RAD_F8E4M3, { M, n }); /* q */
o.t((uint32_t)RAD_F32, { M, ng }); /* scale */
o.t(D, { M, n }); /* z */
o.skip(); /* colmap: the sweep passes none */
return o.finish("rms_mod_quant_fp8", operand, out);
}
/* The sampler's three scalars in (0, 1), the state f32. */
@@ -2680,6 +2682,20 @@ int ref_flow_x0_step_shape(const RadParam* p, int n_p, int operand, RadOpdDesc*
o.t(F, { M, n }); /* x, INOUT */
return o.finish("flow_x0_step", operand, out);
}
int ref_flow_res_multistep_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out) {
const int64_t M = gi(p, n_p, "M", 0), n = gi(p, n_p, "n", 0);
const uint32_t F = (uint32_t)RAD_F32;
Opd o;
o.t(act_dt(p, n_p), { M, n }); /* v */
o.t(F, { M, n }); /* x0, INOUT */
o.t_fill(F, { 1 }, (uint32_t)RAD_FILL_SIGMOID, 0); /* sigma */
o.t_fill(F, { 1 }, (uint32_t)RAD_FILL_SIGMOID, 0); /* r */
o.t_fill(F, { 1 }, (uint32_t)RAD_FILL_SIGMOID, 0); /* hb1 */
o.t_fill(F, { 1 }, (uint32_t)RAD_FILL_SIGMOID, 0); /* hb2 */
o.t_fill(F, { 1 }, (uint32_t)RAD_FILL_SIGMOID, 0); /* order */
o.t(F, { M, n }); /* x, INOUT */
return o.finish("flow_res_multistep", operand, out);
}
int ref_gate_add_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out) {
const int64_t M = gi(p, n_p, "M", 0), n = gi(p, n_p, "n", 0);
const uint32_t D = act_dt(p, n_p);
@@ -2691,10 +2707,11 @@ int ref_gate_add_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out)
return o.finish("gate_add", operand, out);
}
int ref_timestep_embed_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out) {
const int64_t M = gi(p, n_p, "M", 0), n = gi(p, n_p, "n", 0);
const int64_t M = gi(p, n_p, "M", 0), n = gi(p, n_p, "n", 0), G = gi(p, n_p, "curve", 0);
Opd o;
o.t_fill((uint32_t)RAD_F32, { M }, (uint32_t)RAD_FILL_SIGMOID, 0); /* t: a sigma in (0, 1) */
o.t(act_dt(p, n_p), { M, n }); /* y */
if (G > 0) o.t((uint32_t)RAD_F32, { G, n }); else o.skip(); /* table */
return o.finish("timestep_embed", operand, out);
}
int ref_gather_rows2_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out) {
@@ -3022,6 +3039,22 @@ static int64_t tile_count(int64_t len, int64_t tile, int64_t overlap) {
return nt;
}
/* The encoder's split (ref_video.cpp split_tiles_axis) over one axis: the tile count and the
* tiles' extent sum along it, a lone tile short of `tile` if the axis is. -1 where the split
* refuses. The drawn encode planes are `axis_len` long, so the shape fns can size the tile
* operands exactly. */
static int64_t axis_split(int64_t len, int64_t tile, int64_t overlap, int64_t* ext) {
if (len <= 0 || tile <= 0 || overlap < 0 || overlap >= tile) return -1;
if (tile >= len) {
*ext = len;
return 1;
}
const int64_t nt = tile_count(len, tile, overlap);
/* The extents telescope: sum of the tiles = len + sum of the overlaps = `tile` nt. */
*ext = tile * nt;
return nt;
}
/* A 2 x 2 x 2 grid of patches. */
int ref_patch_unfold_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out) {
const int64_t M = gi(p, n_p, "M", 0), C = gi(p, n_p, "C", 0);
@@ -3174,6 +3207,61 @@ int ref_flow_renoise_shape(const RadParam* p, int n_p, int operand, RadOpdDesc*
return o.finish("flow_renoise", operand, out);
}
/* aug in [0, 1); the condition rows f32. */
int ref_cond_aug_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out) {
const int64_t M = gi(p, n_p, "M", 0), n = gi(p, n_p, "n", 0);
const double aug = rad_param_getf(p, n_p, "aug", -1.0);
if (M <= 0 || n <= 0 || !(aug >= 0.0 && aug < 1.0)) return RAD_E_UNSUPPORTED;
Opd o;
o.t_idx({ 2 }, (int64_t)1 << 30, -1, 0); /* seed: two words */
o.t((uint32_t)RAD_F32, { M, n }); /* x, INOUT */
return o.finish("cond_aug", operand, out);
}
/* ---- the tiled encoder. The drawn frame is 20 latent units a side; with the sweep's tile of
* 16 and overlap of 4 the split lays 2 x 2 full tiles over it, so the crops, the plan's level
* triples and the blends all draw non-trivial. The kernels size by the geom; these only draw a
* plane that one gives them. */
int ref_vtile_plan_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out) {
const int64_t M = gi(p, n_p, "M", 0), tile = gi(p, n_p, "tile", 0);
const int64_t ov = gi(p, n_p, "overlap", 0), ratio = gi(p, n_p, "ratio", 0);
int64_t e = 0;
const int64_t nt = axis_split(20, tile, ov, &e);
if (M <= 0 || nt < 0 || ratio <= 0) return RAD_E_UNSUPPORTED;
Opd o;
o.t_idx({ 3 }, 0, 20 * ratio, 0); /* geom: (_, H, W) pixels */
o.t((uint32_t)RAD_I32, { M, 22 }); /* y: one row a tile */
return o.finish("vtile_plan", operand, out);
}
int ref_vtile_crop_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out) {
const int64_t M = gi(p, n_p, "M", 0), tile = gi(p, n_p, "tile", 0);
const int64_t ov = gi(p, n_p, "overlap", 0), ratio = gi(p, n_p, "ratio", 0);
int64_t e = 0;
const int64_t nt = axis_split(20, tile, ov, &e);
if (M <= 0 || nt < 0 || ratio <= 0) return RAD_E_UNSUPPORTED;
const uint32_t D = act_dt(p, n_p);
Opd o;
o.t(D, { 20 * ratio * (20 * ratio), 3 }); /* x: the pixel plane */
o.t_idx({ 3 }, 0, 20 * ratio, 0); /* geom: (_, H, W) pixels */
o.t(D, { M, 3 }); /* y: the tiles' pixels */
return o.finish("vtile_crop", operand, out);
}
int ref_vtile_join_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out) {
const int64_t M = gi(p, n_p, "M", 0), tile = gi(p, n_p, "tile", 0);
const int64_t ov = gi(p, n_p, "overlap", 0), n = gi(p, n_p, "n", 0);
int64_t e = 0;
const int64_t nt = axis_split(20, tile, ov, &e);
if (M <= 0 || nt < 0 || n <= 0) return RAD_E_UNSUPPORTED;
const uint32_t D = act_dt(p, n_p);
Opd o;
o.t(D, { e * e, n }); /* x: the tiles' moments */
o.t_idx({ 3 }, 0, 20, 0); /* geom: (_, lat_h, lat_w) */
o.t(D, { M, n }); /* y: the canvas */
return o.finish("vtile_join", operand, out);
}
/* ================================================================== video sparse attention
*
* The tiles come from the values of `segs` and `geom`, which a description draws only as
@@ -3280,23 +3368,32 @@ int ref_attn_vsa_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out)
* REF_LANES lanes, as the image generator's are. */
static int64_t two_seqs(int64_t M) { return M >= 4 ? 2 : 1; }
/* `M` is the input rows; with `stride` > 1 (bf16, one sequence, explicit `pad`) the output is
* PyTorch's strided length, `M` being the rows of the one sequence `cu_seqlens` must cover. */
int ref_conv1d_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out) {
const int64_t M = gi(p, n_p, "M", 0), cin = gi(p, n_p, "cin", 0), cout = gi(p, n_p, "cout", 0);
const int64_t k = gi(p, n_p, "k", 0), causal = gi(p, n_p, "causal", 0);
const int64_t st = gi(p, n_p, "stride", 1), dil = gi(p, n_p, "dil", 1);
if (M <= 0 || cin <= 0 || cout <= 0 || k <= 0 || (!causal && (k & 1) == 0) || st < 1 ||
(st > 1 && (!causal || dil * (k - 1) + 1 < st || M % st)) || gi(p, n_p, "cu_div", 1) != 1)
const int64_t st = gi(p, n_p, "stride", 1), pp = gi(p, n_p, "pad", -1);
const int64_t dil = gi(p, n_p, "dil", 1);
const bool padded = pp >= 0 && st > 1; /* the zero-padded strided form (explicit `pad`) */
if (M <= 0 || cin <= 0 || cout <= 0 || k <= 0 || (!causal && st <= 1 && (k & 1) == 0) ||
st < 1 || (pp >= 0 && (st <= 1 || causal)) ||
(st > 1 && pp < 0 && (!causal || dil * (k - 1) + 1 < st || M % st)) ||
(!padded && gi(p, n_p, "cu_div", 1) != 1))
return RAD_E_UNSUPPORTED;
const uint32_t D = act_dt(p, n_p);
if (padded && D != (uint32_t)RAD_BF16) return RAD_E_UNSUPPORTED;
/* A strided convolution is described over one sequence: two would each need a whole number
* of strides. Bounds in coarser units (cu_div) are not drawn; ref_test checks them. */
const int64_t S = st > 1 ? 1 : two_seqs(M);
const int64_t O = padded ? (M + 2 * pp - dil * (k - 1) - 1) / st + 1 : M / st;
if (O <= 0) return RAD_E_UNSUPPORTED;
Opd o;
o.t(D, { M, cin }); /* x */
o.t(D, { cout, cin, k }); /* w */
o.t_idx({ S + 1 }, 0, -1, (uint32_t)RAD_OPD_F_IDX_CU); /* cu_seqlens */
o.t(D, { M / st, cout }); /* res */
o.t(D, { M / st, cout }); /* y */
o.t(D, { O, cout }); /* res */
o.t(D, { O, cout }); /* y */
o.t(D, { cout }); /* b */
return o.finish("conv1d", operand, out);
}