Archived
radiance 2.0.0
Radiance becomes a multi-model engine: one process serves several models behind one port, loads each when a request names it, parks it in host memory or restores it from its container, and shares the cards between them (docs/MULTIMODEL.md). The configuration is one YAML file; the command line flags are gone (`radiance --config FILE`, hot reload on SIGHUP). Formats. IQ8R (rotated int8) and IQR-V4 replace FP8 and MXFP4 as whole-model formats, with an int8 KV cache (`kv-cache-dtype: i8`) in place of the fp8 one. Containers whose weights are block FP8, MXFP4, M2XFP4, NVFP4 or ParoQuant are refused at startup by the name of the first such weight. Not served until they have int8 containers: GLM-5.3-Flash, Ornith-1.5, Sage-A1.5, Nemotron-3.5-Bolt-74B, Ling-3.0-flash, drama-3 and Anima's FP8 container; Nemotron-3.5-Bolt-E4B, the Gemma 4 31B DFlash containers and MiniCPM5-2B bf16 serve without their drafter. 1.17.0 serves all of them. Speed. Chained launches for Qwen3.8-27B, Gemma 4, Gemma 3 and the small bf16 models, a new Qwen3.8-Flash-Next container (IQR-V4 experts, int8 trunk) with its decode step and prefill reworked, and a reworked adaptive draft window. Deployment. deploy/compose has two fleet files, tp1.yaml and tp2.yaml, each with its configuration beside it, in place of the per-model files. `host-pool-mib` is a model's host pool in all, split among its ranks. The dashboard is rebuilt: an hour of history kept by the server, each accelerator's memory by model, model states over time. Merged since 1.17.0: Nemotron-3.5-Bolt-74B-A9B by keptn42 (#339); GLM-5.3-Flash on four cards by AnimusNull (#397); chained launches for Flash-Next's decode step (#396) and preempted requests keeping their prefix and place (#405) by mici81; --prefill-interleave auto by Code000 (#410); eight more libr3d kernels and the w4a4 reference by RikshaDriver (#403, #407, #408); libr3d large-BAR and E4M3 decode fixes by neuromanMD (#438, #439); int4/int5 decode tiles by Kezi (#426); attention for Nanbeige 4.3 33B by everplays (#417); expert_stats_report.py by baKon (#431). Fixed: #398, #402, #419, #437 (dschmitz's patch); added the metrics of #392, and multi-model serving as asked for in #367 and #109. Plugin ABI 39: out-of-tree plugins need to be rebuilt. Thanks to @keptn42, @AnimusNull, @mici81, @Code000, @RikshaDriver, @neuromanMD, @Kezi, @everplays, @baKon and @dschmitz.
This commit is contained in:
1 parent
b4c04b6042
commit
ddcb9c69bb
696 files changed
+120770
-56596
No files matched your search
@@ -1022,6 +1022,146 @@ TEST(a_container_extended_in_place_keeps_every_old_weight_where_it_was) {
|
||||
CHECK(slurp(b.path) == before);
|
||||
}
|
||||
|
||||
/* A layer the container holds no expert of takes its whole table past the end, at a fixed stride
|
||||
* like a layer written with the file; the layers it had keep theirs. */
|
||||
TEST(an_in_place_extension_takes_a_whole_new_layer_of_experts) {
|
||||
Built b = write_model("append_layer");
|
||||
RadFile old;
|
||||
REQUIRE((old.open(b.path.c_str())) >= 0);
|
||||
const int64_t n_old = old.entry_count(), size_old = old.size();
|
||||
RadWriter w;
|
||||
REQUIRE((w.begin_append(b.path.c_str(), old)) >= 0);
|
||||
carry_over(w, old);
|
||||
std::vector<RadWriter::Weight> made;
|
||||
for (int32_t e = 0; e < 5; ++e) {
|
||||
const std::string x = "." + std::to_string(e);
|
||||
RadWriter::Weight g = mkw(("blk.2.ffn_gate" + x).c_str(), int4_g32(), EXP_ROWS, EXP_COLS,
|
||||
2, e, 0);
|
||||
const Planes gp = planes_of(g, (uint8_t)(40 + e));
|
||||
CHECK(w.add_weight(g, gp.ptr.data()) >= 0);
|
||||
RadWriter::Weight d = mkw(("blk.2.ffn_down" + x).c_str(), plain_bf16(), 64, 32, 2, e, 1);
|
||||
const Planes dp = planes_of(d, (uint8_t)(60 + e));
|
||||
CHECK(w.add_weight(d, dp.ptr.data()) >= 0);
|
||||
made.push_back(g);
|
||||
made.push_back(d);
|
||||
}
|
||||
/* The new layer's table is closed like any other: an expert out of order is refused. */
|
||||
const RadWriter::Weight late = mkw("blk.2.ffn_gate.6", int4_g32(), EXP_ROWS, EXP_COLS, 2, 6, 0);
|
||||
CHECK(w.add_weight(late) < 0);
|
||||
REQUIRE((w.finish()) >= 0);
|
||||
old.close();
|
||||
|
||||
RadFile f;
|
||||
REQUIRE((f.open(b.path.c_str())) >= 0);
|
||||
CHECK_EQ(f.entry_count(), n_old + 10);
|
||||
CHECK_EQ(f.group_count(), (int64_t)3);
|
||||
for (int32_t layer = 0; layer < 2; ++layer) {
|
||||
const RadFile::ExpertGroup* g = f.group_for_layer(layer);
|
||||
REQUIRE(g != nullptr);
|
||||
CHECK_EQ((int)g->n_expert, 4);
|
||||
CHECK_EQ((int)g->n_slot, 3);
|
||||
}
|
||||
const RadFile::ExpertGroup* g = f.group_for_layer(2);
|
||||
REQUIRE(g != nullptr);
|
||||
CHECK_EQ((int)g->n_expert, 5);
|
||||
CHECK_EQ((int)g->n_slot, 2);
|
||||
CHECK((int64_t)g->base >= size_old);
|
||||
CHECK_EQ((int64_t)(g->stride % RAD_ALIGN_UNIT), (int64_t)0);
|
||||
for (int32_t e = 0; e < 5; ++e)
|
||||
for (int32_t sl = 0; sl < 2; ++sl) {
|
||||
const RadFileEntry& row = f.expert_entry(*g, e, sl);
|
||||
CHECK_EQ((int)row.expert, (int)e);
|
||||
CHECK_EQ((int64_t)(row.offset - g->base - (uint64_t)e * g->stride),
|
||||
(int64_t)g->slot_off[sl]);
|
||||
CHECK(planes_match(f, row, made[(size_t)(2 * e + sl)],
|
||||
(uint8_t)((sl ? 60 : 40) + e)));
|
||||
}
|
||||
f.close();
|
||||
}
|
||||
|
||||
/* A layer whose old experts are not kept takes a whole new table past the end, of its own
|
||||
* geometry, and the old table is left behind; a layer is kept whole or written whole, in either
|
||||
* order of the two calls. */
|
||||
TEST(an_in_place_extension_writes_a_layers_experts_again_all_together) {
|
||||
Built b = write_model("append_replace");
|
||||
RadFile old;
|
||||
REQUIRE((old.open(b.path.c_str())) >= 0);
|
||||
const int64_t size_old = old.size();
|
||||
int64_t n_kept = 0;
|
||||
{
|
||||
RadWriter w;
|
||||
REQUIRE((w.begin_append(b.path.c_str(), old)) >= 0);
|
||||
const RadWriter::Weight g0 = mkw("blk.1.ffn_gate.0", int4_g32(), EXP_ROWS, EXP_COLS, 1, 0, 0);
|
||||
CHECK(w.add_weight(g0) >= 0);
|
||||
const RadFileEntry* kept = old.find("blk.1.ffn_gate.1");
|
||||
REQUIRE(kept != nullptr);
|
||||
CHECK(w.add_existing(weight_of(old, *kept), old, *kept) < 0);
|
||||
w.abort();
|
||||
}
|
||||
{
|
||||
RadWriter w;
|
||||
REQUIRE((w.begin_append(b.path.c_str(), old)) >= 0);
|
||||
const RadFileEntry* kept = old.find("blk.1.ffn_gate.1");
|
||||
REQUIRE(kept != nullptr);
|
||||
CHECK(w.add_existing(weight_of(old, *kept), old, *kept) >= 0);
|
||||
const RadWriter::Weight g0 = mkw("blk.1.ffn_gate.0", int4_g32(), EXP_ROWS, EXP_COLS, 1, 0, 0);
|
||||
CHECK(w.add_weight(g0) < 0);
|
||||
w.abort();
|
||||
}
|
||||
RadWriter w;
|
||||
REQUIRE((w.begin_append(b.path.c_str(), old)) >= 0);
|
||||
w.set_arch("radtest");
|
||||
w.set_model_name("format-test");
|
||||
w.set_quant("fp8_block");
|
||||
w.set_recipe(kRecipe);
|
||||
w.set_created_by("format_test, a layer written again");
|
||||
w.meta_i("n_layers", 2);
|
||||
for (int64_t i = 0; i < old.entry_count(); ++i) {
|
||||
const RadFileEntry& e = old.entry(i);
|
||||
if (e.expert >= 0 && e.layer == 1) continue;
|
||||
CHECK(w.add_existing(weight_of(old, e), old, e) >= 0);
|
||||
++n_kept;
|
||||
}
|
||||
std::vector<RadWriter::Weight> made;
|
||||
for (int32_t e = 0; e < 5; ++e) {
|
||||
const std::string x = "." + std::to_string(e);
|
||||
RadWriter::Weight g = mkw(("blk.1.ffn_gate" + x).c_str(), plain_bf16(), 64, 32, 1, e, 0);
|
||||
const Planes gp = planes_of(g, (uint8_t)(90 + e));
|
||||
CHECK(w.add_weight(g, gp.ptr.data()) >= 0);
|
||||
RadWriter::Weight d = mkw(("blk.1.ffn_down" + x).c_str(), int4_g32(), EXP_ROWS, EXP_COLS,
|
||||
1, e, 1);
|
||||
const Planes dp = planes_of(d, (uint8_t)(110 + e));
|
||||
CHECK(w.add_weight(d, dp.ptr.data()) >= 0);
|
||||
made.push_back(g);
|
||||
made.push_back(d);
|
||||
}
|
||||
REQUIRE((w.finish()) >= 0);
|
||||
old.close();
|
||||
|
||||
RadFile f;
|
||||
REQUIRE((f.open(b.path.c_str())) >= 0);
|
||||
CHECK_EQ(f.entry_count(), n_kept + 10);
|
||||
CHECK_EQ(f.group_count(), (int64_t)2);
|
||||
const RadFile::ExpertGroup* g0 = f.group_for_layer(0);
|
||||
REQUIRE(g0 != nullptr);
|
||||
CHECK_EQ((int)g0->n_expert, 4);
|
||||
CHECK((int64_t)g0->base < size_old);
|
||||
const RadFile::ExpertGroup* g = f.group_for_layer(1);
|
||||
REQUIRE(g != nullptr);
|
||||
CHECK_EQ((int)g->n_expert, 5);
|
||||
CHECK_EQ((int)g->n_slot, 2);
|
||||
CHECK((int64_t)g->base >= size_old);
|
||||
for (int32_t e = 0; e < 5; ++e)
|
||||
for (int32_t sl = 0; sl < 2; ++sl) {
|
||||
const RadFileEntry& row = f.expert_entry(*g, e, sl);
|
||||
CHECK_EQ((int)row.expert, (int)e);
|
||||
CHECK(planes_match(f, row, made[(size_t)(2 * e + sl)],
|
||||
(uint8_t)((sl ? 110 : 90) + e)));
|
||||
}
|
||||
CHECK(f.find("blk.1.ffn_up.0") == nullptr);
|
||||
f.close();
|
||||
}
|
||||
|
||||
TEST(an_in_place_extension_that_fails_leaves_the_container_as_it_was) {
|
||||
Built b = write_model("append_fail");
|
||||
const std::vector<uint8_t> before = slurp(b.path);
|
||||
|
||||
Reference in new issue
Block a user