Archived
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:
10 parents
4bca30369b
b1f4fccc52
d90e19dc15
3aded1bbf8
d912c694f3
824e238996
58142a6638
9322ea0b92
e9d03362f0
4d68a01a08
commit
5a9ce4912b
137 files changed
+12959
-1126
No files matched your search
+221
-23
@@ -331,6 +331,187 @@ TEST(absorbed_mla_shards_complete_heads_and_reads_one_latent_cache) {
|
||||
}
|
||||
}
|
||||
|
||||
/* GLM's MLA from the TP split threshold: each rank runs its run of the step's rows with all 64
|
||||
* heads, through q_b, kv_b and o at full width, and an all_gather lays the runs out, instead of
|
||||
* its heads over every row and an all-reduce. Runs are ceil(T / world) rows, the last one short;
|
||||
* the gather sends whole runs into an output of world runs. Below the threshold, and at TP1, the
|
||||
* head form is unchanged, as it is unless the row form is opted into (the default). */
|
||||
TEST(glm_mla_splits_a_prefill_by_rows_over_ranks_from_the_row_threshold) {
|
||||
using namespace rad::arch;
|
||||
for (int world : { 1, 2, 4, 8 })
|
||||
for (int rank = 0; rank < world; ++rank) {
|
||||
RadBuilder b;
|
||||
b.kv_block = 4;
|
||||
// The container's MLA entries; the row form's names are not among them.
|
||||
const auto fp8 = rad_enc_affine(RAD_F8E4M3, RAD_F32, 128, 128);
|
||||
b.encs = { { "attn_q_a.weight", fp8 },
|
||||
{ "attn_kv_a.weight", fp8 },
|
||||
{ "attn_q_b.weight", fp8 },
|
||||
{ "attn_output.weight", fp8 },
|
||||
{ "attn_kv_b.weight", rad_enc_plain(RAD_BF16) } };
|
||||
Names nm("");
|
||||
Geom g{};
|
||||
g.n_embd = 4096;
|
||||
g.max_tok = 512;
|
||||
g.max_ctx = 4096;
|
||||
g.eps = 1e-5;
|
||||
g.world = world;
|
||||
g.rank = rank;
|
||||
RadKVGroupDecl kd{};
|
||||
kd.kind = RAD_KV_FULL;
|
||||
kd.dtype = RAD_BF16;
|
||||
kd.n_head_kv = 1;
|
||||
kd.head_dim = 256;
|
||||
const rad_kvgroup kv = rad_decl_kv_group(&b, "latent", &kd);
|
||||
const int64_t T = 512, R = GlmMla::rows_for(T, world), H = 64 / world;
|
||||
auto act = [&](ActFP8& a, const char* name, int64_t rows, int64_t width) {
|
||||
a.x = decl_b(&b, name, RAD_BF16, { rows, width });
|
||||
return a.declare_qs(&b, nm, g, name, width, rows);
|
||||
};
|
||||
GlmMla::Wire w;
|
||||
REQUIRE_EQ(act(w.input, "normalized", T, 4096), RAD_OK);
|
||||
w.q_raw = decl_b(&b, "q_raw", RAD_BF16, { T, 1536 });
|
||||
w.kv_raw = decl_b(&b, "kv_raw", RAD_BF16, { T, 512 });
|
||||
REQUIRE_EQ(act(w.q_low, "q_low", T, 1536), RAD_OK);
|
||||
w.latent = decl_b(&b, "latent", RAD_BF16, { T, 512 });
|
||||
w.out = decl_b(&b, "attn_delta", RAD_BF16, { world * R, 4096 });
|
||||
w.core.q = decl_b(&b, "query", RAD_BF16, { T, 16384 / world });
|
||||
w.core.q_latent = decl_b(&b, "q_latent", RAD_BF16, { T, H, 512 });
|
||||
w.core.attn_latent = decl_b(&b, "attn_latent", RAD_BF16, { T, H, 512 });
|
||||
REQUIRE_EQ(act(w.attn, "expanded", T, 16384 / world), RAD_OK);
|
||||
w.core.out = w.attn.x;
|
||||
w.core.selected = decl_b(&b, "selected", RAD_I32, { T, 513 });
|
||||
w.core.length = decl_b(&b, "length", RAD_I32, { T });
|
||||
w.rows.q = decl_b(&b, "rows_query", RAD_BF16, { R, 16384 });
|
||||
w.rows.q_latent = decl_b(&b, "rows_q_latent", RAD_BF16, { R, 64, 512 });
|
||||
w.rows.attn_latent = decl_b(&b, "rows_attn_latent", RAD_BF16, { R, 64, 512 });
|
||||
REQUIRE_EQ(act(w.rows.attn, "rows_expanded", R, 16384), RAD_OK);
|
||||
w.rows.out = decl_b(&b, "rows_out", RAD_BF16, { R, 4096 });
|
||||
GlmMla mla;
|
||||
REQUIRE_EQ(mla.declare(&b, nm, g, 3, w, "model.layers.3.self_attn", kv), RAD_OK);
|
||||
const bool rows = world > 1;
|
||||
CHECK_EQ(mla.op_rows_gather != 0, rows);
|
||||
CHECK_EQ(count_op(b, "all_gather"), rows ? 1 : 0);
|
||||
CHECK_EQ(count_op(b, "mla_attn"), rows ? 2 : 1);
|
||||
const RecWeight* head_q = find_w(b, "blk.3.attn_q_b.weight");
|
||||
REQUIRE(head_q);
|
||||
CHECK_EQ(head_q->d.shape[0], 16384 / world);
|
||||
if (!rows) {
|
||||
CHECK(!find_w(b, "blk.3.attn_q_b_rows.weight"));
|
||||
continue;
|
||||
}
|
||||
const RecWeight* q_b = find_w(b, "blk.3.attn_q_b_rows.weight");
|
||||
const RecWeight* kv_b = find_w(b, "blk.3.attn_kv_b_rows.weight");
|
||||
const RecWeight* o = find_w(b, "blk.3.attn_output_rows.weight");
|
||||
REQUIRE(q_b && kv_b && o);
|
||||
CHECK_EQ(q_b->d.shard, RAD_SHARD_NONE);
|
||||
CHECK_EQ(q_b->d.shape[0], 16384);
|
||||
CHECK_EQ(q_b->d.shape[1], 1536);
|
||||
CHECK_EQ(kv_b->d.shard, RAD_SHARD_NONE);
|
||||
CHECK_EQ(kv_b->d.dtype, RAD_BF16);
|
||||
CHECK_EQ(kv_b->d.shape[0], 32768);
|
||||
CHECK_EQ(kv_b->d.shape[1], 512);
|
||||
CHECK_EQ(o->d.shard, RAD_SHARD_NONE);
|
||||
CHECK_EQ(o->d.shape[0], 4096);
|
||||
CHECK_EQ(o->d.shape[1], 16384);
|
||||
// The full-width weights are whole views of the head form's container entries, so
|
||||
// they take its encoding (block fp8 at f32 scales) and need no name map of their own.
|
||||
const auto source = [](const RecWeight* w) {
|
||||
return std::string(w && w->d.source ? w->d.source : "");
|
||||
};
|
||||
CHECK_EQ(source(q_b), "blk.3.attn_q_b.weight");
|
||||
CHECK_EQ(source(find_w(b, "blk.3.attn_q_b_rows.scale")), "blk.3.attn_q_b.weight");
|
||||
CHECK_EQ(source(kv_b), "blk.3.attn_kv_b.weight");
|
||||
CHECK_EQ(source(o), "blk.3.attn_output.weight");
|
||||
CHECK_EQ(source(find_w(b, "blk.3.attn_output_rows.scale")), "blk.3.attn_output.weight");
|
||||
CHECK_EQ(find_w(b, "blk.3.attn_q_b_rows.scale")->d.dtype, RAD_F32);
|
||||
for (const auto& map : b.maps) CHECK(map.declared.find("_rows") == std::string::npos);
|
||||
CHECK_EQ(pstr(&b.ops[mla.rows_q_b.op - 1], "dtype"), "fp8a8f32");
|
||||
CHECK_EQ(pstr(&b.ops[mla.rows_output.op - 1], "dtype"), "fp8a8f32");
|
||||
CHECK_EQ(pstr(&b.ops[mla.q_b.op - 1], "dtype"), "fp8a8f32");
|
||||
const RecOp* attn = &b.ops[mla.op_rows_attn - 1];
|
||||
CHECK_EQ(pint(attn, "heads"), 64);
|
||||
CHECK_EQ(pint(attn, "blocks"), 513);
|
||||
CHECK_EQ(param(attn, "M")->ihi, R);
|
||||
CHECK(attn->reads ==
|
||||
std::vector<rad_buf>({ w.rows.q_latent, w.core.selected, w.core.length }));
|
||||
const RecOp* gather = &b.ops[mla.op_rows_gather - 1];
|
||||
const RecOp* reduce = &b.ops[mla.op_ar - 1];
|
||||
CHECK_EQ(pint(gather, "world_size"), world);
|
||||
CHECK_EQ(pstr(gather, "dtype"), "bf16");
|
||||
CHECK(!param(gather, "row"));
|
||||
// The all-reduce's message bound, so the two share one exchange instance.
|
||||
CHECK_EQ(param(gather, "numel")->ihi, param(reduce, "numel")->ihi);
|
||||
CHECK(gather->reads == std::vector<rad_buf>({ w.rows.out }));
|
||||
CHECK(gather->writes == std::vector<rad_buf>({ w.out }));
|
||||
std::vector<int32_t> slots(T);
|
||||
RadKVGroupBatch kb{};
|
||||
kb.group = kv;
|
||||
kb.slot_mapping = slots.data();
|
||||
RadBatch batch{};
|
||||
batch.kv = &kb;
|
||||
batch.n_kv_groups = 1;
|
||||
for (int64_t steps : { 300, 255 }) {
|
||||
batch.n_tok = steps;
|
||||
RadCtx ctx;
|
||||
ctx.b = &b;
|
||||
ctx.rank = rank;
|
||||
ctx.world = world;
|
||||
mla.prepare(&ctx, &batch);
|
||||
mla.finish(&ctx, &batch);
|
||||
CHECK(ctx.step_fail.empty());
|
||||
auto issued = [&](rad_op op) {
|
||||
return std::count_if(ctx.issues.begin(), ctx.issues.end(),
|
||||
[&](const RecIssue& i) { return i.op == op; });
|
||||
};
|
||||
const bool split = steps >= GlmTp::kSplitRows;
|
||||
CHECK_EQ(issued(mla.q_b.op), split ? 0 : 1);
|
||||
CHECK_EQ(issued(mla.core.op_attn), split ? 0 : 1);
|
||||
CHECK_EQ(issued(mla.op_ar), split ? 0 : 1);
|
||||
CHECK_EQ(issued(mla.op_rows_attn), split ? 1 : 0);
|
||||
CHECK_EQ(issued(mla.op_rows_gather), split ? 1 : 0);
|
||||
if (!split) continue;
|
||||
const int64_t run = (steps + world - 1) / world, first = rank * run,
|
||||
n = std::min(run, steps - first);
|
||||
for (const auto& i : ctx.issues) {
|
||||
if (i.op == mla.rows_q_b.op) {
|
||||
CHECK_EQ(i.n, n);
|
||||
CHECK_EQ(i.opd[0].handle, w.q_low.q);
|
||||
CHECK_EQ(i.opd[0].offset, first * 1536);
|
||||
CHECK_EQ(i.opd[0].rows, n);
|
||||
CHECK_EQ(i.opd[2].handle, mla.rows_q_b.w);
|
||||
CHECK_EQ(i.opd[4].handle, w.rows.q);
|
||||
CHECK_EQ(i.opd[4].offset, 0);
|
||||
CHECK_EQ(i.opd[4].rows, n);
|
||||
} else if (i.op == mla.op_rows_attn) {
|
||||
CHECK_EQ(i.n, n);
|
||||
CHECK_EQ(i.opd[1].kind, RAD_OPK_KV);
|
||||
CHECK_EQ(i.opd[2].handle, w.core.selected);
|
||||
CHECK_EQ(i.opd[2].offset, first * 513);
|
||||
CHECK_EQ(i.opd[2].rows, n);
|
||||
CHECK_EQ(i.opd[3].handle, w.core.length);
|
||||
CHECK_EQ(i.opd[3].offset, first);
|
||||
CHECK_EQ(i.opd[3].rows, n);
|
||||
CHECK_EQ(i.opd[4].handle, w.rows.attn_latent);
|
||||
} else if (i.op == mla.rows_output.op) {
|
||||
CHECK_EQ(i.n, n);
|
||||
CHECK_EQ(i.opd[2].handle, mla.rows_output.w);
|
||||
CHECK_EQ(i.opd[4].handle, w.rows.out);
|
||||
CHECK_EQ(i.opd[4].offset, 0);
|
||||
} else if (i.op == mla.op_rows_gather) {
|
||||
CHECK_EQ(i.n, run * 4096);
|
||||
CHECK_EQ(i.opd[0].handle, w.rows.out);
|
||||
CHECK_EQ(i.opd[0].rows, run);
|
||||
CHECK_EQ(i.opd[1].handle, w.out);
|
||||
CHECK_EQ(i.opd[1].rows, world * run);
|
||||
}
|
||||
}
|
||||
// Eight ranks at 300 rows: runs of 38, the last 34.
|
||||
if (world == 8) CHECK_EQ(n, rank == 7 ? 34 : 38);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST(
|
||||
glm53_native_graph_declares_all_layers_preserves_mixed_formats_and_runs_mtp_only_in_draft_passes) {
|
||||
using namespace rad::arch;
|
||||
@@ -366,6 +547,8 @@ TEST(
|
||||
build.max_seqs = 4;
|
||||
build.max_ctx = 4096;
|
||||
build.max_spec = 3;
|
||||
// With the row form opted into (--tp-attn-split rows).
|
||||
build.tp_attn_rows = 1;
|
||||
REQUIRE_EQ(glm5next::declare(&b, &meta, &build), RAD_OK);
|
||||
const auto& m = *glm5next::models[rank];
|
||||
CHECK(m.have_mtp);
|
||||
@@ -433,9 +616,10 @@ TEST(
|
||||
CHECK_EQ(std::count(ops.begin(), ops.end(), "all_gather"), 0);
|
||||
// The split is declared on every rank whatever its step size; only rank 0 issues it here.
|
||||
const bool split = world > 1;
|
||||
// 43 routers (MTP included), the 90 mHC reads, and each of the 12 indexers' page
|
||||
// tables and lengths; the index head gates follow the indexer's rows, ungathered.
|
||||
CHECK_EQ(count_op(b, "all_gather"), split ? 43 + 90 + 24 : 0);
|
||||
// 43 routers (MTP included), the 90 mHC reads, each of the 12 indexers' page
|
||||
// tables and lengths (the index head gates follow the indexer's rows,
|
||||
// ungathered), and the 11 MLA row forms (the MTP layer keeps its heads).
|
||||
CHECK_EQ(count_op(b, "all_gather"), split ? 43 + 90 + 24 + 11 : 0);
|
||||
CHECK_EQ(count_op(b, "mhc_pre_partial"), split ? 90 : 0);
|
||||
ctx.issues.clear();
|
||||
batch.draft_pass = -1;
|
||||
@@ -482,12 +666,17 @@ TEST(
|
||||
CHECK(ctx.step_fail.empty());
|
||||
{
|
||||
// 512 rows reach the split: each router runs on its column slice, each mHC
|
||||
// read on its chunks and each indexer, its head gates included, on its run
|
||||
// of query rows, all gathered but the gates; at TP1 nothing changes.
|
||||
// read on its chunks, each indexer, its head gates included, on its run
|
||||
// of query rows, and each MLA on its run of rows, all gathered but the
|
||||
// gates; at TP1 nothing changes.
|
||||
const auto long_ops = issued_ops(b, ctx);
|
||||
CHECK_EQ(std::count(long_ops.begin(), long_ops.end(), "gemm_nt_f32"), 53);
|
||||
CHECK_EQ(std::count(long_ops.begin(), long_ops.end(), "all_gather"),
|
||||
world > 1 ? 42 + 90 + 22 : 0);
|
||||
world > 1 ? 42 + 90 + 22 + 11 : 0);
|
||||
// 1 embedding, 45 attention and 45 expert reductions, less the 11 MLA ones.
|
||||
CHECK_EQ(std::count(long_ops.begin(), long_ops.end(), "all_reduce"),
|
||||
world > 1 ? 91 - 11 : 0);
|
||||
CHECK_EQ(std::count(long_ops.begin(), long_ops.end(), "mla_attn"), 11);
|
||||
CHECK_EQ(std::count(long_ops.begin(), long_ops.end(), "mhc_pre"),
|
||||
world > 1 ? 0 : 90);
|
||||
CHECK_EQ(std::count(long_ops.begin(), long_ops.end(), "mhc_pre_finish"),
|
||||
@@ -531,6 +720,7 @@ TEST(
|
||||
RadArchProbe capabilities{};
|
||||
REQUIRE_EQ(glm5next::probe(&meta, &capabilities), RAD_OK);
|
||||
CHECK_EQ(capabilities.shape_probe_ok, 1);
|
||||
CHECK_EQ(capabilities.tp_attn_rows_ok, 1);
|
||||
std::array<int, 8> results{};
|
||||
std::vector<std::thread> probes;
|
||||
for (int i = 0; i < 8; ++i)
|
||||
@@ -724,8 +914,8 @@ TEST(glm53_indexer_scores_and_selects_one_run_of_query_rows_per_rank) {
|
||||
|
||||
/* The engine's arena levels declare again at a smaller max_tok (RadBuildCtx::shape_probe) and
|
||||
* must get the real declare's graph: the same ops with the same fixed parameters, only ranged row
|
||||
* counts and buffer rows smaller. The TP split declares its ops whatever the step size and its
|
||||
* gathers' message as a range. */
|
||||
* counts and buffer rows smaller. The TP splits declare its ops whatever the step size and their
|
||||
* gathers' message as a range, in the head and the row form of the MLA. */
|
||||
TEST(glm53_sizing_declares_match_the_real_graph_at_every_arena_level) {
|
||||
const char* keys[] = { "num_nextn_predict_layers", "hc_mult", "n_routed_experts",
|
||||
"index_topk" };
|
||||
@@ -741,6 +931,7 @@ TEST(glm53_sizing_declares_match_the_real_graph_at_every_arena_level) {
|
||||
const auto mx = rad_enc_affine(RAD_FP4E2M1, RAD_E8M0, 1, 32);
|
||||
const auto fp8 = rad_enc_affine(RAD_F8E4M3, RAD_F32, 128, 128);
|
||||
const int world = 8, rank = 3;
|
||||
for (int rows_split : { 0, 1 })
|
||||
for (int64_t R : { 256, 3072 }) {
|
||||
auto encs = [&](RadBuilder& b) {
|
||||
b.kv_block = 4;
|
||||
@@ -760,6 +951,7 @@ TEST(glm53_sizing_declares_match_the_real_graph_at_every_arena_level) {
|
||||
c.max_seqs = 8;
|
||||
c.max_ctx = 32768;
|
||||
c.max_spec = 3;
|
||||
c.tp_attn_rows = rows_split;
|
||||
RadBuilder full;
|
||||
encs(full);
|
||||
REQUIRE_EQ(glm5next::declare(&full, &meta, &c), RAD_OK);
|
||||
@@ -1398,7 +1590,8 @@ TEST(kda_state_core_splits_mixed_batches_and_preserves_absolute_prefill_offsets)
|
||||
/* ==================================================================== the pinned graph and steps */
|
||||
|
||||
/* GLM declares and steps the pinned graph and launches at one and eight ranks: a 4096-row prefill
|
||||
* after history, a mixed step, a decode step, a verify and its draft passes. */
|
||||
* after history, a mixed step, a decode step, a verify and its draft passes, at eight in both
|
||||
* MLA forms. */
|
||||
TEST(glm53_is_the_pinned_graph_and_steps) {
|
||||
const char* keys[] = { "num_nextn_predict_layers", "hc_mult", "n_routed_experts",
|
||||
"index_topk" };
|
||||
@@ -1416,9 +1609,11 @@ TEST(glm53_is_the_pinned_graph_and_steps) {
|
||||
struct Case {
|
||||
int world;
|
||||
uint64_t graph, steps;
|
||||
bool heads_only = false; /* the default: the graph before the row form */
|
||||
};
|
||||
const Case cases[] = { { 1, 0x906897570034f5f5ull, 0x68ffc03d2b640d51ull },
|
||||
{ 8, 0x9f39f6f7a04dc4d3ull, 0x3818eedb4ac10d1bull } };
|
||||
{ 8, 0x1d378152c40f8834ull, 0x82ed1094dbf4b637ull },
|
||||
{ 8, 0x9f39f6f7a04dc4d3ull, 0x3818eedb4ac10d1bull, true } };
|
||||
for (const Case& cs : cases) {
|
||||
RadBuilder b;
|
||||
b.kv_block = 4;
|
||||
@@ -1434,11 +1629,13 @@ TEST(glm53_is_the_pinned_graph_and_steps) {
|
||||
ctx.max_tok = 4096;
|
||||
ctx.max_seqs = 8;
|
||||
ctx.max_ctx = 200000;
|
||||
ctx.tp_attn_rows = cs.heads_only ? 0 : 1;
|
||||
REQUIRE_EQ(glm5next::declare(&b, &meta, &ctx), RAD_OK);
|
||||
const uint64_t g = graph_hash(b);
|
||||
const uint64_t s = pinned_steps(b, glm5next::step, 0, cs.world);
|
||||
fprintf(stderr, " pin: glm5next world %d: graph 0x%016llxull, steps 0x%016llxull\n",
|
||||
cs.world, (unsigned long long)g, (unsigned long long)s);
|
||||
fprintf(stderr, " pin: glm5next world %d%s: graph 0x%016llxull, steps 0x%016llxull\n",
|
||||
cs.world, cs.heads_only ? " heads only" : "",
|
||||
(unsigned long long)g, (unsigned long long)s);
|
||||
CHECK_EQ(g, cs.graph);
|
||||
CHECK_EQ(s, cs.steps);
|
||||
}
|
||||
@@ -1827,11 +2024,12 @@ RAD_TEST_MAIN()
|
||||
|
||||
/* ==================================================================== the row rule */
|
||||
|
||||
/* GlmTp::run_rows is the one rule the indexer's runs follow: 4 * ceil(T / (4 * world)) for the
|
||||
* indexer's 4-byte lengths, ceil(T / world) for a row of whole 16-byte words. At the split threshold, around a chunk and at the largest step, for every
|
||||
* world: run_of covers the step once with no overlap, the last run short where the step ends
|
||||
* inside it, and a rank whose run lies wholly past a small step takes the first run instead, so
|
||||
* the planes it writes and gathers are never unwritten. */
|
||||
/* GlmTp::run_rows is the one rule the MLA's and the indexer's runs follow: ceil(T / world) for
|
||||
* the MLA's 8192-byte rows, 4 * ceil(T / (4 * world)) for the indexer's 4-byte lengths. At the
|
||||
* split threshold, around a chunk and at the largest step, for every world: run_of covers the
|
||||
* step once with no overlap, the last run short where the step ends inside it, and a rank whose
|
||||
* run lies wholly past a small step takes the first run instead, so the planes it writes and
|
||||
* gathers are never unwritten. */
|
||||
TEST(glm_tp_row_rule_rounds_to_whole_words_and_covers_a_step_once) {
|
||||
using namespace rad::arch;
|
||||
for (int world : { 1, 2, 4, 8 })
|
||||
@@ -1840,6 +2038,7 @@ TEST(glm_tp_row_rule_rounds_to_whole_words_and_covers_a_step_once) {
|
||||
const int64_t narrow = GlmTp::run_rows(T, world, 4);
|
||||
CHECK_EQ(wide, (T + world - 1) / world);
|
||||
CHECK_EQ(narrow, 4 * ((T + 4 * world - 1) / (4 * world)));
|
||||
CHECK_EQ(GlmMla::rows_for(T, world), wide);
|
||||
CHECK_EQ(DsaCache::part_rows(T, world), narrow);
|
||||
CHECK(world * wide >= T);
|
||||
CHECK(world * narrow >= T);
|
||||
@@ -2195,12 +2394,11 @@ std::string as_expert_zero(std::string n) {
|
||||
} /* namespace */
|
||||
|
||||
/* Every weight the plugin declares reads an entry the served container holds: under its own name,
|
||||
* or through `source` for a view (a scale plane), and every GEMM names the dtype its weight's
|
||||
* stored encoding calls for: `fp8a8f32` on the f32-scaled block FP8, `mxfp4a8` on the MXFP4
|
||||
* experts, `bf16` on the plain linears. The encodings come from the table, as the container would
|
||||
* answer. A weight declared under a name the container does not hold, or a GEMM at a dtype its
|
||||
* weight's encoding does not call for, passes every host test and leaves bands with no kernel at
|
||||
* the eight-card start. */
|
||||
* or through `source` for a view (a scale plane, the row form's full-width projections), and
|
||||
* every GEMM names the dtype its weight's stored encoding calls for: `fp8a8f32` on the f32-scaled
|
||||
* block FP8, `mxfp4a8` on the MXFP4 experts, `bf16` on the plain linears. The encodings come
|
||||
* from the table, as the container would answer. A full-width view declared as its own weight
|
||||
* at `fp8a8` passed every host test and left 88 bands with no kernel at the eight-card start. */
|
||||
TEST(glm53_declares_the_served_containers_names_and_their_encodings) {
|
||||
const Glm53Container& c = glm53_container();
|
||||
MetaKV mk = glm53_vl_meta();
|
||||
|
||||
Reference in new issue
Block a user