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
@@ -13,6 +13,7 @@
|
||||
#pragma once
|
||||
#include <functional>
|
||||
#include "mem/prefix.h"
|
||||
#include "mem/seqwindow.h"
|
||||
#include "rad_core.h"
|
||||
#include "mm/processor.h"
|
||||
|
||||
@@ -153,6 +154,22 @@ struct IKVManager {
|
||||
* changed tail, must be the only caller. 0 is always correct (restage the whole table). */
|
||||
virtual int64_t take_table_changes(uint64_t seq, int32_t group) const = 0;
|
||||
|
||||
/* The batch builder's reads about (seq, group) in one call (SeqGroupView, mem/seqwindow.h).
|
||||
* The default composes the accessors above, so a manager that does not override it answers
|
||||
* identically; the concrete manager overrides it to find the sequence once. `take_changes`
|
||||
* additionally performs take_table_changes (batch build only, as there). */
|
||||
virtual void seq_group(uint64_t seq, int32_t group, bool take_changes,
|
||||
SeqGroupView* out) const {
|
||||
const std::vector<int32_t>& bt = block_table(seq, group);
|
||||
out->bt = bt.data();
|
||||
out->bt_n = bt.size();
|
||||
out->first = first_block_pos(seq, group);
|
||||
out->has_win = runtime_window(seq, group, &out->win);
|
||||
if (!out->has_win) out->win = SeqWindow{};
|
||||
out->state = state_slot(seq, group);
|
||||
out->changed_from = take_changes ? take_table_changes(seq, group) : 0;
|
||||
}
|
||||
|
||||
/* Whether the snapshot store still holds `slot`. The scheduler checks before building a
|
||||
* restore step, since a released slot may hold another session's state. */
|
||||
virtual bool checkpoint_held(int32_t slot) const = 0;
|
||||
@@ -320,6 +337,78 @@ struct KVGeom {
|
||||
if (bi < 0 || bi >= (int64_t)bt.size()) return -1;
|
||||
return (int32_t)(bt[(size_t)bi] * e.block_size + (pos % e.block_size));
|
||||
}
|
||||
|
||||
/* Steps until trunc(x / bs) next changes as x increases: the run over which a quotient (and
|
||||
* the matching C++ remainder, x - trunc(x/bs)*bs) stays affine. Truncation toward zero makes
|
||||
* the negative side differ from floor: the quotient of a negative x next changes one past a
|
||||
* multiple, not at it. */
|
||||
static int64_t trunc_steps(int64_t x, int64_t bs) {
|
||||
const int64_t q = x / bs;
|
||||
return (q >= 0 ? (q + 1) * bs : q * bs + 1) - x;
|
||||
}
|
||||
|
||||
/* slot() at n consecutive positions pos0, pos0+1, ..., identical values with one division a
|
||||
* segment instead of two a token. A segment ends where the block index or the in-block
|
||||
* offset would change rule (trunc_steps of (pos - first_pos) and of pos); inside it the slot
|
||||
* is (block base + off + k), or -1 throughout when the block index is outside the table.
|
||||
* bt is the table's data and length where slot() takes the vector. */
|
||||
void slots(int gi, const int32_t* bt, size_t bt_n, int64_t first_pos, int64_t pos0,
|
||||
int64_t n, int32_t* out) const {
|
||||
const int64_t bs = g[(size_t)gi].block_size;
|
||||
int64_t done = 0;
|
||||
while (done < n) {
|
||||
const int64_t pos = pos0 + done;
|
||||
const int64_t rel = pos - first_pos;
|
||||
const int64_t bi = rel / bs;
|
||||
int64_t len = trunc_steps(rel, bs);
|
||||
const int64_t lo = trunc_steps(pos, bs);
|
||||
if (lo < len) len = lo;
|
||||
if (len > n - done) len = n - done;
|
||||
if (bi < 0 || (size_t)bi >= bt_n) {
|
||||
for (int64_t k = 0; k < len; ++k) out[done + k] = -1;
|
||||
} else {
|
||||
const int64_t base = (int64_t)bt[(size_t)bi] * bs + pos % bs;
|
||||
for (int64_t k = 0; k < len; ++k) out[done + k] = (int32_t)(base + k);
|
||||
}
|
||||
done += len;
|
||||
}
|
||||
}
|
||||
|
||||
/* slot_ring() at n consecutive positions, the same treatment. Positions before ring_pos go
|
||||
* through slots(); in the ring the block index advances where (pos - ring_pos) crosses a
|
||||
* block multiple, wrapping modulo ring_blocks at those same points. A window with no ring
|
||||
* blocks cannot be armed (KVManager::set_window clamps the ring to at least one block and
|
||||
* slot_ring's modulo would be by zero), so it takes the plain mapping. */
|
||||
void slots_ring(int gi, const int32_t* bt, size_t bt_n, int64_t first_pos, int64_t pos0,
|
||||
int64_t n, const SeqWindow& w, int32_t* out) const {
|
||||
if (!w.set || w.ring_blocks <= 0) {
|
||||
slots(gi, bt, bt_n, first_pos, pos0, n, out);
|
||||
return;
|
||||
}
|
||||
const int64_t bs = g[(size_t)gi].block_size;
|
||||
int64_t done = 0;
|
||||
if (pos0 < w.ring_pos) {
|
||||
done = w.ring_pos - pos0 < n ? w.ring_pos - pos0 : n;
|
||||
slots(gi, bt, bt_n, first_pos, pos0, done, out);
|
||||
}
|
||||
const int64_t ring_bi0 = w.ring_pos / bs;
|
||||
while (done < n) {
|
||||
const int64_t pos = pos0 + done;
|
||||
const int64_t rp = pos - w.ring_pos;
|
||||
const int64_t bi = ring_bi0 + (rp / bs) % w.ring_blocks;
|
||||
int64_t len = trunc_steps(rp, bs);
|
||||
const int64_t lo = trunc_steps(pos, bs);
|
||||
if (lo < len) len = lo;
|
||||
if (len > n - done) len = n - done;
|
||||
if (bi < 0 || (size_t)bi >= bt_n) {
|
||||
for (int64_t k = 0; k < len; ++k) out[done + k] = -1;
|
||||
} else {
|
||||
const int64_t base = (int64_t)bt[(size_t)bi] * bs + pos % bs;
|
||||
for (int64_t k = 0; k < len; ++k) out[done + k] = (int32_t)(base + k);
|
||||
}
|
||||
done += len;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------ binding the concrete classes */
|
||||
@@ -387,6 +476,9 @@ struct KVBinding final : IKVManager {
|
||||
int64_t take_table_changes(uint64_t s, int32_t g) const override {
|
||||
return m->take_table_changes(s, g);
|
||||
}
|
||||
void seq_group(uint64_t s, int32_t g, bool take, SeqGroupView* o) const override {
|
||||
m->seq_group(s, g, take, o);
|
||||
}
|
||||
bool checkpoint_held(int32_t slot) const override { return m->checkpoint_held(slot); }
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user