Archived
radiance 1.12.0
New models: - Fish Audio drama-3: speech with speaker tags and inline direction, voices cloned from reference clips (the `references` field of /v1/audio/speech and the streaming session), two cards - Gemma 4 E2B/E4B (KV-shared layers, per-layer embeddings, clipped vision linears), with NVIDIA-Nemotron-3.5-Bolt-E4B in bf16 with DFlash and vision on one card, and E4B recipes Speed: - MXFP4 GEMMs for one to 64 rows and a tiled prefill GEMM at TN=4 from 1024 rows: the 27B MXFP4 with DFlash2 decodes about 1% faster at c1, 5% at c4 and 14% at c16 - The fp8 and int8 LM heads read their weight once for 65 to 128 rows - A prefill step of one sequence runs in two pieces on a second lane at two ranks (qwen35_fp8, gemma3): a 45K-token prompt on the 27B fp8 in 15.1 s instead of 16.2 s - Gemma 3's fused all-reduce junctions also under a lossy wire - --draft-short-from N: a block drafter runs its shorter block from N decoding sequences on (off by default; with 8 on the 27B MXFP4: c8 +12%, c16 +18%, c64 +32%, c1 unchanged) - --tp-attn-split rows: GLM-5.3-Flash's MLA attention split by rows over the ranks, 18 to 21% faster prefill; lossy, `heads` stays the default - --draft-coupling on: Qwen3.8-Flash-Next's MTP drafter samples its proposals from its reranked top-8 and the target's draw is coupled to it; pays at high temperatures (c1 at T 1.0: 155 -> 178 tok/s), costs at low ones; off by default Features: - Edited prompts on windowed models (Gemma 4) reuse their prefix: periodic window snapshots, and snapshot-backed prefix KV kept across recomputes (an edited tail on Gemma 4 31B: 96 s -> 2.6 s) - DELETE /sessions/<label> and DELETE /sessions?id=<id> forget one stored conversation - --state-cache-dtype f16: the delta-net state cache at half the memory (qwen35 plugins; lossy) Fixes: - A browser's CORS preflight allows DELETE Changes: Plugin ABI 27: out-of-tree plugins must be rebuilt. The environment switches the PRs added are flags now (--tp-attn-split, --draft-coupling, --state-cache-dtype).
This commit is contained in:
10 parents
4bca30369b
b1f4fccc52
d90e19dc15
3aded1bbf8
d912c694f3
824e238996
58142a6638
9322ea0b92
e9d03362f0
4d68a01a08
commit
5a9ce4912b
137 files changed
+12959
-1126
No files matched your search
@@ -150,6 +150,8 @@ HttpResponse Server::handle_sessions(const HttpRequest&) {
|
||||
o["snapshot_store"] = { { "bytes_each", c.ck_bytes }, { "slots", c.ck_slots } };
|
||||
/* Entries and snapshots removed by --prefix-cache-ttl, from whichever tier held them. */
|
||||
o["expired"] = { { "entries", sm.prefix_expired }, { "snapshots", sm.prefix_ckpt_expired } };
|
||||
/* And the ones a client gave up on purpose (DELETE /sessions). */
|
||||
o["released"] = { { "entries", sm.prefix_released }, { "snapshots", sm.prefix_ckpt_released } };
|
||||
/* Step-thread time spent on tier moves; every request waits through it. */
|
||||
o["stall"] = { { "restores", c.restores }, { "restore_ms", (double)c.restore_ns / 1e6 },
|
||||
{ "flushes", c.flushes }, { "flush_ms", (double)c.flush_ns / 1e6 } };
|
||||
@@ -179,6 +181,83 @@ HttpResponse Server::handle_sessions(const HttpRequest&) {
|
||||
return HttpResponse::json_body(200, json_dump(o));
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ DELETE /sessions
|
||||
*
|
||||
* A client that deletes a conversation, or replaces everything past a prefix of it, knows the
|
||||
* rest is dead before the TTL does. Named by the label it sent (`session_id`, or Anthropic's
|
||||
* `metadata.user_id`), or by the engine id `/sessions` shows. `keep_tokens` keeps the chain's
|
||||
* start. Shared blocks and blocks a live request reads stay; a request of the same conversation
|
||||
* in flight is a 409, since its close would publish the chain again. */
|
||||
HttpResponse Server::handle_session_release(const HttpRequest& req) {
|
||||
if (!deps_.sched)
|
||||
return error_response(err_not_implemented("the server has no engine attached"), req.peer);
|
||||
|
||||
const std::string label = req.param("label");
|
||||
uint64_t id = 0;
|
||||
const std::string id_s = req.param("id");
|
||||
if (!id_s.empty()) {
|
||||
if (id_s.find_first_not_of("0123456789") != std::string::npos || id_s.size() > 19)
|
||||
return error_response(err_bad("id", "expected the session's engine id, a decimal "
|
||||
"integer as /sessions reports it"), req.peer);
|
||||
id = std::stoull(id_s);
|
||||
if (id == 0) return error_response(err_bad("id", "0 names no session"), req.peer);
|
||||
}
|
||||
if (label.empty() && id == 0)
|
||||
return error_response(err_bad("label", "name the session: DELETE /sessions/<label>, "
|
||||
"?label=<label> or ?id=<engine id>"), req.peer);
|
||||
int64_t keep_tokens = 0;
|
||||
const std::string keep_s = req.param("keep_tokens");
|
||||
if (!keep_s.empty()) {
|
||||
if (keep_s.find_first_not_of("0123456789") != std::string::npos || keep_s.size() > 12)
|
||||
return error_response(err_bad("keep_tokens", "expected a non-negative integer: the "
|
||||
"prefix to keep, in tokens"), req.peer);
|
||||
keep_tokens = std::stoll(keep_s);
|
||||
}
|
||||
|
||||
SessionReleased r;
|
||||
const int rc = deps_.sched->release_session(label, id, keep_tokens, &r);
|
||||
if (rc == RAD_E_UNSUPPORTED)
|
||||
return error_response(err_not_implemented(
|
||||
"this engine has no prefix cache (started with --no-prefix-cache, or the model "
|
||||
"declares no cacheable KV group)"), req.peer);
|
||||
const std::string who = label.empty() ? "id " + std::to_string(id) : "'" + label + "'";
|
||||
if (rc == RAD_E_NOTFOUND) {
|
||||
ApiError e;
|
||||
e.status = 404;
|
||||
e.type = "not_found_error";
|
||||
e.param = label.empty() ? "id" : "label";
|
||||
e.message = "no stored session " + who + "; GET /sessions lists them";
|
||||
return error_response(e, req.peer);
|
||||
}
|
||||
if (rc == RAD_E_STATE) {
|
||||
ApiError e;
|
||||
e.status = 409;
|
||||
e.type = "conflict_error";
|
||||
e.code = "session_in_use";
|
||||
e.message = "a request of session " + who + " is queued or running; cancel it or wait "
|
||||
"for it to finish, then release again";
|
||||
return error_response(e, req.peer);
|
||||
}
|
||||
if (rc == RAD_E_INVAL)
|
||||
return error_response(err_bad("keep_tokens", rad_strerror(rc)), req.peer);
|
||||
if (rc < 0) return error_response(err_internal(rad_strerror(rc)), req.peer);
|
||||
|
||||
json o;
|
||||
if (!label.empty()) o["label"] = label;
|
||||
if (id != 0) o["id"] = id;
|
||||
o["keep_tokens"] = keep_tokens;
|
||||
o["sessions"] = r.sessions;
|
||||
o["entries"] = r.entries;
|
||||
o["tokens"] = r.tokens;
|
||||
o["device_bytes"] = r.device_bytes;
|
||||
o["host_bytes"] = r.host_bytes;
|
||||
o["snapshots"] = r.snapshots;
|
||||
o["kept"] = { { "tokens", r.kept_tokens }, { "shared", r.kept_shared },
|
||||
{ "live", r.kept_live } };
|
||||
metrics_.observe_http(200);
|
||||
return HttpResponse::json_body(200, json_dump(o));
|
||||
}
|
||||
|
||||
HttpResponse Server::handle_stats(const HttpRequest&) {
|
||||
json o;
|
||||
o["model"] = opt_.model_id;
|
||||
@@ -234,6 +313,8 @@ HttpResponse Server::handle_stats(const HttpRequest&) {
|
||||
o["ckpt_evictions"] = { { "retention", m.prefix_ckpt_retired },
|
||||
{ "store_full", m.prefix_ckpt_lru } };
|
||||
o["ckpt_refused"] = m.prefix_ckpt_refused;
|
||||
o["released"] = { { "entries", m.prefix_released },
|
||||
{ "snapshots", m.prefix_ckpt_released } };
|
||||
o["hit_cuts"] = { { "no_snapshot", m.hit_cut_no_snapshot },
|
||||
{ "windowed_group", m.hit_cut_window },
|
||||
{ "adopt_failed", m.hit_cut_adopt },
|
||||
|
||||
Reference in new issue
Block a user