Archived
5e2e596644e3b11b0cc9f9cdca3f40d696ea29f4
70
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0ff61a19a2 |
sched: the preemption gate credits only what the recompute adopts
The gate that admits a preempted request back subtracted the raw attention prefix hit from every paged group's need. Admission does not adopt that deep: under checkpoints the linear layers replay from the last checkpoint whatever the attention matched, so the adopted prefix is clamped to the linear hit, exact mode floors it to its chunk grid, and one token always stays outside for the logits. Every block of that difference was a block the recompute would really need and the gate pretended was free: the request is admitted against a loan it cannot repay, the next ensure preempts it again -- the exact loop the gate's own comment describes. The gate now runs the plain count first, which passes without touching the cache at all when the pools plainly hold the recompute, and consults the hash-chain lookup -- request-length CPU, under mu_, per waiting slot per round -- only when the credit decides, crediting the clamped, floored, capped depth admission actually adopts. Under-crediting delays a re-admission by a round; over-crediting, which is what this was, loops. |
||
|
|
b44f7a9bb1 |
sched: an over-cap request would stall every queue behind it
A plugin that declared plugin_words gets a fixed carrier in the batch -- [max_seqs * plugin_words] rows, carved only because the program said how many words a sequence may carry. The build stage already refuses a sequence past that bound, but nothing at admission did, and a refused build restages its step forever: one request carrying more words than the plugin declared stalls every queue behind it, permanently. add_locked now reads the same bound the batch carves by (BatchBuilder:: plugin_words_cap, the program's declaration) and refuses an over-cap request with RAD_E_INVAL, where the server turns it into a clean 400. The current route caps its own words already; this is the promise no future route can miss, checked once at the gate every request passes. |
||
|
|
2a2b756371 |
radiance 2.1.0
New models. Recursive Flint (39.8B, about 2.5B active) by everplays (#422): `arch/flint`, as an IQ8R container with rotated int8 experts or a four-bit one, with a sink-aware WMMA prefill attention and the fused attention prologue at `rotary_dim` 0. Meta Muse Glimmer 30B by launch80_assets (#423): bf16, an int4 trunk or IQ8R, its windowed vision tower, its DFlash drafter, the ATEM tool dialect and context extension. Ling-3.0-tiny by RikshaDriver (#441): served from its GGUF releases or as IQ8R on `bailing_hybrid`, with six more libr3d kernels. Block FP8, MXFP4 and NVFP4 conversions of the three are not served. IQ8R containers of all three (round to nearest, no calibration) are on Hugging Face under StillDeadcode: flint-iq8r, muse-glimmer-30b-iq8r-dflash and ling-3.0-tiny-iq8r. They were checked for sane answers on two R9700; nothing was benchmarked, and Muse Glimmer's pictures, video and tool calls were not tried. Speech. Breeze-TTS-2 clones a voice from a reference recording and its transcript, with an optional delivery direction, by farcryjohn (#436). The published Breeze container needs converting again with the updated recipe before it can. Tools. A model entry with `diagnose: DIR` runs a fixed workload on the engine instead of serving and writes a report: step times, tokens a step, draft acceptance, TTFT and prefill rates by category, concurrency and prompt length, and with `diagnose-baseline` a token-for-token comparison against an earlier report (docs/DIAGNOSE.md), by Code000 (#418). Scheduler. `mixed-step-target-ms` holds a mixed prefill and decode step to a service time, off by default, by tnhnyzc (#413). `scheduler.stuck-exit` (60s by default, 0 never) ends the process when the device has advanced nothing for that long, so a restart policy brings a hung server back (#409, #415, #428). Fixed. Draft trees with the int8 KV cache, which stopped Gemma 4 31B with DFlash2 on its first request (#454, diagnosed by aelfwyne). The expert loan held at zero by a few leftover cache blocks after long sessions (#455, diagnosed by thekk1). The mapped tier's pages kept in the page cache across a load and a restore, by C_Tamas (#421). Replayed tool calls with blank arguments, and arguments that are not JSON refused naming the call, by dschmitz (#444). The dashboard's card temperature reads the junction sensor, by dschmitz (#453). The VRAM shortfall report says what the KL mode needs, by baKon (#448). The out-of-tree plugin test builds its plugins in parallel and takes its toolchain from the tree. Plugin ABI 40: out-of-tree plugins need to be rebuilt. Thanks to @everplays, @launch80_assets, @RikshaDriver, @farcryjohn, @Code000, @tnhnyzc, @C_Tamas, @dschmitz, @baKon, @aelfwyne and @thekk1. |
||
|
|
ddcb9c69bb |
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. |
||
|
|
c00b882b96 |
scheduler: --prefill-interleave auto:SHARE sets the decode-only share of a chunk step's time
auto gave decode-only steps a fixed quarter of a chunk step's time. On the device (8 decoding sessions beside 64K prefills, MTP on) that left decode at 23 tokens/s a session against 83 alone, with 0.45 s gaps: two or three decode steps of ~40 ms per 0.45 s chunk. auto:SHARE makes the share a choice (0 < SHARE <= 4); auto stays 0.25. The cap on decode-only steps rises from 16 to 64 so a larger share is not cut off. config_test parses it, sched_test checks auto:1. |
||
|
|
f87d03d304 |
scheduler: --prefill-interleave auto sizes the decode-only steps from measured step times
Cause: while prompts prefill, a sequence that is already decoding gets one token group per step that carries a chunk. On Qwen3.8-Flash-Next at TP2 such a step takes a 2048-token chunk's time (~0.4 s, more on the device under load), so decoders crawl at a few tokens/s until the queue of prompts drains. --prefill-interleave N inserts N decode-only steps after each chunk, but a fixed N costs the prefill whatever N decode steps cost, which grows with the number of decoders, and is too few where decode steps are cheap. Change: --prefill-interleave auto (default stays 0). After a chunk that ran beside decoding sequences with its prompt continuing, as many decode-only steps follow as fit in a quarter of a chunk step's time at a decode step's (running means of both, fed by step_finished from the step wall times; at most 16; 1 until a decode step has been timed; 0 where a decode step costs more than that quarter). The prefill gives up at most a fifth of its rate however many sequences decode. The hold mechanics (no admission while held, steps issued ahead count, the stager not armed for a held chunk) are --prefill-interleave N's, unchanged. Under auto which steps carry a chunk follows the device's timing; a number keeps a reproducible schedule. A chunk's cut and every row's computation are unchanged. Evidence: sched_test interleave_auto_* (the count from given costs, the step shapes it produces, nothing held for a lone prefill or when decode steps are too dear); config_test parses auto. Host simulation of the scheduler (next commit), 32 x 128K prompts sent at once, 512 tokens each, MTP 3, step costs fitted to a lone 2048-token prefill and to decode alone: decode of the sequences decoding while prompts wait 6.5 -> 31 tokens/s each, last first token 826 -> 875 s (+6 %), TTFT p50 453 -> 480 s; fixed N=2 gives 18 tokens/s at the same cost. Device numbers: the commit that makes auto:1 the served default. |
||
|
|
b632c72f5d |
sched: an overdue preempted prefill keeps its place ahead of the queue
A preempted request waiting for its whole-recompute gate (kAdmitWait) let the admission walk ask the next request in the queue. For an overdue one that undoes the overdue path: the room it made in this step went to a request queued behind it. With preempted prompts published, the victim forced off for it needs almost nothing to come back, so it was re-admitted at once and forced off again on the next step. Under KV pressure the same victim was forced off and re-admitted 26 times in 16 s while the overdue request waited. An overdue preempted request that is still refused now stops the walk, as a refused fresh request already does. 2x R9700, Qwen3.8-Flash-Next TP2, production flags with the KV cache cut to 6.45 GiB a card (--gpu-headroom-mib 3072), 16 concurrent 58.6k-token prompts with 4000-token answers: - without publishing preempted prompts: wall 390.6 s, mean 338.5 s, 9 preemptions, 1 forced - publishing them: wall 346.4 / 344.1 s, mean 306.6 / 299.8 s, 36 / 32 preemptions, 28 / 26 forced - publishing them, with this change: wall 331.0 / 324.4 s, mean 289.4 / 284.0 s, 8 / 9 preemptions, 1 / 1 forced Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
12b7b7889b |
sched: an overdue preempted prefill is failed only when waiting cannot help
On an idle engine the overdue path failed a preempted prefill on any refusal. A restore waiting a step for a deferred release is a wait, and so is a refusal behind requests this step already admitted (the budget or a card went to them); both clear by the next step. With preempted prompts published, the restore path is common: under KV pressure two of ten preempted requests failed with "overdue preempted prefill could not be admitted with nothing running", the debug log showing "the restore waits a step for 1 deferred release(s)" right before. The path now fails only when nothing was admitted this step and the refusal is not such a wait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
01c7a3334a |
sched: a preempted request publishes its prefix; the recompute adopts it
Scheduler::preempt_back dropped everything a request had computed: unlike close_request it published nothing, so a preempted 96.6k-token prompt was computed again from its first token. The publish block of close_request is now Scheduler::publish_prefix, called by both. Its blocks stay in the cache, so a preemption that published gives eviction its rounds back (the decode ensure loop and the overdue path) and the cache gives them back, the newest last, before another request is preempted. preempted_can_prefill counts the blocks the recompute adopts from the cache (pc_->lookup), so a preempted request is not held back for room its own cached prompt already covers. Shared KV with RADIANCE_KV_GUARANTEE=1 (nine Qwen requests preempted for TranslateGemma's start pool): Qwen 587 -> 458 s, TranslateGemma 139 -> 80 s; without the guarantee unchanged (340 / 58 vs 339 / 56). Test: a_preempted_request_publishes_its_prefix; sched 187, engine_e2e and the related suites pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
da7b911c64 |
abi, sched: placeholder runs read both ways
An encoder states that the language model reads a picture's or video frame's placeholders both ways (RadEncoderDecl::bidirectional). The scheduler then ends no prefill chunk inside such a run, and a trunk pass names its runs and the keys their rows see (RadBatch::n_bidi). Fields appended; such a pass is not recorded. |
||
|
|
c96cfc9e7b | test: verify DSpark device KV rollback | ||
|
|
e53286cdbe |
dashboard: the history figures mean what their labels say
Five changes to one leg, committed together because they are one claim: a number on the dashboard should be readable as the thing it is named for. They were deployed as 1.15.1-histfix without being committed, so the running engine carried code no commit described, and a review of the working tree could not see its own context. History labels. "avg" becomes "mean", the window figures appear only once enough rows exist to be the window they name, ttft says median, and every history column carries a title= spelling out what it averages and over what. A legend that has to be inferred from a column header gets inferred wrong. The prefill instrument. The history computed prefill speed as prompt tokens over time-to-first-token, which charges queue wait to prefill; GUIDE:2808 warns against exactly that formula. The scheduler now stamps admission and reports prefill_s, so the column measures admission to first token. The page falls back to ttft when an engine reports no admission time, so it still works against a stock build. Windows in seconds. Every displayed window was a sample count, so "60s" meant 60 samples and its span drifted with the poll rate: 60s at 500 ms, 6s at 100 ms. The rings now prune by accumulated time and the sparkline's x axis is time-proportional rather than sample index, so a busy stretch gets the room its seconds deserve and a gap in the samples shows as a gap in the line. This is the precondition for the interval control below; at a fixed rate the two agree, so a full ring draws exactly as before. The interval control. An Advanced view with two editable fields, idle and busy, held in localStorage: the cadence belongs to whoever is reading, not to what is serving, and the server has no writable config that would survive an image swap. Both are plain numbers rather than a mode switch, because the point is that the reader sets the rate; equal values are one fixed rate and the summary says so. Wind-down. The tile detail lines now sample on every poll, so "recent" follows the engine's own idle decay instead of holding the last figure it saw, and a window older than its own span is cleared rather than drawn as if continuous. Fixes from an independent review on qwen, which found the first two: admitted_us was never reset when a slot was recycled. add_locked only allocates when the slot's pointer is null, so the struct survives release_locked with every field it does not list intact, and the first-admission guard then kept the previous request's stamp. The interval spans two requests, the stale stamp is always older, so prefill tok/s reads low rather than missing. It reaches every row once the slot pool turns over. It feeds only this one dashboard column: the engine-wide prefill tile uses an independent windowed counter, and no admission, eviction, preemption or KV path reads the field. Two tooltips still said prefill includes queue wait after the instrument stopped charging it. Both now say what the code does and disclose the fallback, since one window can mix rows measured from admission with rows fallen back to ttft. Verified: both targets build clean. dashboard_test 241 checks over 8 cases, sched_test 62644 over 184, no failures. The new sched_test case drives submit, finish, reap and a second submit onto the recycled slot and asserts prefill_s never exceeds ttft_s, since admission cannot precede arrival; it fails against the bug and passes after the fix, so it can fail. The embedded page parses under node --check, and 30 checks now execute the shipped spark(), the clamp and the cadence trigger sliced out of the page rather than restated: time-proportional spacing, the right-edge fill at startup, a sample gap drawn as a line gap, the 100 ms floor, and the old storage key migrating to a flat rate. Not tested: the controls' behavior in a real browser, and how the session extreme should read when it outlives a cleared window. Found in review by an independent qwen workstream; the slot-reuse finding was confirmed by a second adversarial pass and against the source independently. Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (level not visible) via Open WebUI |
||
|
|
1c967b2f14 |
sched+engine: keep a scored request's size from reaching the pinned pool
A scored request asks the engine for the logits of chosen candidate ids at its prompt's last position (Request::token_scores). Three places where that readout's memory was someone else's decision: The candidate list was bounded by value, never by count, and the count is what a scored step pays for: the step stages the union of every staged request's candidates as hidden and table rows in one pinned host buffer, before anything is admitted or accounted. One request naming a million ids -- any caller of the raw request seam -- is a multi-gigabyte pinned allocation the box either loses or dies on. add_locked caps the list at 4096, orders above what a decision request names (its prompt's written answers, a few dozen), and says so in the refusal. And when the pinned allocation is lost anyway -- the cap bounds one request's rows, not the batch's union, and the pool can be low for reasons of its own -- stage_scored_rows returned E_NOMEM into the step loop's fail path: the whole engine stopped, every connection with it. It cancels the scored requests instead, on the step loop's existing deferred-cancel vector the sampler's grammar failures already use: a request whose scores the box cannot hold is that request's failure. No alloc-failure seam exists to test the branch directly; its cancel path is the sampler stage's, applied at the same join. And declare_scores now refuses a head table shorter than the vocabulary: the scored readout indexes it by token id, the scheduler bounds candidate ids by meta.n_vocab, and a table a few thousand rows short turns the last block of the vocabulary into a read off the end of a weight -- a device fault, not a refusal. Padding past the vocabulary reads fine and stays fine. sched_test: a_scored_request_names_at_most_the_candidate_cap. build_test: declare_scores_wants_a_table_that_covers_the_vocabulary. ASan+UBSan: sched/build/server/systemone/config/diag, 6/6. |
||
|
|
9560780bfa |
sched: a preempted prefill reclaims cache and leaked state slots before it waits
The whole-recompute gate refused a preempted request forever when the pool held only cache entries, and an empty running set left a leaked state slot unreclaimed. Reclaim the cache over several rounds, release idle state slots when nothing is running, and admit the overdue waiter if it can ever fit. A prefill is never a victim while a decoder is running; tests cover the deadlock, the leaked slot, and the lost KV sequence. |
||
|
|
9ed3ef7a7b |
radiance 1.15.0
New models and formats: - IQR for Qwen3.8-27B: weights on the int8 grid under GPTQ, a trellis down each GPTQ column (IQR-V2), and IQR-V3, a computed trellis code under one scale a row, kept at its codes' width in VRAM and decoded in the GEMM; 15 IQR-V3 recipes from ~2 to ~7 bits a weight (data/recipes/q38-27b-*-v3.recipe, docs/IQR.md) - libhalo: a kernel library for Strix Halo (gfx1151), preferred there over libr3d - Nemotron 3.5 Embed 1B and 8B (nemotron35_embed): text and image embeddings through a Pixtral tower, on the card and on the CPU - Nemotron 3.5 Rerank 8B - /v1/systemone: Cloudflare's clef and clef-flash, Convai Innovations' Laya and Mica beside LiquidAI d1; scored steps read the candidates' logits from the head table with no lm_head pass - LFM2's 8-bit trunk: block-fp8 or int8 linears with the fused producers, and the d1-3B recipe - DeepSeek-V4.1's reply format with DSML tool calls and typed argument tags Weights on the drive: - The file tier reads only the experts the pass routes rows to; the draft head's weights stay in the host pool - A hot VRAM cache for routed experts read off the drive, reads deposited straight into free host pool slots, and copyless evictions; the file tier's counters are now ssd_* - GLM-5 Next shards its routed experts by expert, not by width, so they can live on the drive - The stall watch counts drive reads as progress, and the DMA lane's room check reads the lane's own completion fence Quantisation tooling: - --calib-corpus, --calib-dir and --calib-layers record each linear's input Hessian; beside --kld-record the reference's own run records them - --kld-top N records a sparse KL reference (the N most likely tokens and the tail's mass) - GPTQ in a third of the time with the same codes, trellis GPTQ on the card, vector codebooks with coordinate descent, and rad-convert --reuse repeated, each container supplying what the earlier ones lack Speculation: - Prompt lookup alone (--spec-ngram K, --spec-ngram-min/-max): each sequence keeps an index of its n-grams, and a proposal is verified only when its measured step cost says it pays; --draft-window adaptive follows it Speed: - IQR decode: the narrow tile splits K for four times the int8 tile's waves and folds each 128-K block once; at 8 tokens down and the output projections run in 0.61-0.82x and 0.70-0.92x FP8's time (2-6 bits); IQ6R-S-V3 with its DFlash2 drafter steps in 26.3 ms at TP2, against 29.4 ms before and FP8's 27.3 - Qwen MXFP4 feed-forward: the gated fold up to 16 rows, not 8 - libr4d: the gated prefill fold, the short-prompt split row, and the rows forms of rmsnorm and rope; KLATE again for the head-256 gqa6 paged prefill; gram_accum on the matrix cores Features: - /health, /v1/health and /ping answer 503 with "status": "stuck" once the device has advanced nothing for a minute or a queue has faulted, so a supervisor can restart a wedged server (#356) - --image-gen-max-pixels and --image-gen-max-refs size an image generator's buffers (#344) - The startup report lists only the options not at their default, with a count; -v lists all (#250) - --preempt-wait-ms bounds how long a preempted prefill waits for its whole-recompute room - --placement layer_offload spills dense layers so one --max-model-len sequence fits - Startup refuses amdgpu with CWSR off and says how to fix it; --proceed-with-incompatible-configuration starts anyway under an UNSUPPORTED banner Fixes: - The n-gram read-ahead hands each row to the reader once and reads only as far ahead as the row cache holds, and pauses while decode reads: about one drive read a row instead of two (#355) - A file-tier window reads each of its runs once, not once a run per run - The decode split law's verify floor is bounded by the batch's workgroups: max_seqs 256 no longer declares 64x the scratch (#342) - A prefetch DMA list's mark stays out of the signal pool until the engine has read it, and a prefill stage copies only the blocks its own tables name (#343) - The split-KV row sum is read with fetch-inactive (#328) - LFM2 on the host backend: libref and libavx serve the row-form ops it declares (#348) - The preempted-prefill gate skips a KV group that holds no blocks (#352) - Every request entry point bounded, gated and sanitised (JSON depth, invalid UTF-8, control bytes in the log, the dashboard's CSP, cross-origin browsers on the loopback-only routes); a prompt id outside the vocabulary refused at admission; --api-key "" refused at startup - The telemetry the HTTP thread reads is atomic - An RMS norm row no longer depends on how many rows its launch carries; prefill attention's rescale is decided by live rows only - A --kld-record prefill chunk that finishes no sequence gets its logits on a tied-head model - A kernel's lazily made counter block is zeroed outside the lock other ranks take (a TP2 first-step hang) Changes: Plugin ABI 32. Every plugin exports a layout fingerprint of the ABI structs and the loader refuses a plugin without it or with another (#302), so out-of-tree plugins must be rebuilt. Appended: RadBuildCtx calib_* and gen_max_*, RadArchProbe gen_max_*, RadBatch score_only and plugin_words, RadDeviceProps::unified, RadChatFormat arg_json_value_prefix. |
||
|
|
d773992abc |
[FIX] restore the prompt vocabulary check, the empty --api-key refusal and scored steps' issue-ahead rule
|
||
|
|
8df9240d65 |
sched: the preempted-prefill gate skips a KV group that holds no blocks
Every program carries a sentinel KV group at index 0. KVGeom reads its decl.kind 0 as RAD_KV_FULL with block size 1, while the manager's plan for it pages nothing and owns no block. The gate ( |
||
|
|
94c90b17ad | nemotron 3.5 implementation | ||
|
|
33108e488b | sched: a bound on the preempted-prefill gate's wait | ||
|
|
ed1e5caf9d |
core, abi: scored steps -- rad_declare_scores, RadBatch::score_only, and /v1/systemone's model
A scored request (Request::token_scores, what /v1/systemone asks: the raw logits at a few candidate ids) does not need the half-gigabyte lm_head read the sampler would consume. A plugin whose head is the bf16 embedding table declares the final-normed hidden rows and that table (rad_declare_scores); on a step whose sampled rows are all scored rows and whose program declared both, the core sets RadBatch::score_only, the plugin issues everything but the head, and the core reads the hidden rows and the candidates' table rows back and takes the dot products in f64 on the host. RadBatch gains one trailing int32 (score_only, 360), which the pass key mixes; an older plugin never sees it set. The scheduler issues no step ahead of one that brings a scored row to max_tokens: that forward pass reads nothing and a max_tokens=1 question would pay a decode step after its prefill. Scored rows only -- every other decode keeps the step of overlap it had. /v1/systemone reports which model answered. Co-Authored-By: Pi <pi@localhost> |
||
|
|
a28221eb6a |
sched: refuse a prompt id that names no vocabulary row
The scored-prompt path (Request::token_scores) has always vetted its ids against the
vocabulary; the prompt itself never was. Raw id arrays arrive at admission verbatim from
the request body -- /v1/completions, /v1/embeddings and the generator take them -- and an
id past the embedding table is gathered by the step, fails it, and a failed step is a
device fault (spec 17): one request, {"prompt":[2147483647]}, ended every session on the
server. The check belongs at admission, where a refusal is a 400, not mid-pass, where it
is an exit.
The sched fixture's model declares 512 vocabulary rows and its requests spell prompts
from 1000 up; admission now refuses those, so the fixture's vocabulary moves above the
ids it uses.
|
||
|
|
187a015bda | sched: tighten preempt gate headroom and test pool | ||
|
|
e668d493d9 | sched: gate preempted prefill on whole recompute plus running headroom | ||
|
|
4a61d7296b |
radiance 1.14.0
New models and formats: - libr3d: a kernel library for RDNA3 (gfx11) cards - nomic-embed-text-v2-moe (the nomicbert plugin) - Gemma 4 E2B with its per-layer MLP width, and Google's unmodified E2B/E4B directories in bf16 - DeepSeek-V4.1-Flash converted straight from its release: the Engram tables, the fused imatrix and rad-convert --chat-template for a release that ships no template - GGUF Q8_0, Q4_K and Q6_K tensors import as their planes; rad-convert writes them without a recipe - Qwen3.8-Flash-Next-FP8 converts and serves through qwen4exp_fp8 Speed: - hc_read's decode kernels as one grid (34.7 -> 25.2 us at 4 rows) and its tiled up-mix pipelined - gemm_fp8a8: the narrow form's scales staged through LDS (Flash-Next int8 at 32 rows 83.6 -> 68.3 us), the gated three-tile form at 8 waves (gate_up at 48 rows 272.9 -> 180.6 us) - Qwen3.8-27B: the delta net's out-projection read beside its decode recurrent update (x1 19.40 -> 19.10 ms a step), and the verify's split-KV attention sized by context depth (x3 at 180K 42.4 -> 40.3 ms a step) - Hy-Memory (HYV3) decode: fused QK norm, RoPE and KV store, residual adds folded into the norms, coalesced one-token expert GEMMs - spechub: the coupled verify walks the live candidates only (151 -> 31 us a launch) Speculation: - DFlash2: lossless coupled acceptance at T > 0 (--draft-coupling on) - A block drafter's proposals verified as a tree, on by default for the Gemma 4 31B's DFlash2, with a block-16 tree that runs its short block under load Features: - Decode-hot residency: --draft-expert-placement host, --expert-profile, --expert-pin-top, and --expert-stats FILE for the routed experts each layer selects - --ngram-placement ram=DIR: one n-gram table shared by engines on separate cards - Prefix cache: --prefix-resume exact (default) resumes a hit on the cold run's own chunk grid, so it answers bit-identically; snapshots at a head other prompts share, from 528-token prompts, and for tip-only one drafter window below the tip; hits on models whose KV groups have different block sizes; the snapshot store keeps a floor of 8 ahead of --host-headroom-mib - Typed tool-call argument tags; rad-chatparse --request renders and reads back one request as the server does - MiniMax-H3: keyframes ride a latent upscale - Gemma 3's fused all-reduce junction on the lossy wire Fixes: - A speculative step shorter than its band (an MTP step of 4 rows at gqa 8) no longer stops the engine with a scratch refusal at issue (#293) - --p2p off: prefill back to 1.12.0's rate; 1.13.0's push check read a host-memory slot over the link twice (#323) - A chat template that cannot render a conversation is refused at load, not mid-request - imatrix entries found under llama.cpp's spelling; the W4A8 prefill's tail scale read; the GDN conv kernels on an f32 weight; dense integer rows at the group they compute (a Q8_0 weight at group 32) - --expert-profile refuses a profile recorded on another model - hc_read's one-grid wait traps past its deadline instead of reading a stale value Changes: Plugin ABI 31, unchanged. RADIANCE_DRAFT_TREE, DFLASH2_TREE_NODES, DFLASH2_TREE_TEMP and DFLASH_Q_TEMP are gone (trees run where the probe says they pay; temperatures 1.25 / 0.6). |
||
|
|
662b7720b5 |
core/sched: a prefix hit resumes on the cold run's chunk grid, so it recomputes the cold run's own chunks
A hit recomputes the tokens past where it resumes. Kernels may round a row differently at another chunk length (spec §17: the fp8 GEMM's split-K count is chosen from M), so a hit that recomputes its tail in other chunks than a cold prefill of the same prompt can flip a near-tie in greedy text. On the DeepSeek-V4.1 daily (TP4) a 24k-token prompt that hit a 16k one's tail snapshot resumed at 15856, ran a 528-token chunk to the next boundary and answered differently from its cold run. --prefix-resume exact, the default: - ChunkGeometry carries the grid an idle server's cold prefill chunks on: --max-num-batched-tokens rounded down to the quantum, or the checkpoint interval where chunks split at it and it is the smaller, times the span from the second interval on. - plan_chunk writes checkpoints only on that grid. A prompt's tail snapshot is taken where its last chunk starts (sliding-window snapshots keep their one-block margin) instead of at its last quantum boundary. The chunk already ends there, so a long cold prompt no longer runs a short extra step at its end. - A checkpoint interval past the chunk must be a multiple of it; otherwise it is rounded up, and startup says so. - admit_one steps a hit with no snapshot to resume from (full attention) back to the grid. A request's own checkpoint (Request::checkpoint_at, /v1/systemone's shared head) is honored where it falls. --prefix-resume nearest keeps the previous rule. The cost is re-prefill: an exact repeat runs the cold run's last chunk again, and an agent's next turn resumes where the previous prompt's last chunk started, about half a chunk more than nearest (2048 tokens at a 4096-token budget). The property holds on an idle server; a prefill that shares its steps with decode rows or other requests (--busy-prefill-chunk, --prefill-interleave) is cut differently, as batching already changes greedy text. Tests: sched_test covers the grid for six geometries (GDN hybrid, interval past the budget, span, periodic and tip-only window snapshots, full attention), the interval rounding, the tail snapshot at the last chunk start, admission stepping back to the grid, and a property over prompt lengths: every checkpoint is a chunk start of the cold run of its prompt and of any longer prompt it prefixes, and a hit from it cuts the cold run's chunks. config_test covers the flag. |
||
|
|
f43929ccb8 |
core/mem, core/sched: a prefix hit on a model whose KV groups have different block sizes, and a hybrid's window in the checkpoint slot
DeepSeek-V4.1 declares its compressed attention at one KV row per r tokens: kv_index_r2 and
kv_compressed_r2 at 2-token blocks, kv_index_r1 and kv_compressed_r1 at 1-token blocks, beside a
16-token sliding window (kv_window), a linear compressor state (kv_comp_tail_r2) and a conv window
(kv_engram_tokens). On that model no request ever reused a token, for two reasons:
- PrefixCache::configure took the first full group's block size as its granularity and left every
paged group with another block size out ("block 1 != cache granularity 2: not cached").
- KVManager put a trunk's window in the checkpoint slot only on a model without linear state, and
the scheduler refuses a hit that leaves a trunk group uncovered. With linear state beside the
window, every hit was zeroed (HitCut::Window).
Either alone leaves the hit at zero. On an agent's growing conversation that is the whole context
prefilled again every turn.
The cache now holds every paged group but a windowed one. An entry covers the lcm of their block
sizes and holds lcm / B blocks of a group with B-token blocks (PrefixCache::entry_groups,
blocks_per_entry). A lookup hands each group its own blocks for adopt(); insert, eviction, trim,
rebind, restore_room, release_session and unshared_tokens count per block; trim() and trim_for()
count entries. The chunk quantum is already a multiple of every paged group's block, so
checkpoints and hits stay on the entry grid. With equal block sizes an entry is one block a group,
as before.
A trunk's window rides in the checkpoint slot whether or not linear state is beside it; the slot is
the state, then the window pages, the layout KVManager::checkpoint_copy already walked. The
scheduler lets a hit stand on a windowed trunk group when it resumes at a window snapshot
(win_hit no longer needs a model without linear state); any other trunk group the cache does not
hold refuses the hit, as before. The reserve's trim asks for entries, from the group furthest
short. The idle tiers move an entry as its blocks: TierExec and the slot layout take
entry_groups(), where a group appears once for each block it holds in an entry, and the VRAM
estimate counts the same.
No plugin on main has a window beside linear state or paged groups of different block sizes, so
every model here keeps its cache and slot as they were. DeepSeek-V4.1 (#266) has both; its slot
grows by the window's pages (10 blocks of kv_window, 6.25 MiB a rank at TP4).
Tests: mem_test -- an entry at the lcm over block sizes 2/1, 2/4 and 16/2 (lookup blocks, adopt,
refcounts, eviction and trim in entries, restore_room, unshared_tokens), a publish short of one
group's blocks refused and unwound, checkpoints on the entry grid (and the binding's key), an
interval off the grid refused, a hybrid with a window and mixed blocks, an entry over mixed block
sizes through the host tier byte for byte (one to three ranks, replicated beside zero), and a
checkpoint carrying linear state and the window together; the window-snapshot rule's test now
expects the window beside linear state. sched_test -- a hit on a hybrid whose slot carries the
window resumes at the snapshot, a trunk group neither cached nor in the slot refuses the hit, a
hit over mixed block sizes adopts each group's own blocks, and the reserve trim asks for entries.
|
||
|
|
74e701ea17 |
prefix cache: a snapshot at a head other prompts share
A model with snapshots (recurrent state, or a sliding window the cache does not index) resumes a hit only at a snapshot, and those are taken on the checkpoint interval and at each prompt's tail. A head every request starts with -- the same system prompt or instructions in front of a different text, as a translation service sends its pieces -- is usually shorter than an interval, and each tail is its own, so the head was computed again by every request. The cache now counts the blocks published right after each block (Entry::n_children) and reports where a lookup leaves a head that at least two cached prompts already left differently (CacheHit::branch_at; one is not enough, the next prompt could be the same conversation going on). When nothing resumes within kSharedHeadMin (256) tokens of that point, admission sets the request's own checkpoint there (Request::checkpoint_at, which n > 1 already uses), and the requests after it skip the head. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
6645337f69 |
radiance 1.13.0
New models: - Tencent Hy-Memory (HYV3) from its BF16, FP8 and GGUF checkpoints, with its native tool calls - M2XFP4: metadata-augmented MXFP4 weights for Qwen3.8-27B and its DFlash2 drafter (top-1 89.1% -> 92.4% against plain MXFP4), its quantiser and recipe, and ParoQuant's M2XFP4 checkpoints - Gemma 4 E2B/E4B audio input; NVIDIA-Nemotron-3.5-Bolt-E4B in int8 and 4-bit, on two cards by default; Ornith-1.5-122B compose files Speed: - Weight reads beside the decode all-reduces (qwen35_fp8, gemma3; --weight-prefetch, on by default): the 27B MXFP4 with DFlash2 61.2 -> 67.9 tok/s at c1, TranslateGemma 27B +13% - Head-256 split-KV decode attention at 256 workgroups and without bank conflicts (27B: +3-5% a step at 25-41K context), and the prefill KV split for small launches (a short turn over a long context decodes the other sequences 27% faster in that step) - MXFP4 decode gate_up, activation and fp8 quantiser in one launch (27B, Gemma 3 up to 64 rows: TranslateGemma +2-5% at 2-8 streams) - ParoQuant int4/int5 tiled GEMMs 6-9% faster - Speculation: a step's tokens are sent before the drafter's passes end, no step waits behind one that ends its requests, and the MTP head's first draft no longer collapses after short chats in the prefix cache Features: - --kv-resident N: KV streaming for a context bigger than VRAM (qwen4exp_fp8, GLM-5.3) - MiniMax-H3: reference media and keyframe conditioning with the VAE encoders - Krea 2 rebalance presets balanced, detail and subtle - The dashboard's request history; a stall watch that reports a frozen step's thread and stack - rad-tune at the served configuration, collectives measured as the exchange; Gemma 4 E2B/E4B's per-layer embeddings read ahead off the step path - A GPTQ calibration tap and recipe for Gemma 4 31B's w4a8 container Fixes: - The two-rank all-reduce checks that a peer's push has landed before reducing it - z-lab's DFlash drafter on Gemma 4 31B keeps drafting after a prefix-cache hit - MiniMax-H3's modulation rows Changes: Plugin ABI 31: out-of-tree plugins must be rebuilt. RADIANCE_PREFETCH_BESIDE is --weight-prefetch now; RADIANCE_NO_HUGE_PAGES, RADIANCE_IDS_EARLY, RADIANCE_ATTN_BAND_SPLIT, R4D_PREFILL_SPLITS, RAD_PLE_TIMING and RAD_PLE_CACHE_ROWS are gone. |
||
|
|
66c86b9f89 |
speculation: a group the window snapshot restores is no hole in a drafter's KV after a prefix hit
On Gemma 4 (sliding layers the prefix cache does not index, no linear state) a hit resumes the trunk's window from a window snapshot. The check for a hole in a block drafter's own KV after a hit counted every paged group the prefix cache does not index, the trunk's windowed one included, so it found a hole the snapshot fills. z-lab's DFlash drafter keeps a full-attention cache, which the prefix cache indexes; with that false hole its floor sat at the hit, and with no window to slide it was declined for the rest of every turn after a hit (on the 31B: 1.00 tokens a step on those turns, 4.25 with this). The scheduler now counts a group the snapshot restores (IKVManager::window_snapshot, the KV manager's KVGroupPlan::win_snap) as no hole, and the startup line says how many: `draft floor: 3 paged group(s), 2 prefix-cached, 1 in the window snapshot -> a hit leaves no hole`. A drafter's own windowed group is not in the snapshot, so DFlash2 and every model with linear state are unchanged. Tests: sched_test (a full-attention drafter drafts at once after a hit the window snapshot resumes, and with the trunk's window counted as a hole never drafts again that turn; the fixture gains a full-attention trunk). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
bf6c019571 |
engine: stream a step's tokens before the drafter's passes behind it end
Since 1.11.0 a block drafter's context and query passes (DFlash, DFlash2), like a serial drafter's rounds (MTP), are queued behind the step before its readback, and the host waited for all of them before it read the sampled ids. The ids' copy was already issued ahead of the passes, but the commit that streams the tokens came only after the passes had run: every token, the first one included, reached the client a drafter's passes late. The copy now has an event of its own (tok_end_). collect_step waits on it, the commit streams the tokens while the card runs the passes, and the step loop waits for the step's end (step_end_) right after the commit, before finish_*_drafter reads the slots and before anything else is issued. The commit issues no device work, so whatever it releases is in use only by the passes that wait covers, and the next work that could reuse it is issued after the wait. KL mode and embedding programs keep the old wait; RADIANCE_IDS_EARLY=0 restores it, for an A/B. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
f55570e351 |
sched: no step issued ahead behind a step that ends every request it carries
A pipelined engine issues each step's successor before the step is read back: block drafters (DFlash, DFlash2) since 1.11.0, serial MTP and decoding without a drafter since 1.0.0. The step that emits a request's last token therefore had one more step queued behind it, for a request its commit then finishes. That step verifies nothing, yet the card runs its whole forward pass and the drafter's context pass behind it, and a request that arrives once the last token is out -- a single-stream client's next turn, sent as the reply ends -- waits for all of it before its prefill starts. On Qwen3.8-27B ParoQuant int5 with DFlash2 on one R9700 that is about one decode step (34-53 ms) of TTFT on every back-to-back request (#225: 105 -> 139 ms); for 127 requests 1.12.0 ran 806 decode steps, all issued ahead, against 1.8.1's 680. Scheduler::step_next_locked, beside the other rules for issuing ahead and before the next step's KV is reserved, now issues nothing when the step just issued ends every request it carries: when it can bring each to its max_tokens (certainly with the token it emits, possibly with the drafts it verifies: output + 1 + drafts >= max_tokens), or, most likely, when those drafts hold an end-of-generation id (ignore_eos requests excepted). The engine hands the scheduler the end-of-generation ids at start (set_eog), the sorted list the card's acceptance reads. A guess that misses (a drafted end the verify rejects, too few drafts accepted to reach max_tokens) costs one step built after the commit instead of before it. Ends it does not predict still leave one step behind: an end the verify chose itself, a stop string, the context limit. Without a drafter only max_tokens ends are caught, exactly. At -v the commit names each request that ended with a step issued ahead behind it (finish reason, its last step's tokens and accepted drafts, output against max_tokens, whether its drafts held an end). Tests: sched_test pins both halves (a drafted end issues and reserves nothing; a request whose next token is its last, or whose token and accepted drafts could reach max_tokens, issues nothing; an ignore_eos request's drafted end, drafts without an end, and a request that every draft accepted would leave a token short still issue ahead; of two requests one going on, both issue ahead); the test of a request finishing under a step issued ahead now ends it on an end of text the scheduler cannot see coming. engine_e2e_test: two 32-token replies without a drafter are 62 decode steps, all issued ahead, not 64. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
a9e627b7ca | engine: the KV plan split, the host mirror, and --kv-resident bring-up | ||
|
|
5a9ce4912b |
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). |
||
|
|
d6957e88a1 |
sched: skip periodic window snapshots under tip-only
Treat tip-only as a true opt-out from periodic window snapshot creation and interval chunk splits, while retaining the existing tail snapshot and explicit request checkpoints. Leave recurrent-state scheduling unchanged and report the effective chunk bound accurately. Cover geometric-backoff and keep-all interval behavior, tip-only chunk planning and single-snapshot reservation, aligned and short prompts, explicit checkpoints, and recurrent-state scheduling. |
||
|
|
192fe10278 |
sched: checkpoint sliding windows at prefill intervals
Keep intermediate window snapshots as well as the prompt-tail snapshot so a tail edit can resume below its divergence instead of re-prefilling the entire matched prefix. Reuse the existing checkpoint retention policy and preserve the pre-template-divergence tail boundary. Add scheduler and cache regression tests for interval snapshots, aligned prompt tails, constrained chunk budgets, and edited-prefix lookup. Update the geometry report and guide to describe periodic window snapshots. |
||
|
|
da52bc8593 |
review fixes of the block drafter's short block (independent review)
- declare_drafter: a block drafter's proposal_pitch, now the row pitch the engine reads row s at, defaults to depth (it defaulted to 1, which a pitch-reading engine would take as packed rows: wrong drafts from the second sequence and a read past the readback) and is refused under depth. The engine's fallback goes. - run_block_drafter: hysteresis -- the short block goes on at --draft-short-from decoding sequences and off only two below, so a load wavering at the threshold does not switch the block (a new pass shape, the adaptive estimates) every step. Comment: the proposals are for the next step. - block_begin's comment: after a long block a short one's reservation stops short of the trunk step's end; the rejected rows past it land on freed pages with slot -1, which every kv_store drops. Named as the load-bearing rule it is. - The --draft-short-from warning names a serial head as such; the arch_test stub returns the real builder's codes. - build_test: the pitch's default and refusal. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
90e14c5015 |
block drafter: a short block chosen per step by load (--draft-short-from N)
A block drafter proposes its block whole, so the block's length is paid for every drafting sequence whatever each verifies. At one sequence a long block pays: Qwen3.8-27B + DFlash2 (block 8, --draft-window adaptive) decodes one stream 135 -> 155-165 t/s against block 4. At sixteen it does not: block 8 750-790 t/s, block 4 900, its drafter rows and weaker first positions costing more than the extra drafts bring. --draft-window adaptive alone cannot help, since it only shortens what each sequence verifies. - rad_drafter_short_block(b, block): additive export (RAD_ABI_VERSION unchanged); the plugin declares that its query pass also runs at `block` rows a sequence. Builder validates it (block drafter, shorter than its own, still proposes). - --draft-short-from N (default 0 = never): the engine stages the short block once N sequences decoded in the step just run (Scheduler::decoded_seqs). - The engine reads the proposals at the drafter's declared row pitch, not at the step's count: dflash_select writes row s at s * pitch, and a short block fills only a row's front (with the pitch read as the count, every sequence but the first got the wrong tokens). - Dflash2: a short block of 4 rows (depth 3) wherever its own is longer: its own convolution and selector ops at that block (every other op is per row); the query pass picks by T / n_seq and fails the step on a block it has no ops for. qwen35_fp8 and gemma3 declare it. - Tests: build_test (the declaration's checks), arch_test (the qwen35 family's short query pass runs the short ops, a block without ops fails the step; the DFlash2 pin moves), config_test. Measured (Qwen, speculation 7 adaptive, short block from 4 sequences, against production's speculation 3 fixed): one stream +15-20 % (kratky) / +9 % (syslog), 4 streams +3 %, 16 streams equal (915 / 906 t/s). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
9eaf10da6e |
radiance 1.11.0
New models: - GLM-5.3-Flash reads pictures: its vision tower and processor (--image-tokens sets the budget), with decode kernels for a few rows and the DSA indexer split over the ranks - Sage-A1.5 (fp8 and MXFP4) with its vision tower and a DFlash2 drafter - Unlimited-OCR (bf16) - Gemma 4 31B with z-lab's DFlash and RedHatAI's DFlash2 drafters; at four cards its all-reduces are fused with the junctions, overlapped with the compute and sent compressed - Ornith-1.5-35B-A3B w4a8 compose files Speed: - Block drafters (DFlash, DFlash2) accept their drafts on the card, and the next step is issued ahead - The four-rank all-reduce is faster for every --tp 4 model - qwen35_w8a8: the norms and SiLU write the int8 linears' operands directly - --attn-prefill-fp8 off|qk|pv|both: fp8 QK and PV legs for the h256 prefill attention (about +20% prefill on a 221K-token prompt for the 27B MXFP4 at TP2); lossy, off by default Features: - Control vectors: --control-vector off|on|disabled (disabled by default), a per-request switch, and the published Qwen3.8-Flash-Next refusal-direction vector (its license is in NOTICE) - Krea 2: the `rebalance` request field, as ComfyUI's ConditioningKrea2Rebalance - Cards with a small PCI BAR run, with kernel arguments kept in host memory - Dashboard: live acceptance figures; statsdump rotates its file at a size cap - KV caches every rank holds whole (GLM-5.3's latent and index caches) take one host-tier slot Fixes: - Long conversations taking turns no longer fall back to an early snapshot: a host-tier restore makes room as memory pressure does and waits a step for the previous turn's release (two conversations of 142K and 147K tokens sent back to back: 31.3 s per turn before, 2.8 s now) - Kernels before Linux 6.16 (amdgpu below 3.64) no longer hang at startup: virtual memory management is turned off there, with a warning - Gemma 4 dense scales its token embeddings as Hugging Face does (bf16), which changes its output - The four-rank all-reduce fences prefill-sized messages, for a rare divergence after a fresh start - GLM-5.3: every refusal names the setting and the reason; its template keeps string content - Several pictures in one request no longer refuse processors that take one image at a time Changes: Plugin ABI 26: out-of-tree plugins must be rebuilt. The environment switches the PRs added are fixed rules or flags now (R4D_ATTN_FP8 is --attn-prefill-fp8). |
||
|
|
d912c694f3 |
feat(sampler): port linear MTP coupling and cooperative verify upstream
Port GitHub PRs #12 and #13 onto Codeberg upstream main, retaining upstream kernel-chain handling. Include the source Clang target-attribute fixes required by the host build; omit the KFD header workaround and unrelated fork work. Co-Authored-By: Claude Code <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai> |
||
|
|
3aded1bbf8 |
server: DELETE /sessions forgets one stored conversation
A client that deleted a conversation, or compacted it past a prefix, knows the
rest is dead before --prefix-cache-ttl does. DELETE /sessions/<label> (or
?label=, ?id=<engine id>) walks the session's chain from the tip inwards like
expiry: VRAM blocks to the pool, the host copy with them, the session's
snapshots to the store. ?keep_tokens=N keeps the chain's start in whole blocks.
Blocks another stored session shares (the system prompt) and blocks a live
request reads stay and are counted apart; the row is cut at the deepest block
that stayed, so a later release reaches it. A request of the same conversation
in flight is 409. IScheduler::release_session beside reset_prefix_cache,
PrefixCache::release_session over the tiers' session table (find_sessions,
shared_prefix_blocks, cut_session). Counters released{entries,snapshots} on
/sessions and /stats, prefix_cache_released_total{what} on /metrics.
|
||
|
|
4be0a34791 |
kv tiers: a restore makes room the way pressure does, and a chain the pool cannot hold stops at a snapshot
A restore reserved only from the free list. The reserve's trim leaves a quarter of the pool free
after every publish, so a returning conversation larger than that came back as far as the free
list reached, and the lookup stopped at the first block still on the host. On GLM-5.3-Flash at
eight ranks, two conversations of 314K tokens in a 446,832-token pool: the second turn of the
first brought back exactly the 27,930 free blocks, hit 111,772 tokens, and on its hybrid state
resumed at the snapshot at 1,024, since geometric backoff keeps nothing between 1,024 and 131,072.
Its prefill took 84 s instead of under one.
PCBinding::restore_plan now makes room before the engine plans the restore, the same way
PCBinding::evict does for an admission: PrefixCache::trim_for drops entries whose host copy has
landed, the engine lands pending copies (flush_fn), and it drops again. It never erases one,
spares the restoring chain itself and every chain a waiting request holds, and like trim never
touches one a running sequence reads. The free quarter may go; the reserve's trim after the next
publish frees it again. One block table serves every rank, so the room rank 0's cache makes is
room on every rank, as with evict.
When the pool still cannot hold the chain, PrefixCache::restorable_from cuts it at the deepest
valid snapshot the shorter prefix reaches, so no block comes back past the point the hit resumes
from; without recurrent state it cuts where the room ends. TierExec::issue_restore keeps its own
cut as the backstop.
Both cuts are counted: radiance:prefix_restore_cuts_total for restores the pool could not hold
whole (/sessions moved.restore_cuts), and radiance:prefix_hit_cuts_total{reason="resumed_below"}
for admissions that resumed more than one checkpoint interval below their attention hit, which
hit_cut_tokens alone did not tell apart from many small tails (/stats and /sessions hit_cuts).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
cb5a69ac3f |
engine: a block drafter on the card's acceptance -- its passes queued behind the step, the next step issued ahead
A block drafter (DFlash) ran its two passes after the commit, staged from the committed sequence: the verify, a host wait and the commit, the context and query passes, a second host wait for the proposals, then the next step's build and issue, with the cards idle through each host turn and the ranks starting every pass at different times. Pipelining was off for block drafters. It now takes the serial drafters' path (sched/advance.h). After the trunk's ranks join, the acceptance runs on every rank (ADV_ACCEPT). block_begin runs before the commit (on_card): the context pass mirrors the trunk step, whose positions the host knows (a row issued ahead continued from the committed end, as commit() reads it); the query block's rows are device rows staged at the furthest anchor acceptance could leave, with the KV reservation that far, and ADV_BLOCK puts the anchor (the token the verify chose) and the masks at the card's committed end. After the query pass, ADV_BTAKE takes the proposals into each StepSlot behind the anchor, which is the token row the next verify reads (ADV_TRUNK), so issue_ahead verifies them with no host round trip. The slots come back with the step's one readback; finish_block_drafter checks the card's acceptance against the host's, as the serial driver does, publishes the proposals and moves the drafter's filled range. RADIANCE_DRAFT_BLOCK_HOST=1 keeps the host's driver, for the A/B, and has a row in GUIDE.md's environment table. On libref with the tiny 31B-shaped checkpoint (and one doctored so its drafter is right part of the time) the two drivers give the same replies, the same draft acceptance and the same sampled text, and greedy matches plain decoding. sched_test runs 24 pipelined steps against the host's driver: the same trunk steps and the same context and query passes, positions, lengths and slots (the context pass's token ids aside, which that pass does not read); advance_test covers the two modes and the chain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
859efc7208 |
review: apply the Unlimited-OCR code-review findings
The 2a1ca01..f308216 range's 45 review findings (12 performance, 33 quality) are applied: ABI 23 for the RadBatch append, the fused q|k|v projection, the batched patch-embed GEMM and pitched layout copies, the sam_attn w-dot hoist with an alignment-gated vector row path and NaN poisoning for malformed segments, the fused quick_gelu act, and the R-SWA/scheduler/drafting gates. Quality items: stale comments corrected, env reads hoisted, the ngram_window negative refusal, the parts-form chat template instruction, the whitelist fallback warning, and the segmented R-SWA refusal of the fixed/runtime window mix. The 3.2 MB generated resample header becomes a 9.6 MB little-endian blob (tests/data/golden/uocr_resample_golden.bin) read by a small loader; resample_golden.py emits and round-trip-verifies it. One perf-med item (AVX2 bicubic passes/LUT patch staging in the processor) is left as the follow-up the review itself recommends; the code says why. Verified: ninja -C build-review -k 0; host ctest 89/89; GPU r4d_selftest 0 failures, kbench/kbench_moe and the card tests pass. |
||
|
|
fad4ba7f1a |
unlimitedocr: the DeepEncoder tower, R-SWA ring KV and the n-gram ban
DeepEncoder (arch/common/rad_block_sam.h): the checkpoint's SAM ViT-B/16, neck and CLIP ViT-L/14 producing its 16x17+1 row layout, with a new `sam_attn` op for the windowed, zero-padded SAM attention and its decomposed relative-position bias (libref oracle, libavx kernel, libr4d kernel and selftest). The plugin declares the tower when the container records `radiance.encoder`, and splices its rows over the placeholders after embed_lookup. BOS: the chat path adds BOS when the rendered template does not already start with it. This checkpoint's template is a bare concatenation and its tokenizer states add_bos_token, so without it every position was off by one and the det boxes came out wrong. A media run's placeholders shift with it. R-SWA: RAD_KV_RING, paged like a window group but with a per-sequence floor armed at admission. adv_groups now computes the same clamped seqused and modulo ring slots the builder stages; the mismatch read the block table's -1 padding and faulted the card. Prefill stays causal; prefix cache, checkpoints and speculation are off for the group. Sampling: sample_ngram_ban in libref/libavx/libr4d and the host chain, the request knobs, and the container's generation config (35 over 128). Processor: the checkpoint's grid/mode selection, its tall-last tie order, Pillow's bicubic pass order, and goldens generated from its own code. Tools: --mm-max-patches auto-detection accepts a tower stated as per-width tables under vision_config.image_size, and rad-convert records radiance.encoder. Verified: tower stages match the checkpoint's code (rows cos 0.9998), the device sam_attn selftest is within tolerance, the R-SWA device repro returns text, a GPU e2e reproduces the reference's first det block, and the host suite is 88/89 (known webp decode baseline). |
||
|
|
685ec5bd85 |
radiance 1.9.0
New models: - LTX-2.5 (base and distilled): video with a stereo soundtrack from text or from text and a first frame, on one card, with its duration head, tiled VAE decoding, the diffusion decoder and the x2 latent upsampler - Krea 2 Raw and Turbo, and FLUX.3 [klein] and its base: text to image, and for FLUX.3 edits from up to ten reference pictures, on one card - GLM-5.3-Flash from AMD's Quark MXFP4 export, on eight cards (John McDonough, Nunze) - Gemma 3 / TranslateGemma 27B with an optional DFlash2 drafter (mici81) Engine: - --kv-cache-dtype fp8_v4 and k6_v4 for Gemma 3 and Qwen3.8-Flash-Next (mici81) - the rotated int8 trunk (i8a8h) for Qwen3.8-27B (eddie168168) - eight-rank all-reduce bands, weighted shards and pieces (Nunze); --host-headroom-mib (sfjes) - the dashboard shows the single-stream decode floor and its most recent window (Memoria) Fixes: prefix-cache reservations kept until their save lands (baKon), tool calls in Responses namespaces (#119), system messages merged when a template refuses several (#137), a prefill continued with no open step (#127), calibration of a Gram accumulation (#122), JSON Schema patterns read unanchored (davetha), GLM-style tool calls, the KV floor counting every sequence's state. Plugin ABI 24. |
||
|
|
ed2da8c9da |
sched: record the fastest single-sequence decode step, for the dashboard to read
The dashboard's restart advice needs a reference the degraded engine is read against. Asking a human to type a ruler is fragile (a stale or mistyped number silently mis-advises) and cannot see steps taken while the dashboard tab is closed. The engine sees every step and knows the concurrency of the exact step it just timed (plan_.n_seq_decode), so it can keep the reference itself. Records two figures over single-sequence decode steps: the floor (the fastest window mean this process has measured) and the current (the most recent window mean). Both are window means of one stream at one size, so the advisory compares like with like. A min, not a max: drift only raises the CURRENT step, so the reference a degraded engine is read against is its own demonstrated floor. Single-sequence on purpose -- a decode step at eight sequences is a different measurement, so keying the floor to one row keeps a batch arriving from being misread as drift. A mixed step is excluded by the phase gate even when it carries one decode row: that row shared the step with a prefill chunk an order of magnitude dearer. Why not a raw min over step brackets: step timing is host-side, and with pipelining on the next forward pass is issued behind the current step's commit. Behind a step with long host work -- a prefill chunk, or a decode step that saves a KV checkpoint -- the decode pass is finished before its own bracket opens, so the bracket holds readback and commit and no GPU work. It is a real step advancing a real token, so no token-count or predecessor-phase guard catches it. A raw min latches that degenerate on the first occurrence and never recovers: measured live 2026-10-18 on a TP2 R9700 lane, 1.16 ms against a 15.55 ms mean on the first request after bringup. Why averaging alone is not enough: these degenerate brackets are not rare. At the observed ~1.4% rate a min over hundreds of windows reliably lands on a degenerate-heavy window, and the floor sits ~10% below the true floor -- still phantom drift, because the engine can never reach a floor that was an artifact. So a candidate is rejected BEFORE it enters a window when it is under half the running mean of accepted steps: degenerate brackets sit at ~9% of a real step and real single-sequence steps at ~96%, so the populations are ~10x apart and any threshold between them separates them -- 0.5 is the midpoint of that gap, not a value tuned to one distribution. Filtering at the step level is essential; at this rate a degenerate dilutes inside a 32-step window to ~0.91x, which no window-level threshold would catch. The first window is recorded by neither figure. The rejection gate needs a window's worth of accepted samples before it can judge one, so the first window is un-gated by construction; recording it lets the floor latch an unreachable value forever (measured: a 5% degenerate rate put the floor ~2% low through bootstrap alone). The cost is one window -- about a second of single-stream decode -- against a 46 s bringup and a 10 s repaint, so it is never observed. The estimator is a small struct (rad::DecodeFloor) so it is testable on a synthetic stream: the scheduler fixture runs steps in microseconds and cannot manufacture a degenerate bracket, which is why the first round of tests missed this. The tests feed streams laced with degenerate-short samples, assert a raw min latches them, assert the estimator rejects them and tracks the true floor, and assert the rejection does not eat real steps. Emitted on /stats as step_ns_decode_best and step_ns_decode_recent (0 until the first gated window completes). Trailing zero-defaulted fields on both SchedMetrics structs plus the adapter copy -- neither struct is ABI-pinned (scheduler<->server internal), so this is the sanctioned append. Matches the kv_tokens_max running-extremum precedent. Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (xhigh) via Open WebUI (cherry picked from commit bf5a803deaa08ae0c2d94e2c3dda0d518c08d9aa) |
||
|
|
1e968f6e1d |
radiance 1.7.0
- every model serves without a GPU: libavx covers every op, so `--kernels libavx` alone serves every shipped container - Qwen3-ASR (zivius): speech to text on /v1/audio/transcriptions and live over /v1/realtime - /v1/messages works with Claude Code as it ships (gearwave00001) - a long agent conversation keeps its cached history when the client rewrites its last turn (manueloverride) - a stream's first event goes out with the first token, so llama-benchy measures prefill right - opt-in --prefill-interleave (Smellyyyy, baKon) and --prefill-span (keptn42) - four-rank TP releases the link early; four-rank selftests and docs/TP4.md (goodman-b) - NVFP4 and FP8 compressed-tensors imports (devmilan); tools/rad-export for finetunes and LoRA adapters (baKon) - many fixes, among them lost tokens on stop strings under concurrency, keep-alive, MiniCPM5 tool arguments and the CPU's vision and audio encoders - plugin ABI 17 and changed op schemas: out-of-tree plugins must be rebuilt |
||
|
|
b93b531f63 |
radiance 1.5.0
- Gemma 4 31B (PRs #74, #75, #81, #86; sfjes, keptn42): sliding and global attention with their own kernels, the assistant head as a drafter that reads the trunk's cache, the vision tower, a fused w4a8 decode step, bf16 and compressed-tensors int4 checkpoints, and window snapshots so a prefix hit on a sliding-window model resumes instead of prefilling again. deploy/compose/gemma4-31b-w4a8.yaml serves keptn42's container on two cards - ParoQuant (PRs #65, #66, #67; malic): Qwen3.8-27B checkpoints with learned Givens rotations, as int4, int5 and MXFP4, imported without re-quantising, the prefill's rotations on the matrix cores. deploy/compose/qwen3.8-27b-paro.yaml serves them on one card. A ParoQuant container made with the PR builds is refused: convert it again with --reuse <old container> - Gemma 4 26B-A4B with z-lab's DFlash drafter (PR #88; Perire): arch/gemma4 serves Google's bf16 checkpoint with the routed experts in block fp8 or bf16 (data/recipes/gemma4-26b-a4b-df*.recipe), and libr4d gains its windowed paged attention, the fused sandwich-norm joins, expert_scale and the sharded draft head's pair_argmax. A prefill chunk runs as two slices with its all-reduces beside the compute, bit-exact with the whole step. The 31B's global layers take the windowed attention too: an 11.5K-token prefill on two R9700s in 3.1 s instead of 4.9 - a startup that logs nothing for two minutes says where it waits (#89): the system call (a KFD request by name), the library that made it, and its stack, which addr2line resolves against the binary - the prefix cache is kept in VRAM and host memory only (#70): the disk tier wrote every block and snapshot a prompt produced, and its copies never outlived the process. --prefix-cache-host-mib is renamed --prefix-cache-mib; --prefix-cache-dir and --prefix-cache-disk-mib are removed, and startup refuses all three with what replaced them. The compose files no longer mount /data, and .env no longer needs RADIANCE_STATE - --prefix-cache-ttl S (default 3600, 0 never): a conversation no request has used for that long leaves the cache, whichever tier holds it; radiance:prefix_cache_expired_total counts them. A full host tier now drops its least recently used conversations - --vision-tower-placement vram|ram (#84): ram keeps an encoder tower in pinned host memory and gives its VRAM to the KV cache, read over the link once an image - timings carry ttft_ms and total_ms (#85): the server's own time from the request body's arrival to the first and the last token, queueing and tokenisation included - a KV-cache recall that found a moved expert with nowhere to go stopped halfway and leaked the slots it had already freed: after it every recall failed, the cache stayed short until a restart, and requests failed with HTTP 500. A recall now waits for the slots it is owed and always finishes - a tool result or tool-call arguments that are not JSON are no longer refused as nesting past 1024 levels for their unmatched brackets (#90): only text that parses as JSON is held to the bound, since nothing else is parsed into a tree - the host-pool refusal names the limit that applies to pinned memory (RAM less 1/64 and 1.5 GiB), not ttm.pages_limit - --embedding-placement auto, removed in 1.3.0, is refused with what replaced it - for out-of-tree kernel libraries: gemm_nt_q gains two operands (pb1, pb2, the part bounds), and the loader requires identical op schemas, so a library built against 1.4.0 must be rebuilt. For architecture plugins, rad_op_declared(b, op) asks whether an op is in the loaded vocabulary without declaring it |
||
|
|
29bfe8f00c |
sched: --draft-window adaptive applies to block drafters
The adaptive window priced only a serial head's rounds and was refused for a block drafter, on the grounds that the block is proposed in one pass. But every verified draft is still a verify row, and on a MoE whose verify reads the experts each row routes to, rows are not free (16 rows read ~10x the experts one does). A block drafter now takes the same policy with its rounds fixed: each sequence verifies the first min(D, its stop) of the block, its stop from its own measured acceptance and D from the measured step times. Prompt lookup alone keeps the fixed window and says so. Speculation stays lossless: what is verified is a prefix of the proposal. Measured on gemma-4-26B-A4B-it + z-lab DFlash (block 15), 4x R9700, TP4, together with gemma4k's split-KV merge rewrite (landed in the same build, so the two are not separated): story at T=1 95 -> 177 tok/s, greedy thinking ~360 -> 572 tok/s; code at T=0 319-334 tok/s (it verifies deep either way). tests/sched_test.cpp: the block-drafter case now expects the policy on (4 drafts verified while the estimate is the prior, 1 after 64 rejected steps, draft_verify_depth[4] and [1] both counted); the prompt-lookup-only and no-speculation cases are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
7c7f755931 |
Merge Gemma 4 31B: PRs #74, #75, #81 and #86 (sfjes, keptn42), with fixes
The gemma4_bf16 architecture (sliding and global attention, the proportional RoPE ladder, the assistant head as a drafter that reads the trunk's cache, the vision tower), its w4a8 decode junctions, the h512/gqa8 and h256/gqa2 attention kernels, compressed-tensors int4 import, multi-EOS from generation_config, the call/reasoning reply format, a window group that keeps the keys a prefill chunk still reads, and window snapshots in checkpoint slots so a prefix hit on a sliding-window trunk resumes. Fixes on top: the investigation switches and diagnostic blocks out of the served paths; int4 import through the checkpoint import framework; attention_k_eq_v from the config; the fused junctions only where every reader takes their pair; a shared-KV head binds no group of its own; the compose file without HSA_ENABLE_IPC_MODE_LEGACY (TP2 fails with it on ROCm 10.1); a checkpoint carries a window only where a hit resumes from it; the README says the linked container is keptn42's calibrated GPTQ build and what the in-tree recipe gives. |