Independent review of fa118d8 / 14fb72c: no defect. Notes taken:
- RADIANCE_PREFILL_PIPELINE takes 1 / true as on and 0 / false as off (the old per-arch switches
took 0 for off; such a value must not leave the pipeline on); the header says that past two
ranks only the two-shot band is narrow and that eight ranks pipeline on the exact wire only; the
note says the switch allows the pipeline (gemma3 may still turn it off); "rad_arch.h" as the other
common headers include it; comment lines rewrapped.
- plugin_test resolves the all-reduce at `overlap` 1 against the real libr4d: the two-shot band
takes the lane row at three, four and eight ranks, exact and ti8; the one-shot band keeps the wide
row. arch_test: every spelling of the switch, off at two ranks in all three; no three-rank arch
case (neither test model's heads split three ways, nor do the real models' KV heads).
- r4d_selftest: gemv_wide's two column tiles at four row tiles and on the per-row scale.
- r4d_selftest: every timed pass is preceded by an untimed one. A fresh process otherwise times its
first pass while the clocks ramp up from idle (up to 1.5x slow, +-30 % between runs); two builds
of the same machine code read 13 % apart until both warmed.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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).
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 device rows for GLM-5.3-Flash's ops, at its geometry and at TP4 and TP8 slices:
- mhc_pre / mhc_post / mhc_contract, and mhc_pre_partial / mhc_pre_finish, which run mhc_pre's
own projection and finishing kernels with its chunk-sum order, so the pair is byte-identical
to mhc_pre at n 4096, hc 4, chunk 2048.
- kda_update_k128_v128_bf16, one, two or four value rows a wave, both state forms.
- dsa_pool_fp8, dsa_query_fp8 and dsa_score_fp8 (fp8 WMMA, 32 heads of 128).
- mla_attn: a matrix row whose WMMA tile holds a query's heads, or pairs eight heads of two
neighbouring queries over the union of their page tables, above the wave row; mla_project
with up to eight rows a thread or wave.
- gemm_nt_f32 and router_sigmoid_topk in tiled and one-wave-a-row forms; gemm_fp8a8_f32scale
and moe_gemm_fp8a8_f32scale read f32 block scales in place; moe_gemm_mxfp4a8 decodes e2m1 into
exact E4M3 bytes for fp8 WMMA, with an expert-major decode form and a wide prefill form.
- swiglu_clamped, and the device-only fusions of GLM's MoE block: swiglu_clamped_quant_fp8,
router_sigmoid_topk_scatter, and moe_scatter_inv / moe_gather_inv, which pass the gather's slot
table from the sort instead of rebuilding it.
moe_gather takes f32 routing weights in its column-per-thread kernel. The sort and the gather
kernels move from r4d_moe.hip into r4d_moe_sort.h and r4d_moe_gather.h, so the fused router and
gather instantiate the same code.
Every form that replaces another gives its bytes: tests/r4d_emu runs the kernels on the host
(test_f32, test_fp8f32, test_kda, test_mhc, test_mla, test_moefuse, test_moemx), r4d_selftest
compares them on a card against libref and against each other, and plugin_test pins the
mla_attn band. docs/OPS.md states what libr4d serves.
Co-Authored-By: John McDonough <18016200+JohnCMcDonough@users.noreply.github.com>
The exact all-reduce at eight ranks shared the three- and four-rank band: one-shot up to 524288
elements. The one-shot sends (ws-1)*N bytes a rank, seven times the message at eight ranks, where
the two-shot sends 2*(ws-1)/ws*N, and on eight R9700 (PCIe P2P, bf16, warm) the two-shot is the
faster from 16384 elements on. A decode step of eight streams with a draft window of six on
GLM-5.3-Flash (4096 wide, an out-of-tree plugin) reduces 48 x 4096 = 196608 elements: 232 us
one-shot, 68 us two-shot, where all_reduce was 20.7% of the step's device time.
R4D_AR_8RANK_ONESHOT_MAX_ELEMS is 8192, a multiple of 64, the eight-rank two-shot's DIV;
cArTsExact8 starts one element above it. The two-shot's block rule stops at 8 blocks at eight
ranks: every block handshakes with seven peers, and past eight blocks the extra flag rounds cost
more than the reduce bandwidth they add (4 blocks up to 393216 elements, 5 at 524288, 8 instead of
16 from 2097152). Both rows fold in fp32 in ascending rank order, so neither change moves a bit.
numel before after
4096 one-shot 22.5 us one-shot nb 4 12.8 us
16384 one-shot 39.7 two-shot nb 4 21.5
131072 one-shot 176.3 two-shot nb 4 52.3
196608 one-shot nb 16 233.2 two-shot nb 4 68.7
524288 one-shot 573.7 two-shot nb 5 177.4
2097152 two-shot nb 16 615.8 two-shot nb 8 610.5
8388608 two-shot nb 16 2460 two-shot nb 8 2489
16777216 two-shot nb 16 4999 two-shot nb 8 4824
At 4096 the rule already chose 4 blocks; the 22.5 us was the microbenchmark's, ten launches after
the host-side check, which now warms up with as many launches as it times.
Band edges are the union over every candidate row (core/plugin/bands.cpp), so the edge at 8192
splits the two-, three- and four-rank bands too. Both halves resolve the same row, kernel and
bits, at the cost of one more instance per (width, dtype) whose slot holds 8192 elements. Keeping
the edge to eight ranks would need the band builder to skip rows whose fixed constraints the
geometry rules out (world_size 8 here), a change to every op's bands for one row; plugin_test
states the new edges instead.
r4d_selftest runs the eight-rank rows (ar_oneshot_8rank_exact, ar_twoshot_8rank_exact,
ar_gather_8rank) through the width-parametrised cases of the three- and four-rank ones instead of
skipping them: the pattern's band edge is at 8192 and 8256 there, and a 9-word message must be
refused. --perfar8 numel [iters] [dtype] times both rows, one thread a card, at the block rule
and at 4 to 64 blocks, each checked bit for bit against the fold on every rank. On the cards:
ar_oneshot_8rank_exact 20 ok, ar_twoshot_8rank_exact 16 ok, ar_gather_8rank 5 ok.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- 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
R4D_AR_TWOSHOT_WIDE_MAX_ELEMS was 20971520 -- a 4096-token chunk of a 5120-wide residual -- and the
band above it went back to the one-shot, which sends (ws-1)*N bytes a rank where the two-shot sends
2*(ws-1)/ws*N. At the default --max-num-batched-tokens 8192, Gemma 4 26B-A4B's attention reduce is
8192 x 2816 = 23M elements and its feed-forward reduce, which carries both branches for their own
post-norms, 46M: both over the bound, so every full prefill chunk went one-shot at twice the bytes.
--profile-ops on 4x R9700, tp 4, a 20489-token prefill (chunks of 8192, 8192, 4105) fits one link
rate across all of it: the attention reduces 16.8 ms the three calls (two one-shot, one two-shot)
and the feed-forward reduces ~37 ms (all one-shot), 1.6 s of the 2.7 s prefill. The same rate with
every call two-shot is ~9 and ~19 ms: about 0.8 s less a 20k prefill.
The bound guards the kernel's int word offsets and nothing else -- the scratch already holds a
full message per slot (r4d_ar_entry.hip build()), twice what the two-shot uses -- so it is now
2^28 elements, 2^26 words at fp32. The fold is the one-shot's, fp32 in ascending rank order, so
the band edge moves no bits. Fewer bands also means one scratch set less: the old 20971520 band
was its own instance, ~335 MiB a rank at tp 4.
plugin_test: a 16384-token chunk is two-shot to its end, and the one-shot still takes a message
past the bound. r4d_selftest's three-rank pattern walks a 46137344-element message, past the old
ceiling.
Not yet run on the cards.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- #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
- 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
- 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.
- 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.