radiance 1.12.0

New models:
- Fish Audio drama-3: speech with speaker tags and inline direction, voices cloned from reference
  clips (the `references` field of /v1/audio/speech and the streaming session), two cards
- Gemma 4 E2B/E4B (KV-shared layers, per-layer embeddings, clipped vision linears), with
  NVIDIA-Nemotron-3.5-Bolt-E4B in bf16 with DFlash and vision on one card, and E4B recipes

Speed:
- MXFP4 GEMMs for one to 64 rows and a tiled prefill GEMM at TN=4 from 1024 rows: the 27B MXFP4
  with DFlash2 decodes about 1% faster at c1, 5% at c4 and 14% at c16
- The fp8 and int8 LM heads read their weight once for 65 to 128 rows
- A prefill step of one sequence runs in two pieces on a second lane at two ranks (qwen35_fp8,
  gemma3): a 45K-token prompt on the 27B fp8 in 15.1 s instead of 16.2 s
- Gemma 3's fused all-reduce junctions also under a lossy wire
- --draft-short-from N: a block drafter runs its shorter block from N decoding sequences on
  (off by default; with 8 on the 27B MXFP4: c8 +12%, c16 +18%, c64 +32%, c1 unchanged)
- --tp-attn-split rows: GLM-5.3-Flash's MLA attention split by rows over the ranks, 18 to 21%
  faster prefill; lossy, `heads` stays the default
- --draft-coupling on: Qwen3.8-Flash-Next's MTP drafter samples its proposals from its reranked
  top-8 and the target's draw is coupled to it; pays at high temperatures (c1 at T 1.0: 155 ->
  178 tok/s), costs at low ones; off by default

Features:
- Edited prompts on windowed models (Gemma 4) reuse their prefix: periodic window snapshots, and
  snapshot-backed prefix KV kept across recomputes (an edited tail on Gemma 4 31B: 96 s -> 2.6 s)
- DELETE /sessions/<label> and DELETE /sessions?id=<id> forget one stored conversation
- --state-cache-dtype f16: the delta-net state cache at half the memory (qwen35 plugins; lossy)

Fixes:
- A browser's CORS preflight allows DELETE

Changes: Plugin ABI 27: out-of-tree plugins must be rebuilt. The environment switches the PRs
added are flags now (--tp-attn-split, --draft-coupling, --state-cache-dtype).
This commit is contained in:
137 files changed
+12959 -1126

No files matched your search

+28 -5
View File
@@ -46,6 +46,10 @@ struct Layer {
struct Model {
Names nm{};
Geom g{};
/* The MLA's split of a prefill-sized step under TP (RadBuildCtx::tp_attn_rows). The head
* form declares none of the row form's full-width weights (1.29 GiB a card at eight ranks);
* the row form is opt-in because it is not bit-identical to it (docs/ARCHITECTURES.md). */
GlmMla::Form form = GlmMla::Form::heads;
std::vector<Layer> layers;
rad_kvgroup latent = 0, index = 0, tail = 0, state = 0, conv = 0;
/* The streams and the step's stream-wide buffers. */
@@ -102,7 +106,11 @@ static int stream_buffers(RadBuilder* b, Model& m) {
m.h0 = decl_b(b, nm.f("manifold"), RAD_BF16, { T, 16384 });
m.h1 = decl_b(b, nm.f("manifold_mid"), RAD_BF16, { T, 16384 });
m.x = decl_b(b, nm.f("collapsed"), RAD_BF16, { T, 4096 });
m.y = decl_b(b, nm.f("attn_delta"), RAD_BF16, { T, 4096 });
/* The MLA row form gathers every rank's run at full length, so its output is rounded up to
* whole runs; the head form keeps the step's rows. */
const bool rows = g.world > 1 && m.form == GlmMla::Form::rows;
m.y = decl_b(b, nm.f("attn_delta"), RAD_BF16,
{ rows ? g.world * GlmMla::rows_for(T, g.world) : T, 4096 });
m.post = decl_b(b, nm.f("post"), RAD_F32, { T, 4 });
m.comb = decl_b(b, nm.f("mix"), RAD_F32, { T, 16 });
m.act.x = decl_b(b, nm.f("normalized"), RAD_BF16, { T, 4096 });
@@ -132,9 +140,9 @@ static int kda_buffers(RadBuilder* b, Model& m) {
kw.core.out = bf("recurrent_out", W);
return RAD_OK;
}
/* The head form's buffers, then the selection planes the indexer writes and the MLA reads. Under
* TP the selection planes hold every rank's run of rows, which can reach past the step
* (DsaCache::part_rows). */
/* The head form's buffers, then the selection planes the indexer writes and the MLA reads, then
* the row form's (Model::form). Under TP the selection planes hold every rank's run of rows,
* which can reach past the step (DsaCache::part_rows). */
static int mla_buffers(RadBuilder* b, Model& m) {
auto& g = m.g;
auto& nm = m.nm;
@@ -160,6 +168,16 @@ static int mla_buffers(RadBuilder* b, Model& m) {
const int64_t TQ = g.world > 1 ? std::max(T, g.world * part) : T;
aw.core.selected = decl_b(b, nm.f("selected"), RAD_I32, { TQ, 513 });
aw.core.length = decl_b(b, nm.f("length"), RAD_I32, { TQ });
if (g.world > 1 && m.form == GlmMla::Form::rows) {
auto& rows = aw.rows;
const int64_t R = GlmMla::rows_for(T, g.world);
rows.q = decl_b(b, nm.f("rows_query"), RAD_BF16, { R, 16384 });
rows.q_latent = decl_b(b, nm.f("rows_q_latent"), RAD_BF16, { R, 64, 512 });
rows.attn_latent = decl_b(b, nm.f("rows_attn_latent"), RAD_BF16, { R, 64, 512 });
rows.attn.x = decl_b(b, nm.f("rows_expanded"), RAD_BF16, { R, 16384 });
RAD_ARCH_TRY(rows.attn.declare_qs(b, nm, g, "rows_expanded", 16384, R));
rows.out = decl_b(b, nm.f("rows_out"), RAD_BF16, { R, 4096 });
}
return RAD_OK;
}
static int indexer_buffers(RadBuilder* b, Model& m) {
@@ -292,7 +310,10 @@ static int layer(RadBuilder* b, Model& m, Layer& lay, Names& nm, int l, bool dra
decl_w(b, nn, RAD_F32, { 4096 }, RAD_ACCESS_PER_TOKEN, RAD_SHARD_NONE, grp_layer(l));
RAD_ARCH_TRY(lay.norm.declare(b, g, gain, input, m.act, 4096));
if (lay.full) {
RAD_ARCH_TRY(lay.mla.declare(b, nm, g, l, m.aw, ap, m.latent, true, true));
// The MTP layer keeps the head form: its row form would cost another 126 MB a card.
auto aw = m.aw;
if (draft) aw.rows = {};
RAD_ARCH_TRY(lay.mla.declare(b, nm, g, l, aw, ap, m.latent, true, true));
DsaCache::Config c;
c.blocks = (g.max_ctx + 3) / 4 + 1;
c.work = (g.max_tok + 3) / 4 + g.max_seqs;
@@ -429,6 +450,7 @@ static int declare(RadBuilder* b, const RadModelMeta* meta, const RadBuildCtx* c
auto& g = m.g;
m.nm = Names(ctx->scope);
auto& nm = m.nm;
m.form = ctx->tp_attn_rows ? GlmMla::Form::rows : GlmMla::Form::heads;
RAD_ARCH_TRY(geometry(g, meta, ctx, world));
RAD_ARCH_TRY(stream_buffers(b, m));
RAD_ARCH_TRY(kda_buffers(b, m));
@@ -578,6 +600,7 @@ static int probe(const RadModelMeta* meta, RadArchProbe* out) {
if (k > 0) out->enc_merge = k * k;
}
out->shape_probe_ok = 1;
out->tp_attn_rows_ok = 1;
return RAD_OK;
}
} // namespace glm5next