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

+74 -13
View File
@@ -900,12 +900,9 @@ TEST(libr4d_resolves_the_all_reduce_by_message_size) {
"8192:ar_oneshot_3rank_exact 524288:ar_oneshot_3rank_exact "
"41943040:ar_twoshot_3rank_exact ");
/* At `overlap` 1 (a pipelined prefill's all-reduce beside compute) the two-shot band takes the
* lane row at three, four and eight ranks, exact and, where it exists, lossy (at three and
* eight launched as the wide rows unless R4D_AR_LANE_3_8=1); the
* one-shot band has no lane row past two ranks. The lists split at the eight-rank one-shot edge
* as above; at eight ranks the band between it and the wide one-shot bound stays on the plain
* two-shot. */
/* At `overlap` 1 (an all-reduce beside compute) the four-rank two-shot band takes the lane
* rows, exact and lossy; the one-shot band has no lane row past two ranks. Three and eight ranks
* have no lane row and keep the plain two-shot. */
auto lane = [&](int world, int exact) {
Geometry g;
g.set_i("world_size", world);
@@ -915,16 +912,14 @@ TEST(libr4d_resolves_the_all_reduce_by_message_size) {
g.set_i("overlap", 1);
return r.build_bands("all_reduce", "numel", width, chunk * width, g);
};
CHECK_EQ(band_names(lane(3, 1)), "8192:ar_oneshot_3rank_exact 524288:ar_oneshot_3rank_exact "
"5242880:ar_twoshot_3rank_exact_lane ");
CHECK_EQ(band_names(lane(4, 1)), "8192:ar_oneshot_4rank_exact 524288:ar_oneshot_4rank_exact "
"5242880:ar_twoshot_4rank_exact_lane ");
CHECK_EQ(band_names(lane(8, 1)), "8192:ar_oneshot_8rank_exact 524288:ar_twoshot_8rank_exact "
"5242880:ar_twoshot_8rank_exact_lane ");
CHECK_EQ(band_names(lane(3, 0)), "8192:ar_twoshot_3rank_ti8_lane 524288:ar_twoshot_3rank_ti8_lane "
"5242880:ar_twoshot_3rank_ti8_lane ");
CHECK_EQ(band_names(lane(4, 0)), "8192:ar_twoshot_4rank_ti8_lane 524288:ar_twoshot_4rank_ti8_lane "
"5242880:ar_twoshot_4rank_ti8_lane ");
CHECK_EQ(band_names(lane(3, 1)), "8192:ar_oneshot_3rank_exact 524288:ar_oneshot_3rank_exact "
"5242880:ar_twoshot_3rank_exact ");
CHECK_EQ(band_names(lane(8, 1)), "8192:ar_oneshot_8rank_exact 524288:ar_twoshot_8rank_exact "
"5242880:ar_twoshot_8rank_exact ");
/* Above the two-shot's bound the one-shot takes the message back. */
CHECK_EQ(band_names(bands(4, 1, 131072)),
@@ -1049,7 +1044,8 @@ TEST(libr4d_resolves_the_vision_attention_without_a_window) {
}
/* GLM-5.3-Flash's MLA at eight heads a rank: the matrix row ranks above the wave row and serves
* every M up to its bound, a decode step's rows and a prefill chunk alike. */
* every M up to its bound, a decode step's rows and a prefill chunk alike. At 64 heads the rows
* row ranks above both. */
TEST(libr4d_resolves_the_mla_attention_by_rows) {
const std::string so = libr4d();
if (so.empty()) return;
@@ -1063,6 +1059,71 @@ TEST(libr4d_resolves_the_mla_attention_by_rows) {
g.set_s("dtype", "bf16");
CHECK_EQ(band_names(r.build_bands("mla_attn", "M", 1, 2048, g)), "2048:mla_attn_matrix_bf16 ");
CHECK_EQ(band_names(r.build_bands("mla_attn", "M", 1, 48, g)), "48:mla_attn_matrix_bf16 ");
// All 64 heads of a row, as GLM's prefill split by rows runs it: the rows row.
g.set_i("heads", 64);
CHECK_EQ(band_names(r.build_bands("mla_attn", "M", 1, 512, g)), "512:mla_attn_rows_bf16 ");
g.set_i("heads", 16);
CHECK_EQ(band_names(r.build_bands("mla_attn", "M", 1, 512, g)), "512:mla_attn_matrix_bf16 ");
}
/* GLM-5.3-Flash's MLA split by rows at eight ranks (arch/common/rad_block_glm_mla.h), with the
* parameters its ops declare against the container's encodings (block fp8 at f32 scales): every
* band of every op the row form adds resolves on the device, up to a 4096-token step's run of
* 512 rows. A form libr4d does not serve would stop a TP8 start at "resolved to no kernel". */
TEST(libr4d_resolves_every_band_of_glm_mla_split_by_rows) {
const std::string so = libr4d();
if (so.empty()) return;
Registry r;
CHECK(r.load_plugin(so, 0) >= 0);
r.set_device_fact(RAD_FACT_P2P, 1);
auto all_resolve = [&](const char* op, const char* ranged, int64_t lo, int64_t hi,
const Geometry& g) {
const std::vector<Band> bands = r.build_bands(op, ranged, lo, hi, g);
bool ok = !bands.empty();
for (const Band& x : bands) ok = ok && x.dom[RAD_DOMAIN_DEVICE].row;
if (!ok) std::fprintf(stderr, " %s: %s\n", op, band_names(bands).c_str());
return ok;
};
const int64_t R = 512;
for (const auto& [n, k] : { std::pair<int64_t, int64_t>{ 16384, 1536 }, { 4096, 16384 } }) {
Geometry g;
g.set_i("N", n);
g.set_i("K", k);
g.set_i("group", 128);
g.set_s("dtype", "fp8a8f32");
CHECK(all_resolve("gemm_nt_q", "M", 1, R, g));
}
for (const char* mode : { "absorb", "expand" }) {
Geometry g;
g.set_i("heads", 64);
g.set_i("head_dim", 256);
g.set_i("latent_dim", 512);
g.set_s("mode", mode);
g.set_s("dtype", "bf16");
CHECK(all_resolve("mla_project", "M", 1, R, g));
}
{
Geometry g;
g.set_i("latent_dim", 512);
g.set_i("heads", 64);
g.set_i("blocks", 513);
g.set_i("block_size", 4);
g.set_s("dtype", "bf16");
CHECK(all_resolve("mla_attn", "M", 1, R, g));
}
{
Geometry g;
g.set_i("n", 16384);
g.set_i("group", 128);
g.set_s("dtype", "bf16");
CHECK(all_resolve("quant_act_fp8", "M", 1, 4096, g));
}
{
Geometry g;
g.set_i("world_size", 8);
g.set_s("dtype", "bf16");
CHECK(all_resolve("all_gather", "numel", 4096, 4096 * 4096, g));
}
}
/* ================================================================== constraints that are not intervals */