radiance 1.0.6

- A text prompt to /v1/completions reads the model's control tokens as tokens, as vLLM and
  llama.cpp do. A client that renders its own chat template can send "<|im_start|>user ..." and
  the model sees the turn markers; they used to reach it as plain text. /tokenize and
  /v1/embeddings read a text prompt the same way, and a prompt that already opens with BOS gets
  no second one.
- The VRAM budget counts the engine's own hardware queues, which the driver backs with about
  33 MiB of VRAM each, and the KV tiers' copy staging. Both used to come out of
  --gpu-headroom-mib: Qwen3.8-Flash-Next ran with 9 MiB free under load against the 96 MiB it
  asked to keep, the room a kernel's first launch allocates from. The startup receipt has a
  "hardware queues" line.
- Running the whole model on the CPU (RADIANCE_HOST_DOMAIN=1 with no GPU visible) no longer
  repeats words or answers differently at temperature 0. A decode step could read its input
  token before the copy that delivers it had landed.
- The README says to clone the repository before installing.
This commit is contained in:
Deadcode committed 2026-10-04 20:07:08 +02:00
1 parent 6c11671bdd
commit 6df26315b9
25 files changed
+432 -82

No files matched your search

+15 -4
View File
@@ -49,6 +49,11 @@ int vram_budget_resolve(Config& cfg, const std::vector<VramFacts>& per_rank, Vra
freeb = std::min(freeb, f.free);
b.arena = std::max(b.arena, f.arena);
b.staging = std::max(b.staging, f.staging);
if ((int64_t)f.n_queues * f.queue_bytes > b.queues) {
b.queues = (int64_t)f.n_queues * f.queue_bytes;
b.n_queues = f.n_queues;
b.queue_bytes = f.queue_bytes;
}
b.kv_ceiling = std::max(b.kv_ceiling, f.kv_ceiling);
b.kv_fixed = std::max(b.kv_fixed, f.kv_fixed);
b.statics = std::max(b.statics, f.statics);
@@ -83,7 +88,7 @@ int vram_budget_resolve(Config& cfg, const std::vector<VramFacts>& per_rank, Vra
b.derived_kv = want_kv;
/* What is left after the terms nobody gets to spend. */
int64_t fixed = b.already_held + b.headroom + b.arena + b.staging;
int64_t fixed = b.already_held + b.headroom + b.arena + b.staging + b.queues;
if (!want_w) fixed += cfg.vram_weights_mib * kMiB; /* a stated pool is fixed too */
if (!want_kv) fixed += cfg.vram_kv_mib * kMiB;
b.claimable = b.capacity - fixed;
@@ -95,7 +100,8 @@ int vram_budget_resolve(Config& cfg, const std::vector<VramFacts>& per_rank, Vra
" already held %10s (driver context, code objects, anything else on the card)\n"
" --gpu-headroom-mib %10s\n"
" activation arena %10s (buffer plan + kernel scratch)\n"
" step staging %10s (block tables + media staging)\n"
" step staging %10s (block tables, media and KV tier staging)\n"
" hardware queues %10s (%d at %s each, measured)\n"
"%s%s"
" ------------------------------\n"
" SHORT BY %10s\n"
@@ -103,6 +109,7 @@ int vram_budget_resolve(Config& cfg, const std::vector<VramFacts>& per_rank, Vra
"or free the card.\n",
humanb(b.capacity).c_str(), humanb(b.already_held).c_str(),
humanb(b.headroom).c_str(), humanb(b.arena).c_str(), humanb(b.staging).c_str(),
humanb(b.queues).c_str(), b.n_queues, humanb(b.queue_bytes).c_str(),
want_w ? "" : fmt(" --vram-weights-mib %10s (stated)\n",
humanb(cfg.vram_weights_mib * kMiB).c_str()).c_str(),
want_kv ? "" : fmt(" --vram-kv-mib %10s (stated)\n",
@@ -252,14 +259,17 @@ int vram_budget_resolve(Config& cfg, const std::vector<VramFacts>& per_rank, Vra
* line is not padding: to_mib truncates, and what it drops is real VRAM that ends up beside
* the headroom. */
const int64_t granted = cfg.vram_weights_mib * kMiB + cfg.vram_kv_mib * kMiB;
const int64_t unclaimed = b.capacity - b.already_held - b.arena - b.staging - b.stage - granted;
const int64_t unclaimed = b.capacity - b.already_held - b.arena - b.staging - b.queues - b.stage -
granted;
const double ela = b.elastic > 0 ? (double)b.elastic : 1.0;
b.report = fmt(
"VRAM budget, per card:\n"
" card total %10s\n"
" already held %10s measured: driver context, code objects, anything else resident\n"
" activation arena %10s computed from the buffer plan\n"
" step staging %10s the step batch's block tables and media staging\n"
" step staging %10s the step batch's block tables and media staging, and the\n"
" KV tiers' copy staging\n"
" hardware queues %10s %d a card at %s each, measured: the engine's streams\n"
" %-18s %10s %s\n"
" ------------------------------\n"
" claimable %10s\n"
@@ -277,6 +287,7 @@ int vram_budget_resolve(Config& cfg, const std::vector<VramFacts>& per_rank, Vra
" could not place\n",
humanb(b.capacity).c_str(), humanb(b.already_held).c_str(), humanb(b.arena).c_str(),
humanb(b.staging).c_str(),
humanb(b.queues).c_str(), b.n_queues, humanb(b.queue_bytes).c_str(),
shared ? "left to the host" : "--gpu-headroom-mib", humanb(b.headroom).c_str(),
shared ? "integrated graphics: this memory is the host's; --vram-kv-mib states a pool "
"outright"