Archived
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:
1 parent
6c11671bdd
commit
6df26315b9
25 files changed
+432
-82
No files matched your search
@@ -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"
|
||||
|
||||
+12
-1
@@ -60,7 +60,15 @@ struct VramFacts {
|
||||
int64_t capacity = 0; /* RadDeviceProps::vram_bytes -- totalGlobalMem */
|
||||
int64_t free = 0; /* RadDeviceProps::vram_free, measured now */
|
||||
int64_t arena = 0; /* arena_plan_bytes() for this rank's program, total incl. scratch */
|
||||
int64_t staging = 0; /* BatchBuilder::device_bytes(): the step slab and the media staging */
|
||||
int64_t staging = 0; /* BatchBuilder::device_bytes(): the step slab and the media staging,
|
||||
* and TierExec::device_bytes() when a KV tier is configured */
|
||||
/* THE HARDWARE QUEUES this rank creates after `free` was read -- its compute stream, the expert
|
||||
* mover's, and the second compute lane where the program declares one -- at `queue_bytes`
|
||||
* each. MEASURED, by making one: a queue's kernel-argument ring is the engine's, and the
|
||||
* driver backs every queue with VRAM of its own beside it (33 MiB a queue on an R9700, eight
|
||||
* times the ring). */
|
||||
int n_queues = 0;
|
||||
int64_t queue_bytes = 0;
|
||||
int64_t kv_ceiling = 0; /* KVManager::ceiling(max_ctx) for this rank's declared groups */
|
||||
int64_t kv_fixed = 0; /* KVManager::fixed_bytes(): the part of the ceiling that is state */
|
||||
/* weight_footprint() for this rank, which under tensor parallel is already this card's even
|
||||
@@ -78,6 +86,9 @@ struct VramFacts {
|
||||
* operator stated the budgets -- the placement report and the pool report both want the totals. */
|
||||
struct VramBudget {
|
||||
int64_t capacity = 0, already_held = 0, headroom = 0, arena = 0, staging = 0;
|
||||
int64_t queues = 0; /* n_queues * queue_bytes, from the rank that needs most */
|
||||
int n_queues = 0;
|
||||
int64_t queue_bytes = 0;
|
||||
int64_t claimable = 0; /* after the fixed terms above */
|
||||
int64_t statics = 0; /* off the top, before the ratio sees anything */
|
||||
int64_t elastic = 0; /* claimable - statics: what the ratio divides */
|
||||
|
||||
Reference in new issue
Block a user