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.
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.
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).
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>
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>
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.
The note_ready comment claimed "the page divides by this figure", but the
submitted dashboard does not divide by startup_s (the payback formula that did
was removed). Reworded to describe the actual risk: a zero cost would price
every restart as free in any payback formula that divides by it.
Dropped CHECK(gap_pct >= 0) in the decode-floor drift test: recent >= floor
holds by construction (floor is the min of the window means, recent is one of
them), so the check can never fail. The load-bearing assertion is the adjacent
CHECK(gap_pct < 3).
Authored at: Tasmania Qwen 3.8 27B Dense XHigh (level not visible) via Open WebUI
(cherry picked from commit 98429a9b15d7da1aa0e644cbd7e519d1bf33d797)
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)
- video: MiniMax-H3 and FastVideo's FastH3 8-Step V2, a video with its stereo soundtrack from text
on OpenAI's /v1/videos, block fp8 on two cards
- music: MiniMax-Music3, songs from lyrics and a description on /v1/audio/speech
- speech: Breeze-TTS-2 on /v1/audio/speech and vLLM-Omni's realtime WebSocket
- runtime LoRA adapters beside the base model, picked per request by `model` (baKon, #105)
- several agent streams keep their cached history: --checkpoint-slots auto, the new default, sizes
the snapshot store by --max-num-seqs (#108)
- the Swift 1.5 27B W4 releases convert and serve: compressed-tensors AWQ and GPTQ int4, AutoRound,
ModelOpt NVFP4 (#110)
- the image's host tests pass where perf_event_open is refused, as in BuildKit's sandbox (#106)
- plugin ABI 21: out-of-tree plugins must be rebuilt
The per-row adapter slot moves from the core's `lora_slot` derivation into the step batch, beside
the other per-row arrays: [n_tok] i32 device, the row's slot in the adapter pools, < 0 or >= S a
base row, null when the engine serves no adapters. The batch builder fills it from
Request::lora_slot where it fills token_ids and positions, in the slab every rank's batch already
points into -- one address per rank for the engine's life, uploaded in stream order ahead of the
step's kernels -- so a recorded pass replays it the way it replays token_ids. Ctx::pass_key reads
the pointer; the adapter ops are issued whatever the slots hold, so nothing a pass launches depends
on their values.
Off: the slab carves nothing for it (a zero-length carve), no buffer is declared, and every other
slab offset and the arena are what they were. The derivation, its program buffer and
Program::lora_slot_buf are gone. abi_layout_table regenerated at 18 (RadBatch grows to 320 bytes,
the fields after seq_ids move by 8); sched_test holds the per-row fill, and that the slot array is
the only thing adapters add to the slab.
- 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
- 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
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>
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.
- Qwen3.8-Flash-Next on one card: the heat engine moves 64 experts a step (was 8), its copies and
the prefill's expert staging run on the card's DMA engines instead of as copy kernels, and at
decode the next layer's likeliest experts are copied onto the card ahead of its GEMMs. Against
1.3.0 at --tp 1: prefill +17-20% from 8K tokens up, throughput under load +16-20%
- deploy/compose/flashnext-tp1.yaml: Qwen3.8-Flash-Next on one card and 64 GB of host RAM
(4096-token prefill steps, 4 sequences, a 301K-token cache)
- #61: --busy-prefill-chunk (default auto): a long prefill leaves the rest of the step to the
requests decoding beside it and to new arrivals, instead of taking all of it (baKon)
- LiquidAI's LFM2 and LFM2-VL, and d1's /v1/systemone (after zivius's PR #50)
- a startup report: every option with its value and where it came from, the hardware, and what
on it costs speed with the fix; /diagnostics serves it (behind the API key; without one, only
to the same machine)
- #69: a GPU memory fault names the buffer and kernel argument behind it and ends the server at
once (exit status 70), instead of hanging or writing a core of tens of gigabytes
- #64: a card without Resizable BAR is refused at startup, naming what to turn on, instead of
crashing at the first launch
- the image is built with ROCm 10.1 (the host's amdgpu driver must support it), with ROCm's
libLLVM rebuilt so the same source compiles to the same kernels every time; a source build
takes ROCm 10.1 or 7.2
- #71: the image ships curl, jq and a CA bundle, so --model <HF repo id> works in the container,
and hfget.sh runs under its busybox (baKon)
- --profile-ops shows how long each op's lane sat idle before it; cardclock.py skips an
integrated GPU instead of stopping
rad_drafter_shared_kv(b, pos_offset), an additive builder export: the
declared SERIAL head reads the trunk's K and V and writes none (Gemma 4's
assistant head has a query projection and nothing else per layer). A
plugin that does not call it drafts exactly as before; RAD_ABI_VERSION is
untouched (same pattern as rad_kv_group_zero).
For such a head the serial driver changes in two places:
- No history is owed. The history pass carries round 1 only: one row a
drafting sequence, at the committed position, with the token the trunk
chose after it and the trunk's hidden state there. A sequence that does
not draft gets no row; a step with nothing to draft runs no pass.
- Every round runs at that same position, over the same context. seqused
ends at the committed position: past it, the trunk's cache holds the K
and V of drafts the verify rejected, or nothing.
`pos_offset` (0 or 1) is where the rows sit for the rotary, relative to the
committed position; it moves nothing else.
Card side: ADV_HIST and ADV_ROUND take the shape from AdvanceArgs::shared_kv
and rot_shift, which the scheduler fills from the Program. Host side:
serial_begin/serial_batch stage one row and a constant ceiling.
Tests: build_test checks the export's refusals; sched_test stages one verify
step both ways (the old path pinned: five history rows, rounds stepping),
checks that a cacheless head runs no pass when nothing drafts, and runs the
card's advance rows directly for both shapes.
prefix.cpp indexes the RAD_KV_FULL groups and skips RAD_KV_WINDOW (its own
words: "a hit's blocks do not describe a cache whose floor moves" — the
blocks below the window are recycled). admit_one clamped a hit for the
linear/checkpoint cases; a model whose own attention includes a group the
cache skips — every windowed+full pair — passed every clamp, reused, and
adopted blocks covering the CACHED groups only. The windowed trunk layers
take used = ctx_len + n_tokens (batch.cpp) and read positions below
ctx_len this sequence never wrote; grab_block's min-heap (kv.cpp) hands
out the most recently freed blocks, i.e. the previous tenant's. The
sequence attends to the PREVIOUS REQUEST'S KV as its own prefix: fluent
text carrying the last request's content. Reproduced on a live server
with sequential prompts (A-B-C-A-B: the re-run of A reads C's prompt),
and it is why a windowed model with the prefix cache on cannot currently
serve more than one conversation at a time.
The fix is a second predicate next to the drafter floor, computed once
in init(): a paged group bound to a TRUNK layer (below meta.n_layers —
a drafter borrows from base_layer and above, per rad_bind_layer_kv) that
cached_groups() does not name. In admit_one, a hit with such a hole
reuses nothing: the prefix re-prefills (windowed prompts are small;
milliseconds). The drafter's own hole stays the refill design's —
HitCap ends the hit one drafter window before the prompt's end so the
tail-recompute covers the drafter's window while the trunk reuses the
rest (the e95d397 tests keep passing, all of them); no tail-recompute
can repair a trunk hole, which is why zero is the honest answer there.
sched_test gains an opt-in WINDOW group in the fixture (bound to a
trunk layer) and a_hit_on_a_model_with_a_windowed_group_reuses_nothing:
a deep, checkpoint-covered hit — legal under every other clamp — on a
cache indexing only the FULL group. Reuse lands at 0, nothing is
adopted, and attn_cached_tokens still reports the 304-token match: the
cache hit and the scheduler refused it. Disable the clamp and the hit
adopts 16 blocks of the seeded (previous tenant's) KV — n_computed 256,
the leak as shipped; that is the regression net.
Box: ctest lane + A-B-C-A-B battery green (evidence in the PR body).
prefix.cpp indexes the RAD_KV_FULL groups and skips RAD_KV_WINDOW (its own
words: "a hit's blocks do not describe a cache whose floor moves" — the
blocks below the window are recycled). admit_one clamped a hit for the
linear/checkpoint cases; a model whose own attention includes a group the
cache skips — every windowed+full pair — passed every clamp, reused, and
adopted blocks covering the CACHED groups only. The windowed trunk layers
take used = ctx_len + n_tokens (batch.cpp) and read positions below
ctx_len this sequence never wrote; grab_block's min-heap (kv.cpp) hands
out the most recently freed blocks, i.e. the previous tenant's. The
sequence attends to the PREVIOUS REQUEST'S KV as its own prefix: fluent
text carrying the last request's content. Reproduced on a live server
with sequential prompts (A-B-C-A-B: the re-run of A reads C's prompt),
and it is why a windowed model with the prefix cache on cannot currently
serve more than one conversation at a time.
The fix is a second predicate next to the drafter floor, computed once
in init(): a paged group bound to a TRUNK layer (below meta.n_layers —
a drafter borrows from base_layer and above, per rad_bind_layer_kv) that
cached_groups() does not name. In admit_one, a hit with such a hole
reuses nothing: the prefix re-prefills (windowed prompts are small;
milliseconds). The drafter's own hole stays the refill design's —
HitCap ends the hit one drafter window before the prompt's end so the
tail-recompute covers the drafter's window while the trunk reuses the
rest (the e95d397 tests keep passing, all of them); no tail-recompute
can repair a trunk hole, which is why zero is the honest answer there.
sched_test gains an opt-in WINDOW group in the fixture (bound to a
trunk layer) and a_hit_on_a_model_with_a_windowed_group_reuses_nothing:
a deep, checkpoint-covered hit — legal under every other clamp — on a
cache indexing only the FULL group. Reuse lands at 0, nothing is
adopted, and attn_cached_tokens still reports the 304-token match: the
cache hit and the scheduler refused it. Disable the clamp and the hit
adopts 16 blocks of the seeded (previous tenant's) KV — n_computed 256,
the leak as shipped; that is the regression net.
Box: ctest lane + A-B-C-A-B battery green (evidence in the PR body).
A prefill chunk took every token the step had left (plan_chunk(..., budget)). On a step budget of
a few thousand tokens and a prompt of a few hundred thousand, that is every step for a minute or
more, and for all of it a decode row behind the prefill in running_ got nothing (`want > budget`
-> break) and admission never ran (`while (... budget > 0)`). A mostly-cached turn that needed a
few hundred tokens waited for somebody else's whole prompt: on three ranks at
--max-num-batched-tokens 2048, a 94,529-token turn with 94,208 cached took 40.6 s to its first
token, which landed on the instant a 264,725-token cold prefill ahead of it ended (#61).
--busy-prefill-chunk auto (the default) holds a prefill chunk back only when work that would
otherwise get nothing is pending in the step: one row plus the draft window for each decode row
behind it, a share (an eighth of the budget, at least one quantum) for each prefill behind it and
for the next request waiting to start. The chunk never drops under the smallest step the prefill
stager overlaps -- under it every routed layer reads its pooled experts synchronously, the
-65 % prefill measured at a budget one token under the threshold. Where holding it back for a
waiting request or another prefill would leave a remainder under that floor before the checkpoint
boundary, the interval is split into two staged halves instead. Decode rows alone only take their
few tokens: the chunk ends a quantum short of the boundary and the next step finishes the
interval, the same pair of steps a prefill already runs when decode rows are planned ahead of it.
(Halving for decode rows too held a long prompt to half-interval chunks for as long as anything
decoded behind it, the larger cost.) Whatever the reserve was not used for (a refused admission, a
decode row that drafted less than its window) goes back to the chunk before the step is issued.
Admission shares the same way, so a cold prompt admitted with others queued behind it does not
take the whole step either; an embedding input still runs whole or not at all.
A prompt with nothing beside it, and rows already planned ahead of the prefill, are planned
exactly as before, so a lone request's steps -- and every greedy output -- are unchanged. `off`
restores the old loop including its break. `N` holds a chunk that shares the step to N tokens,
rows ahead included (the operator trading prefill speed for every other row's latency); startup
warns when N is under the stager's step.
The engine hands the scheduler the stager's smallest pass after init (PrefillStager::min_rows,
the largest over the ranks). radiance:engine_prefill_chunks_capped_total counts the chunks held
back. sched_test covers admission during a long prefill, a decode row behind one, off reproducing
the old plan, a lone prefill unchanged, an explicit N with rows ahead and behind, the share
handed back when nobody takes it, and the cap's arithmetic at a 2048-token step with the stager
at 1025, with and without a share in the reserve.
- Static YaRN for the Qwen rotary paths (#37): a container whose config names YaRN gets it in
attention, the QSA index keys and a DFlash2 drafter; one reader for every rotary type, and a
LLaMA container whose type is not served (llama3, longrope, dynamic) is refused by name.
- --rope-scaling yarn:FACTOR[:ORIG] (#38) writes YaRN over a container's own rotary keys at load,
no reconvert; the persisted prefix cache's fingerprint carries the resolved rotary.
- An uneven world's cheaper rank (#36) pages the common token count and gives the rest of its
VRAM to its experts; a plan and pool that disagree refuse to start.
- MoE prefill (#35): wide gather, parallel scan and run-map prefix, 256-column down tile, early
weight loads -- by rule, bit-identical.
- MoE decode (#34): the sorted operand's own down kernel, its column tiles by routed rows.
- --draft-window fixed|adaptive (#24): a per-sequence draft window priced by measured step time,
one head depth per step over the batch; fixed stays the default. New metric
radiance:draft_position_accepted_total and Grafana panels.
- Out-of-tree plugin builds compile to the tree's device code from any build directory.
RADIANCE_DRAFT_ADAPT prices a draft as one more round of the head. A block
drafter proposes its whole block in one pass, so it is not that trade; with
a block drafter the engine now turns the policy off before the first step
and says so. New sched_test case.
The cost table prices a step at one sequence. Under load every row a step
adds is expert bandwidth its neighbours wait on, and the adaptive window
lost 4 % at 8 concurrent requests. With RADIANCE_DRAFT_ADAPT_BUSY=N and
more than N sequences running, every window is capped at
RADIANCE_DRAFT_ADAPT_BUSY_DEPTH (default 3); the estimates keep learning.
The count is taken once a cycle and held to its end, so the plan, the
rounds, expect_draft and set_draft see one cap. Unset, nothing changes.
One depth for every request is too shallow for code and JSON and too deep
for prose. With RADIANCE_DRAFT_ADAPT=1, --num-speculative-tokens becomes
the ceiling and each sequence drafts into the window d that maximises
E(d)/T(d): the tokens a step is expected to emit from the sequence's own
smoothed acceptance at each position, over the step's cost
(RADIANCE_DRAFT_COST, depth:ms pairs). The serial head runs as many rounds
as the deepest window in the step. A window moves only past a hysteresis
and a hold, since a new window is a new pass shape. Acceptance is
unchanged. /metrics gains radiance:draft_depth_adaptive and
radiance:draft_verify_depth_total{depth} while it is on. Unset, nothing
changes. Greedy at up to 6 against fixed 3: code +7.7 %, JSON +16.3 %.
- A checkpoint restore that found its snapshot slot given back stopped the engine (#33): a
snapshot handed to an admission is now kept until its step has run, a lost one re-prefills
that request instead, and a failed restore names the check and the rank.
- The headroom warning had no fixed point (#32): it now checks the room left for a kernel's first
launch and names the --gpu-headroom-mib value that clears it.
- reasoning_effort (#31): the levels the chat template takes are probed at startup and published
in /server_info; a level outside them is a 400 on `reasoning_effort` with `supported`;
--reasoning-effort-map rewrites a client's level.
- rad-convert reads published quantised releases (#29): AMD Quark MXFP4 byte for byte, and
AutoRound (auto_round:auto_gptq) / GPTQ int4 and int8, with Flash-Next checkpoints that ship
their experts one by one.
- tool_choice "required" and a named function are served by a call grammar for the whole reply.
- MXFP4 weights: block-fp8 Qwen3.5/3.6/3.8 dense models serve OCP-MXFP4 linears (e2m1, an E8M0
exponent per 32) at 4-bit weights against E4M3 activations. New libr4d rows: the decode GEMM
(M <= 128, split-K with a fused last-arriver reduction) and the prefill GEMM on a fragment-tiled
activation. Qwen3.8-27B MXFP4 (AMD Quark AWQ) is in the model table.
- Cards without peer-to-peer access serve: every collective has a host-memory twin; --p2p
auto|on|off.
- Stop strings apply to the answer, not to the reasoning block a reply starts in.
- A prefix hit ends one drafter window before the prompt's end, so a windowed block drafter
(DFlash2) drafts from the first token of a follow-up turn.
- The VRAM split has no ratio: --expert-vs-cache-ratio is gone (now an unknown option). The
experts keep what the pinned host pool cannot hold, the KV cache takes the rest and lends idle
blocks to the experts. Flash-Next at tp2: 7.9 GiB of KV a card, up from 4.7. Startup, /stats,
/metrics and the dashboard report the most the cache can hold.
- Linear-state snapshots live in pinned host memory, not VRAM (--checkpoint-slots sizes the
store). Prefix-cache misses on agent sessions fixed; a published conversation is no longer
trimmed away.
- Any world size from the shipped container (baKon): --tp 3 on Flash-Next with no padded
checkpoint -- the attention world, uneven delta-net heads, the fill op.
- Kernels (keptn42): moe_gemm_q decode loads and one-trip run search, hc_read's prefill form
(+3.7% prefill at 18K), hc_up row groups up to eight, the fused router launch. Each is the rule
where it was measured faster; no environment switches.
- Tool calls: a typed argument is always JSON (Python True/None no longer leak into arguments --
Codeberg #21); nine further reply-parser fixes; the reply path inside a call is ~12x cheaper on
the host.
- The kernel changes: prefill +2-3% and decode -2% a step on 2x R9700 at tp2, identical text.
- Chat responses report usage.completion_tokens_details.reasoning_tokens: how much of
completion_tokens was the reasoning block. A reply that ran out of max_tokens inside <think>
now reads as that, instead of as a model that answered nothing.
- thinking_token_budget (vLLM's name; thinking_budget is read as the same field) caps the
reasoning. At that many tokens the block is closed and the model answers from what it has
reasoned so far. It holds under speculative decoding and at any temperature.
--thinking-token-budget sets the default for clients that send none.
- Every completion response carries a `timings` object in llama.cpp's shape: prompt and generated
token counts, times and rates, and the speculative tokens drafted and accepted for that request.
It is on the buffered response, on each streamed choice's final chunk and on the usage chunk,
so a proxy such as llama-swap can read per-request speed. /metrics stays the aggregate.
- Peer-to-peer access between the cards is checked at launch. The all-reduce kernels need it; on
a machine where the cards cannot reach each other's memory, startup stops and names device.p2p
instead of the first all-reduce faulting or hanging. A kernel library can require it with a
constraint on the new "device." keys, which match the machine and not the op's parameters.
- A pool allocation the driver refuses says why, with the card's free VRAM at that moment and,
for the host pool, the pinned memory taken against the amdgpu limit (ttm.pages_limit). Every
rank pins its own --host-pool-mib, so --tp 2 pins it twice.
- Answers no longer stop partway through. A request without max_tokens got 512 tokens, and a
reasoning model can think for thousands before it answers, so the reply ended inside the
reasoning with finish_reason "length", which chat clients do not show. It now gets whatever
the context leaves after the prompt, as in vLLM. --default-max-tokens N sets a number, and
--max-tokens-cap bounds every request.
- Qwen3.8-Flash-Next in Docker without --security-opt seccomp=unconfined is refused at startup,
in about a second, with a message naming that option. It used to load the whole model and then
fail every request as "unsupported", and a restart policy reloaded it over and over. The
n-gram table is read through io_uring, which Docker's default seccomp profile refuses.
- A request the engine fails says what failed, in the 500 or the stream's error event. It read
"the engine failed this request: ok".
- Flash-Next no longer crashes at startup about one start in seven (a race between the
parallel declares that size the activation arena).
- rad-convert no longer needs io_uring, so it converts in a sandbox that forbids it.