radiance 1.1.0

- The VRAM split has no ratio: --expert-vs-cache-ratio is gone (now an unknown option). The
  experts keep what the pinned host pool cannot hold, the KV cache takes the rest and lends idle
  blocks to the experts. Flash-Next at tp2: 7.9 GiB of KV a card, up from 4.7. Startup, /stats,
  /metrics and the dashboard report the most the cache can hold.
- Linear-state snapshots live in pinned host memory, not VRAM (--checkpoint-slots sizes the
  store). Prefix-cache misses on agent sessions fixed; a published conversation is no longer
  trimmed away.
- Any world size from the shipped container (baKon): --tp 3 on Flash-Next with no padded
  checkpoint -- the attention world, uneven delta-net heads, the fill op.
- Kernels (keptn42): moe_gemm_q decode loads and one-trip run search, hc_read's prefill form
  (+3.7% prefill at 18K), hc_up row groups up to eight, the fused router launch. Each is the rule
  where it was measured faster; no environment switches.
- Tool calls: a typed argument is always JSON (Python True/None no longer leak into arguments --
  Codeberg #21); nine further reply-parser fixes; the reply path inside a call is ~12x cheaper on
  the host.
- The kernel changes: prefill +2-3% and decode -2% a step on 2x R9700 at tp2, identical text.
This commit is contained in:
Deadcode committed 2026-10-06 14:04:49 +02:00
1 parent 9f5feb24ee
commit 82b5835c02
101 files changed
+5105 -3767

No files matched your search

+19
View File
@@ -307,6 +307,25 @@ int ref_silu(const RadArgs* a, RadStream) { return unary(a, 1); }
* it that expert runs ungated, which is a different model and not a slower one. */
int ref_sigmoid(const RadArgs* a, RadStream) { return unary(a, 2); }
/* ------------------------------------------------------------------ fill */
/* y = value over [M, n], at y's own row pitch. The value is rounded once, by the store. */
int ref_fill(const RadArgs* a, RadStream) {
if (!have(a, 1)) return RAD_E_INVAL;
const RadTensor* y = &a->t[0];
const int64_t n = p_int(a, "n", numel(y));
if (n <= 0) return RAD_E_SHAPE;
const int64_t rows = rows_of(y, n);
if (rows <= 0) return RAD_E_SHAPE;
const float v = p_f32(a, "value", 0.0f);
#pragma omp parallel for schedule(static)
for (int64_t r = 0; r < rows; ++r) {
const int64_t yb = rowoff(y, r, n), ys = laststride(y);
for (int64_t i = 0; i < n; ++i) stt(y, yb + i * ys, v);
}
return RAD_OK;
}
/* ------------------------------------------------------------------ gather_rows */
/* y[i, :] = x[idx[i], :]. The op that turns "correct" into "affordable": without it a plugin runs
* the lm_head GEMM over every token of a prefill chunk when the sampler wants one row per
+2
View File
@@ -76,6 +76,7 @@ int ref_silu_mul (const RadArgs*, RadStream);
int ref_gelu (const RadArgs*, RadStream);
int ref_silu (const RadArgs*, RadStream);
int ref_sigmoid (const RadArgs*, RadStream);
int ref_fill (const RadArgs*, RadStream);
int ref_gather_rows (const RadArgs*, RadStream);
int ref_scatter_rows (const RadArgs*, RadStream);
int ref_ngram_ids (const RadArgs*, RadStream);
@@ -192,6 +193,7 @@ REF_SHAPE_FN(ref_silu_mul);
REF_SHAPE_FN(ref_gelu);
REF_SHAPE_FN(ref_silu);
REF_SHAPE_FN(ref_sigmoid);
REF_SHAPE_FN(ref_fill);
REF_SHAPE_FN(ref_gather_rows);
REF_SHAPE_FN(ref_scatter_rows);
REF_SHAPE_FN(ref_ngram_ids);
+8
View File
@@ -144,6 +144,9 @@ static const RadParamSpec pMnD[] = { P_INT("M"), P_INT("n"), P_STR("dtype") };
static const RadOperandSpec oBinary[] = { OPD("a"), OPD("b"), OUT("y") };
static const RadOperandSpec oGateUp[] = { OPD("gate_up"), OUT("y") };
static const RadOperandSpec oUnary[] = { OPD("x"), OUT("y") };
/* `fill` has no input: `value` is the whole of what it writes. */
static const RadParamSpec pFill[] = { P_INT("M"), P_INT("n"), P_STR("dtype"), P_F64O("value") };
static const RadOperandSpec oFill[] = { OUT("y") };
static const RadOperandSpec oGather[] = { OPD("x"), OPD("idx"), OUT("y") };
static const RadOperandSpec oScatterRows[] = { OPD("v"), OPD("idx"), INOUT("x") };
@@ -594,6 +597,10 @@ static const RadOpSchema kSchemas[] = {
"y = 0.5x(1 + erf(x/sqrt(2))). The exact erf form, not the tanh approximation." },
{ "silu", ARR(pMnD), ARR(oUnary), "y = x * sigmoid(x)." },
{ "sigmoid", ARR(pMnD), ARR(oUnary), "y = 1 / (1 + exp(-x))." },
{ "fill", ARR(pFill), ARR(oFill),
"y = value, every element of an [M, n] extent (default 0), rounded once to y's dtype. The op a "
"rank issues where it computes nothing and a reader downstream -- an all-reduce, a residual -- "
"still expects a defined buffer." },
{ "ple_gate", ARR(pPleGate), ARR(oPleGate),
"Per-Layer Embedding's gate. K = grouped_rmsnorm(k) * (w_key + wadd) and Q likewise over `q`, "
"one rsqrt per `n`-wide stream and one gain across all hc*n; s[c] = sum_d K[c][d]*Q[c][d] / "
@@ -981,6 +988,7 @@ SIMPLE("ref_silu_mul", "silu_mul", "elem", "silu-gated product over a fused gate
SIMPLE("ref_gelu", "gelu", "elem", "exact erf gelu", DT_FLOAT, ref_gelu),
SIMPLE("ref_silu", "silu", "elem", "silu", DT_FLOAT, ref_silu),
SIMPLE("ref_sigmoid", "sigmoid", "elem", "logistic sigmoid", DT_FLOAT, ref_sigmoid),
SIMPLE("ref_fill", "fill", "elem", "constant fill", DT_FLOAT, ref_fill),
SIMPLE("ref_ngram_ids", "ngram_ids", "vocab", "hashed n-gram row ids for PLE", DT_ANY,
ref_ngram_ids),
SIMPLE("ref_ple_gate", "ple_gate", "norm", "PLE gate: three grouped norms, a dot, a signed sqrt",
+8
View File
@@ -495,6 +495,14 @@ int ref_silu_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out) {
int ref_sigmoid_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out) {
return unary_shape(p, n_p, operand, "sigmoid", out);
}
int ref_fill_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);
Opd o;
o.t(D, { M, n }); /* y */
return o.finish("fill", operand, out);
}
int ref_softmax_shape(const RadParam* p, int n_p, int operand, RadOpdDesc* out) {
return unary_shape(p, n_p, operand, "softmax", out);
}