Archived
radiance 1.15.0
New models and formats: - IQR for Qwen3.8-27B: weights on the int8 grid under GPTQ, a trellis down each GPTQ column (IQR-V2), and IQR-V3, a computed trellis code under one scale a row, kept at its codes' width in VRAM and decoded in the GEMM; 15 IQR-V3 recipes from ~2 to ~7 bits a weight (data/recipes/q38-27b-*-v3.recipe, docs/IQR.md) - libhalo: a kernel library for Strix Halo (gfx1151), preferred there over libr3d - Nemotron 3.5 Embed 1B and 8B (nemotron35_embed): text and image embeddings through a Pixtral tower, on the card and on the CPU - Nemotron 3.5 Rerank 8B - /v1/systemone: Cloudflare's clef and clef-flash, Convai Innovations' Laya and Mica beside LiquidAI d1; scored steps read the candidates' logits from the head table with no lm_head pass - LFM2's 8-bit trunk: block-fp8 or int8 linears with the fused producers, and the d1-3B recipe - DeepSeek-V4.1's reply format with DSML tool calls and typed argument tags Weights on the drive: - The file tier reads only the experts the pass routes rows to; the draft head's weights stay in the host pool - A hot VRAM cache for routed experts read off the drive, reads deposited straight into free host pool slots, and copyless evictions; the file tier's counters are now ssd_* - GLM-5 Next shards its routed experts by expert, not by width, so they can live on the drive - The stall watch counts drive reads as progress, and the DMA lane's room check reads the lane's own completion fence Quantisation tooling: - --calib-corpus, --calib-dir and --calib-layers record each linear's input Hessian; beside --kld-record the reference's own run records them - --kld-top N records a sparse KL reference (the N most likely tokens and the tail's mass) - GPTQ in a third of the time with the same codes, trellis GPTQ on the card, vector codebooks with coordinate descent, and rad-convert --reuse repeated, each container supplying what the earlier ones lack Speculation: - Prompt lookup alone (--spec-ngram K, --spec-ngram-min/-max): each sequence keeps an index of its n-grams, and a proposal is verified only when its measured step cost says it pays; --draft-window adaptive follows it Speed: - IQR decode: the narrow tile splits K for four times the int8 tile's waves and folds each 128-K block once; at 8 tokens down and the output projections run in 0.61-0.82x and 0.70-0.92x FP8's time (2-6 bits); IQ6R-S-V3 with its DFlash2 drafter steps in 26.3 ms at TP2, against 29.4 ms before and FP8's 27.3 - Qwen MXFP4 feed-forward: the gated fold up to 16 rows, not 8 - libr4d: the gated prefill fold, the short-prompt split row, and the rows forms of rmsnorm and rope; KLATE again for the head-256 gqa6 paged prefill; gram_accum on the matrix cores Features: - /health, /v1/health and /ping answer 503 with "status": "stuck" once the device has advanced nothing for a minute or a queue has faulted, so a supervisor can restart a wedged server (#356) - --image-gen-max-pixels and --image-gen-max-refs size an image generator's buffers (#344) - The startup report lists only the options not at their default, with a count; -v lists all (#250) - --preempt-wait-ms bounds how long a preempted prefill waits for its whole-recompute room - --placement layer_offload spills dense layers so one --max-model-len sequence fits - Startup refuses amdgpu with CWSR off and says how to fix it; --proceed-with-incompatible-configuration starts anyway under an UNSUPPORTED banner Fixes: - The n-gram read-ahead hands each row to the reader once and reads only as far ahead as the row cache holds, and pauses while decode reads: about one drive read a row instead of two (#355) - A file-tier window reads each of its runs once, not once a run per run - The decode split law's verify floor is bounded by the batch's workgroups: max_seqs 256 no longer declares 64x the scratch (#342) - A prefetch DMA list's mark stays out of the signal pool until the engine has read it, and a prefill stage copies only the blocks its own tables name (#343) - The split-KV row sum is read with fetch-inactive (#328) - LFM2 on the host backend: libref and libavx serve the row-form ops it declares (#348) - The preempted-prefill gate skips a KV group that holds no blocks (#352) - Every request entry point bounded, gated and sanitised (JSON depth, invalid UTF-8, control bytes in the log, the dashboard's CSP, cross-origin browsers on the loopback-only routes); a prompt id outside the vocabulary refused at admission; --api-key "" refused at startup - The telemetry the HTTP thread reads is atomic - An RMS norm row no longer depends on how many rows its launch carries; prefill attention's rescale is decided by live rows only - A --kld-record prefill chunk that finishes no sequence gets its logits on a tied-head model - A kernel's lazily made counter block is zeroed outside the lock other ranks take (a TP2 first-step hang) Changes: Plugin ABI 32. Every plugin exports a layout fingerprint of the ABI structs and the loader refuses a plugin without it or with another (#302), so out-of-tree plugins must be rebuilt. Appended: RadBuildCtx calib_* and gen_max_*, RadArchProbe gen_max_*, RadBatch score_only and plugin_words, RadDeviceProps::unified, RadChatFormat arg_json_value_prefix.
This commit is contained in:
commit
9ed3ef7a7b
452 files changed
+167762
-1346
No files matched your search
+108
-4
@@ -1286,7 +1286,7 @@ TEST(a_scored_request_names_real_vocabulary_rows) {
|
||||
|
||||
/* The prompt itself names real vocabulary rows too: raw id arrays arrive verbatim from the
|
||||
* request body, and an id past the embedding table must die at admission, never staged into a
|
||||
* pass — the embedding gather would fail the step, a failed step is a device fault, and a
|
||||
* pass -- the embedding gather would fail the step, a failed step is a device fault, and a
|
||||
* device fault stops the engine (spec §17). One bad number must not be a server kill. */
|
||||
TEST(a_prompt_names_real_vocabulary_rows) {
|
||||
Fixture f;
|
||||
@@ -4578,6 +4578,34 @@ TEST(the_cards_block_tables_match_the_manager_after_every_build) {
|
||||
CHECK(checked > 100);
|
||||
}
|
||||
|
||||
/* A streamed group's prefill stage copies what the step's own sequences' tables name
|
||||
* (kvstream/stage.h, "Volume"), so the engine reads the step's sequences off the batch it is about
|
||||
* to run: the build's rows in order, for that batch only. */
|
||||
TEST(a_built_batch_names_its_own_sequences_in_row_order) {
|
||||
Fixture f;
|
||||
f.build(/*blocks=*/4096, /*states=*/64);
|
||||
CHECK_OK(f.start());
|
||||
f.submit(40, 9);
|
||||
f.submit(70, 20);
|
||||
int checked = 0;
|
||||
for (int step = 0; step < 12; ++step) {
|
||||
if (step == 3) f.submit(33, 12);
|
||||
const RadBatch* b = f.sch.step();
|
||||
if (!b) break;
|
||||
const StepPlan& p = f.sch.plan();
|
||||
const std::vector<uint64_t>* seqs = f.sch.step_seqs(b);
|
||||
REQUIRE(seqs != nullptr);
|
||||
REQUIRE_EQ(seqs->size(), p.e.size());
|
||||
for (size_t i = 0; i < p.e.size(); ++i) CHECK_EQ((*seqs)[i], p.e[i].seq);
|
||||
++checked;
|
||||
CHECK_OK(f.commit(0, 0));
|
||||
}
|
||||
CHECK(checked > 5);
|
||||
RadBatch other{};
|
||||
CHECK(f.sch.step_seqs(&other) == nullptr);
|
||||
CHECK(f.sch.step_seqs(nullptr) == nullptr);
|
||||
}
|
||||
|
||||
/* A streamed group's residency map and ring bookkeeping live in each rank's KV pool,
|
||||
* but the manager the builder is given is rank 0's, so its pointers are rank 0's addresses. A
|
||||
* two-rank batch must name rank r's own copies or device r resolves through device 0's memory
|
||||
@@ -4650,6 +4678,82 @@ TEST(a_two_rank_batch_rebases_stream_maps_into_each_ranks_pool_and_shares_the_mi
|
||||
bb.fini();
|
||||
}
|
||||
|
||||
/* A request's words for the plugin (Request::plugin_words) ride the prefill step that samples
|
||||
* its first token, with that row's index in word 0; a sequence without words, or one not at that
|
||||
* step, has an empty range. A request past the declared bound fails the build. */
|
||||
TEST(a_requests_plugin_words_ride_the_step_that_samples_its_first_token) {
|
||||
Fixture f;
|
||||
f.build();
|
||||
f.prog.plugin_words = 8;
|
||||
ChunkGeometry geo;
|
||||
CHECK_OK(chunk_geometry_resolve(f.prog, f.cfg, &geo));
|
||||
KVGeom kvg = KVGeom::of(f.prog.kv_groups);
|
||||
for (size_t i = 0; i < kvg.g.size(); ++i) {
|
||||
const int64_t w = f.kv.state_index_width((int32_t)i);
|
||||
if (w > 0) kvg.g[i].sidx_width = w;
|
||||
}
|
||||
BatchBuilder bb;
|
||||
std::vector<BatchBuilder::RankIO> rio;
|
||||
rio.push_back({ 0, nullptr, &f.prog });
|
||||
CHECK_OK(bb.init(f.prog, f.cfg, geo, kvg, rio));
|
||||
for (uint64_t id = 1; id <= 3; ++id) {
|
||||
CHECK_OK(f.kv.add_sequence(id));
|
||||
CHECK_OK(f.kv.ensure(id, 80));
|
||||
}
|
||||
Request r1, r2, r3;
|
||||
r1.prompt.assign(8, 1);
|
||||
r2.prompt.assign(8, 1);
|
||||
r2.plugin_words = { 0, 7, 8, 9 };
|
||||
r3.prompt.assign(8, 1);
|
||||
r3.plugin_words = { 0, 5 };
|
||||
|
||||
StepPlan p;
|
||||
p.reset();
|
||||
auto entry = [&](uint64_t id, const Request* r, bool last) {
|
||||
StepEntry e;
|
||||
e.seq = id;
|
||||
e.card = (int32_t)id - 1;
|
||||
e.req = r;
|
||||
e.n_tokens = 8;
|
||||
e.ctx_len = 0;
|
||||
e.is_prefill = true;
|
||||
e.produces_token = last;
|
||||
p.e.push_back(e);
|
||||
p.n_tok += 8;
|
||||
};
|
||||
entry(1, &r1, true); /* no words */
|
||||
entry(2, &r2, true); /* words, sampled this step */
|
||||
entry(3, &r3, false); /* words, but a mid-prompt chunk */
|
||||
const RadBatch* b = bb.build(p, f.kv, 0);
|
||||
REQUIRE(b != nullptr);
|
||||
CHECK_EQ(b->n_plugin_words, (int64_t)4);
|
||||
REQUIRE(b->plugin_cu_h != nullptr);
|
||||
CHECK_EQ(b->plugin_cu_h[0], 0);
|
||||
CHECK_EQ(b->plugin_cu_h[1], 0);
|
||||
CHECK_EQ(b->plugin_cu_h[2], 4);
|
||||
CHECK_EQ(b->plugin_cu_h[3], 4);
|
||||
/* Sequence 1 took logits row 0, so sequence 2's words open with row 1. */
|
||||
CHECK_EQ(b->plugin_words_h[0], 1);
|
||||
CHECK_EQ(b->plugin_words_h[1], 7);
|
||||
CHECK_EQ(b->plugin_words_h[3], 9);
|
||||
CHECK(b->plugin_words != nullptr && b->plugin_cu != nullptr);
|
||||
|
||||
/* No sequence carries words: every field is null. */
|
||||
p.reset();
|
||||
entry(1, &r1, true);
|
||||
b = bb.build(p, f.kv, 1);
|
||||
REQUIRE(b != nullptr);
|
||||
CHECK_EQ(b->n_plugin_words, (int64_t)0);
|
||||
CHECK(b->plugin_words == nullptr && b->plugin_cu_h == nullptr);
|
||||
|
||||
/* Past the bound: the build fails rather than overrun the slab. */
|
||||
r3.plugin_words.assign(9, 0);
|
||||
p.reset();
|
||||
entry(3, &r3, true);
|
||||
CHECK(bb.build(p, f.kv, 2) == nullptr);
|
||||
bb.fini();
|
||||
}
|
||||
|
||||
/* A sequence that leaves a row and returns to it is restaged whole. Its change marks are taken
|
||||
* wherever it is written, so the old row's copy goes stale; restaging only later changes would
|
||||
* keep entries a rollback replaced earlier. The scheduler's own passes reorder rows, so this
|
||||
@@ -7101,12 +7205,12 @@ uint64_t scripted_steps(int64_t max_tok, int64_t interval, int64_t busy, int* n_
|
||||
/* Without a span the scheduler plans and stages the pinned steps: the fingerprints of a scripted
|
||||
* workload's every step (plan entries and RadBatch arrays) at budgets of one, two and four
|
||||
* intervals, with --busy-prefill-chunk auto, off and fixed, taken from the scheduler as it was
|
||||
* before --prefill-span. */
|
||||
* before --prefill-span with batch.cpp's two read-ahead chunks (k_ahead_chunks). */
|
||||
TEST(without_a_span_the_scheduler_plans_and_stages_the_pinned_steps) {
|
||||
struct Case { int64_t max_tok, interval, busy; uint64_t want; };
|
||||
const Case cases[] = {
|
||||
{ 256, 256, -1, 0x9b2fe92b1919355cull }, { 512, 256, -1, 0xdae73489249b5339ull }, { 1024, 256, -1, 0x44975a352e78619aull },
|
||||
{ 1024, 256, 0, 0x44975a352e78619aull }, { 1024, 256, 128, 0x3c0b9b1a1f864e4aull }, { 2048, 512, -1, 0xd6c184d0563159eeull },
|
||||
{ 256, 256, -1, 0x5a54a247b5ba614eull }, { 512, 256, -1, 0x82a560f95b47a8a1ull }, { 1024, 256, -1, 0x5336de4e63911e26ull },
|
||||
{ 1024, 256, 0, 0x5336de4e63911e26ull }, { 1024, 256, 128, 0xd14e26bf5be5aa5dull }, { 2048, 512, -1, 0x740799e030270f82ull },
|
||||
};
|
||||
for (const Case& c : cases) {
|
||||
int n = 0;
|
||||
|
||||
Reference in new issue
Block a user