radiance 1.3.0

- #47: llama-server's request fields, routes and sampler order, and /props (with baKon's model
  entry: max_model_len, root and capabilities on /v1/models, and /v1/models/:id)
- new APIs: Anthropic's Messages API (/v1/messages), OpenAI's Responses API (/v1/responses),
  llama-server's /completion and /infill, logprobs (OpenAI's logprobs and top_logprobs, up to
  20; llama-server's n_probs), OpenAI's legacy `functions`, and X-Api-Key beside the bearer key
- #4: --model takes a Hugging Face repo id (owner/name), fetched before startup into
  ~/.cache/radiance/hf or --download-dir and checked for changes at every start (redxherring)
- #46: --tp 3 --tp-wire wht6 serves -- a three-rank two-shot all-reduce with uneven shards and
  the tiered-int8 wire over it (baKon); scripts/cardclock.py names what holds each card's clock
  under load (baKon)
- CPU-only serving works again; --kernels names the kernel libraries to load; a model the
  loaded libraries cannot fully serve refuses at startup instead of failing its first request;
  --vram-kv-mib and --vram-weights-mib are gone (the split is automatic)
- --embedding-placement ram is the default, and `auto` is gone
- #40: Swift 1.5 recipes; rad-convert reads which shard holds a tensor from the index
- #53: the pinned host pool gets huge pages where shmem THP is off; #57: a crash on video with
  an odd frame width is fixed
This commit is contained in:
Deadcode committed 2026-10-08 18:22:08 +02:00
1 parent 6a2ee986d6
commit 89cee7ce41
107 files changed
+6849 -1091

No files matched your search

+27 -5
View File
@@ -948,6 +948,7 @@ int Scheduler::admit_one(SchedReq& s, int64_t budget) {
r.state = ReqState::Running;
s.running = true;
server::sink_admitted(r.sink);
server::sink_prompt_progress(r.sink, r.n_computed, (int32_t)r.prompt.size(), r.n_cached);
s.sched_tokens = (int32_t)want;
s.pending_ckpt = ckpt;
++m_.admitted;
@@ -1587,6 +1588,10 @@ int Scheduler::commit(const StepResult& res) {
bool eos = res.eos && res.eos[i] && !r.ignore_eos;
bool overflowed = false;
/* A token whose logprobs the engine could not compute (TokenLogprobs::token -1) for a
* request that asked for them: the request fails with the reason rather than send that
* token without the numbers it was asked for, and nothing after it is sent. */
bool lp_failed = false;
/* THE SNAPSHOT THE ENGINE JUST TOOK IS NOW READABLE. Marking it here rather than at
* reservation is the difference between a checkpoint and a promise: reserve_checkpoint
@@ -1602,6 +1607,8 @@ int Scheduler::commit(const StepResult& res) {
if (e.is_prefill) {
r.n_computed += e.n_tokens;
step_prefill_tok_ += e.n_tokens;
server::sink_prompt_progress(r.sink, r.n_computed, (int32_t)r.prompt.size(),
r.n_cached);
/* Once, when the prompt is fully placed: the admission accounting the usage block
* reports. `n_cached` is what the prefix cache supplied and is not recomputed here. */
if (r.n_computed >= (int64_t)r.prompt.size())
@@ -1613,7 +1620,11 @@ int Scheduler::commit(const StepResult& res) {
} else if (e.produces_token && res.token) {
if (!s.first_tok_us) s.first_tok_us = mono_us();
r.output.push_back(res.token[i]);
overflowed = !server::sink_push(r.sink, res.token[i]);
const TokenLogprobs* lp =
res.lp && res.first_row[i] >= 0 && r.sp.n_probs >= 0
? &res.lp[res.first_row[i]] : nullptr;
if (lp && lp->token < 0) lp_failed = true;
else overflowed = !server::sink_push(r.sink, res.token[i], lp);
/* The conv window absorbed this chunk; the cursor advances by one committed
* position, exactly as it does in decode. */
s.conv_cursor = (int32_t)((s.conv_cursor + 1) % (W ? W : 1));
@@ -1661,15 +1672,21 @@ int Scheduler::commit(const StepResult& res) {
/* AND THE CONTEXT BOUNDS IT WHATEVER max_tokens SAYS, including "no limit": a
* sequence may not grow past the positions this deployment can address. */
if (ctx_limit_ > 0 && ctx_limit_ - s.seq_len() < room) room = ctx_limit_ - s.seq_len();
auto emit = [&](int32_t t) {
/* `j` is the token's place in the step's emission: its logprobs row is the entry's
* j-th, when the request asked for them. */
auto emit = [&](int32_t t, int32_t j) {
if (room <= 0) return;
--room;
if (!s.first_tok_us) s.first_tok_us = mono_us();
r.output.push_back(t);
if (!server::sink_push(r.sink, t)) overflowed = true;
const TokenLogprobs* lp =
res.lp && res.first_row[i] >= 0 && r.sp.n_probs >= 0
? &res.lp[res.first_row[i] + j] : nullptr;
if (lp_failed || (lp && lp->token < 0)) { lp_failed = true; return; }
if (!server::sink_push(r.sink, t, lp)) overflowed = true;
};
for (int32_t j = 0; j < a; ++j) emit(s.draft[j]);
if (res.token) emit(res.token[i]);
for (int32_t j = 0; j < a; ++j) emit(s.draft[j], j);
if (res.token) emit(res.token[i], a);
r.n_computed = valid;
step_decode_tok_ += 1 + a;
@@ -1719,6 +1736,11 @@ int Scheduler::commit(const StepResult& res) {
close_request(s, ReqState::Failed, "sink_overflow", carried);
++m_.failed;
completed_.push_back(r.id);
} else if (lp_failed) {
close_request(s, ReqState::Failed, "logprobs", carried, true, RAD_E_STATE,
"the logprobs of a token it generated could not be computed");
++m_.failed;
completed_.push_back(r.id);
} else if (server::sink_cancelled(r.sink)) {
/* The client hung up. Spec §14: the blocks go back now rather than at the end of a
* generation nobody will read. */