The direction table is indexed by layer (row 0 unused) and sized n_layers, so a
file carrying direction.<n_layers> passed the range check and then wrote one
row past `dir`, and a package JSON whose range ended at n_layers read one past
`scales`. Both bounds are exclusive now, and cvec_test covers each: direction.48
of a 48-layer model, and a JSON range 4..48 on the same model.
The startup line printed `n_layers - 1` as the direction count -- the published
file's count, but wrong for a file carrying fewer directions; the loader records
what it read and the line prints that. Also drops an unused <cstring>.
A control vector is one unit direction per layer, applied to the residual stream while the model
runs (llama.cpp's --cvec-mode project). This is the loader and its ABI, with no configuration
surface: a vector is a property of the model family, so the engine looks for one beside the
container, in its directory or in $RADIANCE_HOME/vectors, and uses it when it fits the container.
The operation's parameters (layer range, scale, mode) come from the package's own JSON.
Validation is against the container, never the file's provenance: architecture hint, direction
width against n_embd, every layer in the range present, F32 rows. A discovered file that does not
fit is reported and skipped; the switch stays off until a request asks for it.
The ABI grows by one trailing, zero-defaulted field (RadBuildCtx::cvec), so an architecture plugin
that ignores it is unchanged, and the cache gains a salt (0 without a vector) that keeps blocks and
linear-state snapshots of one mode from being reused by the other.
LoRA for image and video generators:
- civitai and Hugging Face adapter files as published: kohya, ComfyUI and diffusers/PEFT key names;
LoRA, LoCon, LoHa, LoKr and full-weight diffs; DoRA, OFT and Tucker are refused by name
- stacked per request with a strength each, through the `loras` field or <lora:name:strength> tags
in the prompt; --lora-dir serves every file in a directory, GET /v1/loras lists them, and
--max-loras / --max-lora-rank size the slots on the card (generators default to rank 64)
- Krea 2, Qwen-Image 2.1, FLUX.3 [klein], MiniMax H3, LTX-2.5, Anima and SDXL
New models:
- Anima (base, aesthetic and turbo): Cosmos-Predict2 DiT with the Qwen3-0.6B text encoder and the
Qwen-Image VAE, on one card
- Stable Diffusion XL and its single-file finetunes (Illustrious, NoobAI including V-Pred, Pony),
read as civitai ships them, with the Euler, Euler a and DPM++ 2M samplers
Recipes:
- q38-27b-mxfp4-df2: any bf16 Qwen3.8-27B or finetune at MXFP4 with the DFlash2 drafter
- Krea 2 finetunes from civitai: scripts/krea2_native.py reads Krea's own key names, and
krea-2-fp8-unscaled keeps a plain-fp8 file's codes exactly
Changes: --max-num-batched-tokens defaults to 2048 (was 8192). Plugin ABI 25: out-of-tree plugins
must be rebuilt.
The floor a KV pool must keep for one --max-model-len request came from a separate plan at
max_seqs 1. A hybrid model's recurrent and conv slots are fixed per configured sequence and stay
allocated while one request is active, so that plan undercounted and the pool it allowed could
not hold max_ctx. The floor is now pool_mib_for_tokens over the real plan's groups. mem_test
(hybrid_context_floor_accounts_for_all_configured_state_slots).
A restart's cost is the one number a reader needs in order to decide whether one
is worth suffering, and any guess at it would decide the answer by itself. The
server knows it exactly: the interval from process start to the socket listening,
on this machine, with this model and this cache state.
Emitted on /stats as startup_s, 0 until the server has listened. Raw figure only
-- the page no longer consumes it. It is here because it is the missing half of
any restart decision a human or a tool makes downstream, and because the
decode-step advisory that did consume it was withdrawn the same day it shipped
(see the following commit for what the live data showed).
Trailing zero-defaulted field on both SchedMetrics structs plus the adapter copy;
neither struct is ABI-pinned, so this is the sanctioned append.
Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (xhigh) via Open WebUI
(cherry picked from commit 76a9e2f7a28b8e034cfd56caa091792c68fe19b6)
The flag sets the trunk's cache to E4M3 plus a RAD_KVQ_* layout; a plugin offers the layouts it
serves in its probe and the server refuses any other, naming the plugin. qwen35_fp8 offers both
at head_dim 256, gqa 6, and declares the group at head_dim 200 / 176 (the row's bytes / 2), so
the core sizes pages as for fp8; a drafter's cache stays fp8. Qwen3.8-27B on two R9700s, KL
against bf16 on 17 long documents: fp8 0.039963 (518,800 tokens of KV), fp8_v4 0.040076
(664,400), k6_v4 0.039965 (755,184); prefill and decode at fp8's speed. ABI 23: two trailing
fields, the layout table regenerated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 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
--lora NAME=PATH, --max-loras, --max-lora-rank, --lora-target-modules. Off unless
named: no site, no pool, no op, and every prefix hash is what it was.
- 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
- Qwen-Image 2.1 and 2.1 Turbo: text to image and image edits over OpenAI's images API,
/v1/images/generations and /v1/images/edits. An edit takes up to ten pictures and an optional
mask, outside which the picture comes back exactly as it was; `background: transparent`, png,
jpeg and webp output, `n` pictures from one prompt, streamed previews (`partial_images`), and
vLLM-Omni's seed, negative_prompt with true_cfg_scale, num_inference_steps, width and height.
arch/qwenimage21 serves the diffusers pipeline directory, converted with
data/recipes/qwen-image-2.1-fp8.recipe (block fp8) or qwen-image-2.1-bf16.recipe.
deploy/compose/qwen-image-2.1.yaml and qwen-image-2.1-turbo.yaml serve the fp8 containers on
two cards. Two R9700s make a 2048x2048 picture in 61 s at the base model's 40 steps and in
13 s with Turbo (56 and 12 s with --tp-wire wht6), a 1024x1024 one in 6.0 and 2.6 s. The
models are under Qwen's research license, which is non-commercial
- an image generator is a program kind of its own (core/gen): an architecture declares its
conditioning, denoising and decoding passes, and the driver runs the schedule, the pictures of
a batch and the conditioning cache. An image model's /v1/models entry is its generator's name
(qwen-image-2.1, qwen-image-2.1-turbo), and its capabilities and startup banner list only the
images endpoints
- the tiled prefill GEMMs run their tiles in groups of activation bands, 16 for fp8 and 8 for
bf16, so an operand larger than the 64 MB cache is read once a group instead of once a band. A
bf16 GEMM with more than 64 MB of weight runs up to twice as fast
- fixed: a second lane opened in the middle of a step started beside work lane 0 had not
finished. Gemma 4 26B-A4B opens its lane that way, so its first step after startup could read
rows not yet written
- startup no longer warns about --checkpoint-slots when it was not passed, nor about an expert
floor on a model with no experts
- the image's FFmpeg writes png, jpeg and webp (libwebp)
- for out-of-tree plugins: RAD_ABI_VERSION is 16. The op vocabulary gains the image generator's
ops (conv2d_nhwc, ln_mod, ln_mod_quant_fp8, flow_euler, attn_prefix_self and others; docs/OPS.md,
"Image generation"), and all_reduce takes an optional `overlap`. Plugins built against 1.5.0
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 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
A checkpoint states the tokens a generation ends on in generation_config.json (eos_token_id, one
id or a list), and rad-convert already carries it into the container as
`generation.eos_token_id`. The vocabulary did not read it: it ended on eos, eot and a list of
known spellings. Gemma 4 names three, [1, 106, 50] -- <eos>, <turn|> and <|tool_response> -- and
the container's eos is only the first.
- <turn|> closes every turn. Without it a reply runs past its own end: a three-sentence answer
stopped at max_tokens 400 after ~390 tokens of "---" lines instead of finish_reason "stop" at
65 tokens.
- <|tool_response> is what the model writes after its calls, where it waits for the result.
Greedy on the 31B QAT checkpoint (TP 2): after a finished call the next token is 50 with and
without this change; without it generation goes on and writes the same call again until the
token limit, with it the reply ends there (stop_type "eos", one token).
The engine reads `generation.eos_token_id` from the metadata before loading the vocabulary
(VocabBuild::eos_ids, not baked) and Vocab::load ends a generation on every id in range, logged
beside the spellings it adds.
text_test: ids in the list end a generation, an id naming no token is no id.
- #47: llama-server's request fields, routes and sampler order, and /props (with baKon's model
entry: max_model_len, root and capabilities on /v1/models, and /v1/models/:id)
- new APIs: Anthropic's Messages API (/v1/messages), OpenAI's Responses API (/v1/responses),
llama-server's /completion and /infill, logprobs (OpenAI's logprobs and top_logprobs, up to
20; llama-server's n_probs), OpenAI's legacy `functions`, and X-Api-Key beside the bearer key
- #4: --model takes a Hugging Face repo id (owner/name), fetched before startup into
~/.cache/radiance/hf or --download-dir and checked for changes at every start (redxherring)
- #46: --tp 3 --tp-wire wht6 serves -- a three-rank two-shot all-reduce with uneven shards and
the tiered-int8 wire over it (baKon); scripts/cardclock.py names what holds each card's clock
under load (baKon)
- CPU-only serving works again; --kernels names the kernel libraries to load; a model the
loaded libraries cannot fully serve refuses at startup instead of failing its first request;
--vram-kv-mib and --vram-weights-mib are gone (the split is automatic)
- --embedding-placement ram is the default, and `auto` is gone
- #40: Swift 1.5 recipes; rad-convert reads which shard holds a tensor from the index
- #53: the pinned host pool gets huge pages where shmem THP is off; #57: a crash on video with
an odd frame width is fixed
--tp 3 --tp-wire wht6 had no kernel: the lossy rows were world_size 2 (rotated 6-bit) and 4
(tiered int8 over the two-shot). The tiered-int8 two-shot is already written over the world size,
and what kept it at four was the even split it shards by -- numel % (32 x ws) -- which a 2048-wide
row (64 groups) meets at three ranks one step in three.
The kernel now splits ng = numel/32 groups as evenly as they divide, the first ng % ws shards one
group longer, and lays every slot out for the longest shard, so writer and reader agree on one
number. At four ranks the entry still requires numel % 128 and the split is the even one it was.
ar_twoshot_3rank_ti8 is the only lossy row at three, so as at four it resolves at every size; a
message under min_bytes, or not whole groups, goes to the exact one-shot.
r4d_selftest holds it to what a lossy wire can be held to: every rank the same bytes, the declined
messages the exact fold bit for bit, and the rest within the int8 wire's error of the fp32 sum
(relative RMS < 1%), over groups % 3 of 0, 1 and 2 with outliers, to the 20971520 ceiling. The
--tp-wire help, the startup LOSSY warning, README, GUIDE and TP3.md say three ranks.
- EmbeddingGemma 2 (google/embeddinggemma-2): text, image, video and audio embeddings on the
card (libr4d) and on the CPU (libavx); prompt_name, Matryoshka dimensions, image budgets,
mixed content parts and the messages form on /v1/embeddings
- #43: on serves that lend the activation arena to the experts (Qwen3.8-Flash-Next with
expert_tiered), every image after the first read its rows from the wrong place -- garbage
replies, or an earlier request's image. Fixed
- the Qwen vision towers' attention resolves on the card again (broken on main after 1.2.3,
never released)
- #42: a warning at startup when amdgpu cwsr_enable is 0, and a stalled queue is reported as
slow or stuck; the guide covers the GPU-hang-and-reset chain
- 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.
yarn:FACTOR[:ORIG] (or none) is written at load into the rotary object yarn_from takes first --
for a Qwen3.8 container text_config.rope_parameters, which already says default, so YaRN written
beside it would never be read -- and resolved and checked exactly as a converted container's is.
An existing container serves past its trained context with no reconvert; a DFlash2 drafter gets
the same factor over its own trained length; a checkpoint's own YaRN has its factor replaced and
its stale attention_factor/mscale dropped; linear or other explicit types are refused. Startup
names the rotary's reach and warns when --max-model-len is past it, and a persisted prefix cache
written under another --rope-scaling is not reused. core/format/rope_override.h is held to
yarn_from in tests/yarn_test.cpp.
The resolver derives one split, the dearest rank's, for every card, and one
block table serves every rank. An attention-zero rank keeps no attention cache:
at TP3 on Flash-Next it pages the common 1.45M tokens in ~1.8 GiB of its
10.6 GiB KV pool, the rest is an address reservation nothing ever commits or
lends, and 1091 of its experts can never reach the card even with the cache
idle.
Such a rank now gets a KV pool that pages exactly the common token count (the
new KVManager::pool_mib_for_tokens, the inverse of paged_tokens, plus a 64 MiB
margin) and the difference in its weights pool, no further than every weight
resident. The per-rank split reaches BOTH readers of the resolved sizes --
Pools::configure and the planner -- so the grown pool is planned into. The
token count, the carve, the loan and the dearest ranks' pools are unchanged;
configure_kv names it if a re-sized pool ever binds.
Only a derived split under expert_tiered is re-split: a stated pool is the
operator's, and under auto a fully resident rank would choose all_vram while
its peers spill. Where every rank's cache costs the same -- every world the
heads divide -- no rank qualifies and every rank takes cfg_ as before.
- 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.
- Pinned host memory works again on kernel drivers without the SVM API (e.g. a KVM guest with the cards passed through): the host pool is one allocation there instead of 1 GiB pieces that landed apart on the cards (#28). Regression since 1.0.9.
- A host-pool refusal no longer advises shrinking the pool when it fits under the pin cap and the available RAM.
- 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.
This reverts commit fa01bd2. Its premise -- the attention-zero rank holds
a larger share of the experts, so the bytes its cache does not need are
best spent in its weights pool -- went with the experts' remainder-first
placement (665d181): the experts cut as every world always has and no
rank has a larger share. What the re-split did keep was a KV pool on that
rank a third the size of its peers', and BetterBench after three 250k
prefills (a cache three quarters full) decoded 13-23% slower at every
concurrency than the same tree without it, while a cold server measured
faster. The pool goes back to the common split; what the rank does not
carve for attention it lends, as every rank's idle cache does.
A freshly assigned recurrent slot was zeroed on every rank with rank 0's
layer_bytes_per_state. The ranks' shares of a group need not be equal --
a world the heads do not divide gives them different counts -- and a rank
holding more heads than rank 0 had the tail of its state left as the last
sequence left it, read by the recurrence from the first token. Every rank
now clears by its own plan. The host/disk tier made the same assumption
twice: a slot was rank 0's entry times the world and a rank's window sat
at rank times that; a slot is now the sum of the ranks' entries, each
rank's window where the ranks before it end, and the staging ring is
sized for the largest. Equal shares give the bytes they always gave.
Found by moving the extra delta-net head of Flash-Next at three ranks
onto the attention-zero rank: rank 0 held five heads, rank 2 six, and
every answer was noise.
The resolver derives one split for every rank (the dearest rank's). A rank
whose KV groups cost less per token -- an attention-zero rank keeps no attention
cache -- would spend the common pool on tokens configure_kv then caps away, one
block table serving every rank. Its KV pool is now sized for the same token
count as the dearest rank's, a hair over, and the difference goes to its
weights pool, where its larger share of the experts lives. Only a derived split
is re-split; a world whose ranks cost the same is untouched.
From a container the relayout workers are fed by the sweep over the file, and a
zero share (rad_weight_shard_zero: an attention-zero rank's q|gate, k, v and o)
has no bytes in the file, so nothing ever arrived for it, its worker never ran,
and its slot held whatever the card had there. On a card whose freed VRAM the
driver wipes that is zeros and the rank serves correctly by luck; on a card
fresh from a reset ("VRAM is lost") it is garbage and every token is garbage.
The checkpoint branch hands every staged weight to the workers itself, which is
why the hole was never seen there.
Zero shares are now handed to the workers before the sweep, and the pool's
finish() refuses when any staged weight was never delivered, so a slot nothing
wrote cannot serve again.
Reproducer on any card: RADIANCE_POISON_ALLOC=255 with an odd world over a
container (--tp 3 on a two-KV-head model).
One block table serves every rank, and Engine::serve refuses ranks whose
paged groups hold different block counts. Under the even split that was
a check that never fired: the ranks' pools had the same geometry and the
same bytes. Under the attention world they do not. A rank with 6 of 16
delta-net heads holds more recurrent state than one with 5 and has less
pool left for pages; the attention-zero rank has no attention weights
and has more. Three ranks over Flash-Next carved 136256, 142352 and
more, and the serve was refused.
KVManager::paged_split is the carve's paged arithmetic with nothing
carved -- the token count the paged groups exhaust at together for a
pool of so many bytes, a windowed group capped at its window -- and
carve_into spends what it says. paged_tokens asks it; cap_paged_tokens
sets a ceiling it keeps under. Engine::configure_kv plans every rank
first, asks each what it could page, and caps every rank at the least
before any carves; a rank that could have paged more says so at info.
At an even split the cap is what every rank would have carved.
mem_test: kv_ranks_with_unequal_pools_carve_the_least_ranks_blocks_under_a_cap.
Two additive builder exports, RAD_ABI_VERSION untouched.
rad_weight_shard_span_parts: a row-sharded weight whose stacked parts
are not the same width -- the delta net's [q|k|v|z], 2048, 2048, 6144,
6144 rows on Flash-Next -- cannot take rad_weight_shard_span's one
[lo, hi), which is applied to every part and assumes them equal. This
takes a span per part together with each part's whole extent in the
container; share.cpp cuts every part by its own rows and refuses totals
that do not sum to the entry. It is how a rank declares an UNEVEN share
of the heads -- 6 of 16 K heads where three ranks take 6, 5 and 5 --
with nothing padded.
rad_weight_shard_zero: this rank's share of a row- or column-sharded
weight is zeros. weight_share returns the declaration's extents with no
rectangles; the loader stages the weight with a worker that writes
zeros (the route a checkpoint weight already takes from a container)
and reads nothing. It is for a rank the geometry gives no real heads
(next commit), which then declares the same program as its peers.
share_test holds the per-part cut and the zero share.
- The n-gram embedding table (Qwen3.8-Flash-Next's per-layer embedding) can be gathered on the
card. libr4d gains a row for embed_lookup_q whose output is the host gather's to the bit, and
--ngram-placement uses it: ram keeps a pinned copy in RAM that the cards read in place over the
link, so a step has no host work in it; vram puts the whole table on every card that holds it;
disk reads it from the container on the host, as before. auto takes the first of the three that
holds the table and prints why it passed over the others. Without a device kernel for the gather,
ram is the locked copy the host gather reads and vram is refused, as in 1.0.10.
- The pinned copy is not charged to RLIMIT_MEMLOCK; the host gather's locked copy still is, so
--ulimit memlock=-1 matters only on a run without the cards.
- The idea and a first kernel for the device gather came from Code000.
- Four-rank Qwen3.8-Flash-Next (PRs 14 and 16 by keptn42): the all-reduce runs fused with the
hyper-connection's write, and with the MoE gather in front of it, on decode and verify steps on
the exact wire. The routed experts are split in four classes, so every rank computes the same
share; moe_gemm_q_mod4 is the new grouped GEMM. The oracle now checks moe_gemm_q on w4nl and
w5nl containers.
- --embedding-placement and --ngram-placement, each auto | vram | ram | disk. The token embedding
can live in the pinned host pool, read in place over the link (from PR 17 by mechkbfan). An n-gram
table can be copied into locked RAM at load instead of read from the container (from PR 15 by
keptn42). auto takes the fastest tier with room once every other weight is placed, and startup
prints what it chose and why. A tier that cannot be honoured stops the start with the reason; the
embedding on disk and the n-gram table in VRAM are refused, since nothing can serve them.
- The expert_tiered placement no longer spends the pinned host pool twice when it falls back to
layer offload, and a lossy-wire request for a four-rank fused write is a selection miss rather
than a startup abort.
embed_lookup_q reads the n-gram table through a row cache and direct reads,
and about half of a step's rows are first-seen, so steps wait on the drive.
--ngram-table ram (default disk, unchanged) copies the table into locked
huge pages in the background, checks the copy against the mapping and then
serves the gather from memory. MemAvailable, RLIMIT_MEMLOCK and the cgroup
limit are checked first; if any is short the table stays on disk. The flag
reaches the plugin as an optional `resident` parameter of embed_lookup_q.
The embedding table is the largest model-level weight a dense model has --
248320 x 5120 in bf16 is 1.18 GiB a card at --tp 2 -- and a step reads only
its rows: M of them, a few KiB at decode. On a 16 GiB card that is VRAM the
KV cache wants, and no strategy could move it: layer_offload spills whole
layers only, and the derived split charges every model-level weight to VRAM.
--host-weights NAMES places the named weights in the pinned host pool before
any strategy runs. The site is DeviceZeroCopy: the pool is mapped, so the
lookup kernel is handed its device-side address and reads the rows over the
link in place. The unit is never movable, and every assignment pass and VRAM
total skips it through one MoveUnit::preplaced(), as they skip the mapped
tier.
- weight_footprint() counts hosted units in their own bucket, so a derived
split leaves them out of the weight budget and the KV pool gets the room
without stating --vram-*-mib
- only a weight embedding lookups alone read is accepted: a GEMM operand
(the head) would stream its shard every step, and is refused
- names are parsed at config time (comma-separated, trimmed, a trailing '*'
a prefix); each one that matches nothing is warned about by name
- a weight the host pool cannot hold is refused with the plan filled in, and
the placement report gives host weights their own line beside the pool
- GUIDE.md §4.3 and the flags table; engine info carries host_weights
Measured on Qwen3.8-27B-FP8 with its MTP head, 2x RX 9070 XT (16 GiB),
--tp 2, two sequences, a 2560-token step, the split derived:
table in VRAM --host-weights token_embd.weight
KV pool (tokens) 70,976 144,576
decode, 500 tokens 115.8 tok/s 115.7 tok/s
prefill, 22K prompt 2773 tok/s 2798 tok/s
Tests: place_test covers the footprint bucket, the pinned zero-copy
placement, the refusal of a GEMM's weight and of a pool too small; ctest
-LE 'gpu|oot' passes.
- Pinned host memory is locked in pieces of at most 1 GiB (issue 13): an Intel VT-d host in
scalable mode that refuses any single pin above about 2.5 GiB now takes the host pool with IOMMU
translation, and peer-to-peer access, left on.
- Four-rank all-reduce (PR 11 by keptn42): the tiered-int8 wire serves in-place calls, so
--tp 4 --tp-wire wht6 runs. At four and eight ranks the exact all-reduce is one-shot up to
524288 elements and two-shot above, chosen by the selector, so the band report names the kernel
that runs. The docs and the startup warning describe the four-rank lossy wire; eight ranks have
none.
- A VRAM allocation the card cannot take is refused, saying what the card has left and which
processes hold memory on it. ROCm 7.2's runtime crashes on such an allocation once a queue has
been destroyed, which every startup does.
- rad-convert --changed FILE: with --reuse, converts only the weights that read a changed
checkpoint tensor and copies the rest.
- 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.
- A text prompt to /v1/completions reads the model's control tokens as tokens, as vLLM and
llama.cpp do. A client that renders its own chat template can send "<|im_start|>user ..." and
the model sees the turn markers; they used to reach it as plain text. /tokenize and
/v1/embeddings read a text prompt the same way, and a prompt that already opens with BOS gets
no second one.
- The VRAM budget counts the engine's own hardware queues, which the driver backs with about
33 MiB of VRAM each, and the KV tiers' copy staging. Both used to come out of
--gpu-headroom-mib: Qwen3.8-Flash-Next ran with 9 MiB free under load against the 96 MiB it
asked to keep, the room a kernel's first launch allocates from. The startup receipt has a
"hardware queues" line.
- Running the whole model on the CPU (RADIANCE_HOST_DOMAIN=1 with no GPU visible) no longer
repeats words or answers differently at temperature 0. A decode step could read its input
token before the copy that delivers it had landed.
- The README says to clone the repository before installing.
- Up to 32 sequences a step on every model. The DSpark drafter (MiniCPM5) no longer rejects every
draft from the tenth sequence on, and the step batch's block tables and media staging are
charged to the VRAM budget instead of the headroom kernels load into.
- A tool parameter whose schema accepts no value ({"not": {}}, as TypeBox and Arktype export
`never`) is an argument no call writes, instead of failing the request. oh-my-pi's task tool
works.
- --served-model-name NAME and --override-chat-template PATH.
- The startup session count counts only the part of the KV pool that holds context.
- Compose files and README run --max-num-seqs 32 where it keeps a 200K-token request.