The checkpoint's tokenizer adds no BOS to a raw prompt, and without it some first tokens put
the model where bf16 departs from float32. Say so among the traps, with the two ways round it.
A layer's post norm, residual add and feed-forward norm are one launch, and so
are its feed-forward's post norm, add and the next layer's input norm: 50
launches for the chain's 144 at 24 layers. The op is asked for with
rad_op_declared, as gemma4 does; libref and libavx do not carry it and run the
rmsnorm / add / rmsnorm chain, as does the last layer's feed-forward. The arm's
output has its own buffer, since a join reads it beside x and writes h.
What LFM3 needs on gfx1151 beyond the rows libhalo has. The window kernel is
instantiated at (128, 4) as in libr4d: the decode leg keeps q_len <= 16 and
every longer q_len, windowed or not, lands on the new pair. rope_rows and
rmsnorm_rows are registered under their row-form names and launched as rope
and rmsnorm, as libavx and libref register them, so a plugin written for
libr4d's row forms resolves on this part instead of falling to the host.
Emulator cases as libr4d's (split verify, ragged window, fp8, non-causal with
a missing block, WMMA prefill with and without the window) and selftest
launches.
Geometry, the traps (the gate is one sigmoid, two rotaries, the window on the
sliding layers only, four norms a layer), what is refused, and which kernels
serve it.
A tiny LFM3 (conv, full attention, conv, sliding attention; window 8, conv
width 7) joins the engine tests every family runs: the golden against the
reference implementation, chunking and batching, libavx against libref,
decode against prefill, concurrent requests and speculation by prompt lookup.
Its golden is made by mklfm3golden.py from the modelling code LiquidAI ships
with the checkpoint, since transformers has no LFM3 class.
arch_test covers what the plugin declares for each layer kind, what it
refuses, and a step through both attention groups.
A request turns the control vector on with the `control_vector` body field, or the deployment's
default applies. A client that can only choose a model cannot send the field, and a gateway can
allow or refuse a model by its name but not a field. --control-vector-variant NAME lists
MODEL:NAME as a child of the model, the way an adapter is listed, and a request naming it runs
with the vector on whatever the default; the model's own name keeps the default. Unset, the
default, lists nothing.
The key needs --control-vector off or on. NAME keeps the rule model names keep (no ':' or
whitespace), and may not be a --lora adapter's name or the served model's own. The variant's
name with "control_vector": false is refused, since the request asks for both. With adapters
enabled the variant takes no adapter lookup, and /v1/load_lora_adapter refuses its name.
config_test 68, fleet_config_test 18 and server_test 191 cases pass, and the host suite
(ctest -LE 'gpu|oot') passes. On two R9700s at TP2 (Qwen3.8-Flash-Next IQR-V4 with the shipped
vector), through the front: /v1/models lists MODEL:uncensored and GET /v1/models/MODEL:uncensored
answers; a policy prompt to the variant is answered and to the model's own name refused; the
variant with "control_vector": false is a 400.
The llama-server compatibility payload carries model_path -- a path on
this machine -- to whoever asked, keyless included. It travels the same
class of information /v1/models already gates its `root` field with, and
that gate exists: a stranger enumerating models should learn the model's
name, not where its file lives.
The field now answers for an api-keyed request or a local operator and
comes back empty otherwise -- which is also what it already was for a
--model stdin read, so no client finds the member missing, only the
strangers learn nothing new.
New models. Recursive Flint (39.8B, about 2.5B active) by everplays (#422): `arch/flint`, as an
IQ8R container with rotated int8 experts or a four-bit one, with a sink-aware WMMA prefill
attention and the fused attention prologue at `rotary_dim` 0. Meta Muse Glimmer 30B by
launch80_assets (#423): bf16, an int4 trunk or IQ8R, its windowed vision tower, its DFlash
drafter, the ATEM tool dialect and context extension. Ling-3.0-tiny by RikshaDriver (#441):
served from its GGUF releases or as IQ8R on `bailing_hybrid`, with six more libr3d kernels. Block
FP8, MXFP4 and NVFP4 conversions of the three are not served. IQ8R containers of all three
(round to nearest, no calibration) are on Hugging Face under StillDeadcode: flint-iq8r,
muse-glimmer-30b-iq8r-dflash and ling-3.0-tiny-iq8r. They were checked for sane answers on two
R9700; nothing was benchmarked, and Muse Glimmer's pictures, video and tool calls were not tried.
Speech. Breeze-TTS-2 clones a voice from a reference recording and its transcript, with an
optional delivery direction, by farcryjohn (#436). The published Breeze container needs
converting again with the updated recipe before it can.
Tools. A model entry with `diagnose: DIR` runs a fixed workload on the engine instead of serving
and writes a report: step times, tokens a step, draft acceptance, TTFT and prefill rates by
category, concurrency and prompt length, and with `diagnose-baseline` a token-for-token comparison
against an earlier report (docs/DIAGNOSE.md), by Code000 (#418).
Scheduler. `mixed-step-target-ms` holds a mixed prefill and decode step to a service time, off by
default, by tnhnyzc (#413). `scheduler.stuck-exit` (60s by default, 0 never) ends the process when
the device has advanced nothing for that long, so a restart policy brings a hung server back
(#409, #415, #428).
Fixed. Draft trees with the int8 KV cache, which stopped Gemma 4 31B with DFlash2 on its first
request (#454, diagnosed by aelfwyne). The expert loan held at zero by a few leftover cache blocks
after long sessions (#455, diagnosed by thekk1). The mapped tier's pages kept in the page cache
across a load and a restore, by C_Tamas (#421). Replayed tool calls with blank arguments, and
arguments that are not JSON refused naming the call, by dschmitz (#444). The dashboard's card
temperature reads the junction sensor, by dschmitz (#453). The VRAM shortfall report says what the
KL mode needs, by baKon (#448). The out-of-tree plugin test builds its plugins in parallel and
takes its toolchain from the tree.
Plugin ABI 40: out-of-tree plugins need to be rebuilt.
Thanks to @everplays, @launch80_assets, @RikshaDriver, @farcryjohn, @Code000, @tnhnyzc, @C_Tamas, @dschmitz, @baKon, @aelfwyne and @thekk1.
Radiance becomes a multi-model engine: one process serves several models behind one port, loads
each when a request names it, parks it in host memory or restores it from its container, and
shares the cards between them (docs/MULTIMODEL.md). The configuration is one YAML file; the
command line flags are gone (`radiance --config FILE`, hot reload on SIGHUP).
Formats. IQ8R (rotated int8) and IQR-V4 replace FP8 and MXFP4 as whole-model formats, with an
int8 KV cache (`kv-cache-dtype: i8`) in place of the fp8 one. Containers whose weights are block
FP8, MXFP4, M2XFP4, NVFP4 or ParoQuant are refused at startup by the name of the first such
weight. Not served until they have int8 containers: GLM-5.3-Flash, Ornith-1.5, Sage-A1.5,
Nemotron-3.5-Bolt-74B, Ling-3.0-flash, drama-3 and Anima's FP8 container; Nemotron-3.5-Bolt-E4B,
the Gemma 4 31B DFlash containers and MiniCPM5-2B bf16 serve without their drafter. 1.17.0
serves all of them.
Speed. Chained launches for Qwen3.8-27B, Gemma 4, Gemma 3 and the small bf16 models, a new
Qwen3.8-Flash-Next container (IQR-V4 experts, int8 trunk) with its decode step and prefill
reworked, and a reworked adaptive draft window.
Deployment. deploy/compose has two fleet files, tp1.yaml and tp2.yaml, each with its
configuration beside it, in place of the per-model files. `host-pool-mib` is a model's host pool
in all, split among its ranks. The dashboard is rebuilt: an hour of history kept by the server,
each accelerator's memory by model, model states over time.
Merged since 1.17.0: Nemotron-3.5-Bolt-74B-A9B by keptn42 (#339); GLM-5.3-Flash on four cards by
AnimusNull (#397); chained launches for Flash-Next's decode step (#396) and preempted requests
keeping their prefix and place (#405) by mici81; --prefill-interleave auto by Code000 (#410);
eight more libr3d kernels and the w4a4 reference by RikshaDriver (#403, #407, #408); libr3d
large-BAR and E4M3 decode fixes by neuromanMD (#438, #439); int4/int5 decode tiles by Kezi
(#426); attention for Nanbeige 4.3 33B by everplays (#417); expert_stats_report.py by baKon
(#431). Fixed: #398, #402, #419, #437 (dschmitz's patch); added the metrics of #392, and
multi-model serving as asked for in #367 and #109.
Plugin ABI 39: out-of-tree plugins need to be rebuilt.
Thanks to @keptn42, @AnimusNull, @mici81, @Code000, @RikshaDriver, @neuromanMD, @Kezi, @everplays, @baKon and @dschmitz.
Cause: with --prefill-interleave 0 every step carries a chunk while a prompt prefills, so a
sequence already decoding gets one token group per chunk step. On Qwen3.8-Flash-Next fp8 (TP2,
MTP 3 drafts) with 8 sessions decoding while 64K-token prompts prefill, that is 12.3 tokens/s a
session against ~83 alone; with 4 such prompts at once, 5.4.
Change: not given, engine bring-up now serves --prefill-interleave auto:1: after a prefill chunk
that ran beside decoding sequences, decode-only steps follow for as long as the chunk step took.
--deterministic keeps 0 (a schedule that follows timing is not reproducible), as do KL mode and
generators (nothing decodes beside a prefill there); an explicit --prefill-interleave N|auto[:SHARE]
wins. Startup names the decision with its reason. The Config default stays 0, so a Scheduler built
directly (tests) keeps today's schedule; Config::prefill_interleave_set records the flag.
Evidence (decode tokens/s a decoding session / aggregate prefill tokens/s / TTFT), 8 sessions
decoding beside 64K prompts:
--prefill-interleave 0 12.3 / 3,664 / 17.3 s
auto (0.25) 23 / 3,181 / 20 s
auto:1 40.9 / 1,823 / 35.5 s
auto:2 50 / 1,166 / 56 s
with 4 concurrent 64K prefills: 0 5.4 / 2,934 / 64 s; auto 14.8 / 2,545 / 74 s; auto:1 33 / 1,395 /
137 s. auto:1 roughly triples a decoding session's rate for twice the prompt's time to first token.
BetterBench quick (short prompts, concurrency 1/2/4/8) shows no reliable difference between 0 and
auto: a short prompt is one chunk, after which nothing is held. config_test: the flag records that
it was given.
auto gave decode-only steps a fixed quarter of a chunk step's time. On the device (8 decoding
sessions beside 64K prefills, MTP on) that left decode at 23 tokens/s a session against 83 alone,
with 0.45 s gaps: two or three decode steps of ~40 ms per 0.45 s chunk. auto:SHARE makes the share a
choice (0 < SHARE <= 4); auto stays 0.25. The cap on decode-only steps rises from 16 to 64 so a
larger share is not cut off. config_test parses it, sched_test checks auto:1.
Cause: while prompts prefill, a sequence that is already decoding gets one token group per
step that carries a chunk. On Qwen3.8-Flash-Next at TP2 such a step takes a 2048-token
chunk's time (~0.4 s, more on the device under load), so decoders crawl at a few tokens/s
until the queue of prompts drains. --prefill-interleave N inserts N decode-only steps after
each chunk, but a fixed N costs the prefill whatever N decode steps cost, which grows with
the number of decoders, and is too few where decode steps are cheap.
Change: --prefill-interleave auto (default stays 0). After a chunk that ran beside decoding
sequences with its prompt continuing, as many decode-only steps follow as fit in a quarter
of a chunk step's time at a decode step's (running means of both, fed by step_finished from
the step wall times; at most 16; 1 until a decode step has been timed; 0 where a decode step
costs more than that quarter). The prefill gives up at most a fifth of its rate however
many sequences decode. The hold mechanics (no admission while held, steps issued ahead
count, the stager not armed for a held chunk) are --prefill-interleave N's, unchanged.
Under auto which steps carry a chunk follows the device's timing; a number keeps a
reproducible schedule. A chunk's cut and every row's computation are unchanged.
Evidence: sched_test interleave_auto_* (the count from given costs, the step shapes it
produces, nothing held for a lone prefill or when decode steps are too dear); config_test
parses auto. Host simulation of the scheduler (next commit), 32 x 128K prompts sent at
once, 512 tokens each, MTP 3, step costs fitted to a lone 2048-token prefill and to decode
alone: decode of the sequences decoding while prompts wait 6.5 -> 31 tokens/s each, last
first token 826 -> 875 s (+6 %), TTFT p50 453 -> 480 s; fixed N=2 gives 18 tokens/s at
the same cost. Device numbers: the commit that makes auto:1 the served default.
The layout rule chose the width split at four ranks and up before it knew the
weights' format. MoeFP8 refuses to slice a plain bf16 expert, so a container
of bf16 experts, or of MXFP4 with protected bf16 ones, that main serves at TP4
was refused unless --weights-disk-tier was set.
Read the container's encodings first, on every rank alike, and take the width
split only when every routed expert is MXFP4. The check declares no name map,
so no pinned graph moves.
GUIDE.md no longer says glm5next refuses --kv-cache-dtype fp8: it narrows the latent-attention
cache alone. ARCHITECTURES.md's KV group table gives kv_latent's E4M3 form and its host-tier size.
mla_attn takes an optional `kv_dtype`; at fp8_e4m3 the cache is E4M3 as kv_store_fp8 writes it at its
default descale of 1. mla_attn_fp8kv, mla_attn_matrix_fp8kv and mla_attn_rows_fp8kv are the bf16
rows' kernels with the cache element as a template parameter: the key load decodes E4M3 to bf16
(v_cvt_pk_f32_fp8, then the high half), which is exact since every E4M3 value is a bf16, so the
tiles and all arithmetic past the load are the bf16 instance's. The twins carry the bf16 rows'
constraints plus kv_dtype fp8_e4m3 and rank above all three bf16 rows, in their order. At uint16_t
the loads are the plain loads the bf16 kernels made; their launchers still refuse any cache that
is not bf16.
r4d_emu test_mla runs every kernel form (wave, matrix and its element load, rows forms 0-3) on E4M3
codes against its bf16 instance on the decoded cache: bit-identical on all 23 form/case pairs, and
each launcher refuses the other cache dtype.
Scheduler::preempt_back dropped everything a request had computed: unlike
close_request it published nothing, so a preempted 96.6k-token prompt was
computed again from its first token. The publish block of close_request is
now Scheduler::publish_prefix, called by both. Its blocks stay in the cache,
so a preemption that published gives eviction its rounds back (the decode
ensure loop and the overdue path) and the cache gives them back, the newest
last, before another request is preempted. preempted_can_prefill counts the
blocks the recompute adopts from the cache (pc_->lookup), so a preempted
request is not held back for room its own cached prompt already covers.
Shared KV with RADIANCE_KV_GUARANTEE=1 (nine Qwen requests preempted for
TranslateGemma's start pool): Qwen 587 -> 458 s, TranslateGemma 139 -> 80 s;
without the guarantee unchanged (340 / 58 vs 339 / 56). Test:
a_preempted_request_publishes_its_prefix; sched 187, engine_e2e and the
related suites pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
data/kernels_nemotronh.rkb holds 1009 cases recorded from the 74B skeleton (host only). With
kernels.rkb the report reaches 188 of 1031 rows (134 before), among them the gqa16 attention
rows, and 5226 cases pass.
The h128/gqa16 decode row stopped at q_len 4 (64 query-head rows a workgroup), so LiLiCorr's
verify of 7 drafts and the anchor (q_len 8) ran the query-tiled prefill kernel while a plain decode
runs the split-KV one: no verify row was the single-row decode at its position, and greedy text
with the drafter left the text without it within a few hundred characters at one and two ranks.
The gqa16 unit raises G8_MAX_DECODE_ROWS to 128, which compiles an eight-wave arm into the gqa8
body's decode launch; gqa8 and every other unit compile as before. The rows take q_len <= 8.
Selftest: the numeric cases at q_len 8, and attn_verify_bits_case, eight verify rows against eight
single decodes bit for bit at 120, 700 and 2048 keys (gqa 16, and gqa 8 for four ranks).
docs/ARCHITECTURES.md: past 2048 keys the split law partitions a verify and a decode differently,
so a near-tie can still flip greedy text.
nemotron-3.5-bolt-74b-w4a8.yaml (--tp 2) and nemotron-3.5-bolt-74b-fp8.yaml (--tp 4): 8 sequences
of 65536 tokens, LiLiCorr at 7 drafts, a bf16 KV cache, as the containers were measured. The
README's model table and docs/DOCKER.md list them.
NVIDIA's Nemotron-H hybrid from its bf16 checkpoint: 40 Mamba-2, 40 latent-MoE and 8 NoPE attention
blocks, the LiLiCorr drafter (7 drafts a step) and the C-RADIO tower with its projector, at one, two
or four ranks. docs/ARCHITECTURES.md describes the model. nemotronh_test: the drafter's KV heads at
two and four ranks, a speculative step at four, and the arena's sizing declares.
attn_dense at head_dim 80 without GQA (C-RADIO's ViT heads), and grid_embed_cpe, RADIO's cropped
position embedding: the table resampled half-pixel bilinear onto a square and cropped to the
grid, with the class and register rows ahead of each segment. libref, libavx and libr4d; ref_test,
avx_check_hand and selftest cases; docs/OPS.md.
act_mul's `act` takes "relu": with one tensor in both operands it is relu(x)^2, Nemotron-H's
ungated expert activation and its vision projector's. libref, libavx and libr4d.
ssd_update is Mamba-2's selective state update, a token at a time, with kda_update's rollback
contract: per_candidate, or the anchor form (one committed state and a scratch of per-token
records). libref, libavx and a libr4d kernel at a 128-wide state (r4d_ssd.hip, r4d_kda.hip's
register layout). ple_conv_bias is ple_conv with a per-channel bias inside the silu, Mamba-2's
conv1d, an op of its own so ple_conv's callers keep their operand list.
ref_test, avx_check_hand and selftest cases; docs/OPS.md.
For NVIDIA's LiLiCorr drafter:
- attn_paged_sink: attn_paged with a learned logit a query head beside the keys, in libref,
libavx and libr4d (the windowed kernels at h128, gqa 8 and 16)
- sample_logprobs without params writes every row (a drafter's candidate logprobs)
- lili_cand, lili_attn, lili_factor, lili_walk: the correlator's candidates and features, its
attention over the candidate lattice, the factor input and the greedy walk
ref_test, avx_check_hand and r4d_emu cases; docs/OPS.md.
A weight table reached every kernel as the tensor its planes decode to. libr4d's 4-bit grouped GEMMs
read each expert through their layout hooks (the w4 codes as R4D_DT_MOEW4, the E4M3 scales of
w4nl64a8h), so moe_gemm_w4a8 refused every case with "dtype this kernel does not serve", which
counts as a failure. Each expert is now laid out from its planes (the container's or
kf_draw_table's) and the entries are stacked one laid expert apart, while the oracle still reads
the decoded table. The container pass and the replay both do it, and a table counts as laid out
where the replay decides whether to compare exactly.
kfixture: kf_table_entry, kf_draw_entry_planes (kf_draw_table's per-expert draw, the same bytes)
and kf_lay_table. fixture_test: a table's experts are each laid out by the kernel.
IQR-V4 for Qwen3.8-27B:
- 15 recipes, data/recipes/q38-27b-iq2r-v4 .. q38-27b-iq8r-v4 (2.5 to 8 bits a weight), docs/IQR.md
"IQR-V4". On the quantisation board's private split every entry has 2-19% less KL than its V3 twin
of the same size (10-19% from 2.5 to 5.4 bits); IQ4R-L-V4 is 24% below the official FP8 checkpoint
at 55% of its size, and IQ2R-L-V4 (2.8 bpw) is below the MXFP4 checkpoint. Containers with the
DFlash2 drafter and the vision tower: huggingface.co/StillDeadcode/qwen3.8-27b-iqr-v4, served by
deploy/compose/qwen3.8-27b-iqr-v4.yaml (IQR_V4 names the size)
- GPTQ runs in act order inside the column trellis (tcq_order=1); the head-fed projections
(attn_output, ssm_out) take a bf16 scale a (row, 128) block from five bits up; widths from
measured prices
- A vocabulary-weighted lm_head: four width classes of the computed trellis (output.k<B>), the
tokens carrying the probability on the widest, decoded in one launch by logits_gemm_vocab with
16-bit head activations; 0.62 ms at one token on a TP2 rank against the int8 head's 1.02 ms.
tools/vhead.py and data/vhead/ build the class split from the bf16 checkpoint; libquant reads the
head's input Hessian for every class
- At IQ6R-L and up, the int8 lm_head is GPTQ'd against its input Hessian (same bytes, median KL
-8..-12%)
- embed_lookup_iqr takes u7/u8 tables under a zero point and the 4096-state trellis at 6 and 7 bits
- The whitepaper: radiance.stilldeadco.de/whitepapers/iqr-v4.pdf
Faster IQR kernels:
- The one-token GEMV gives each 16-row weight tile a block whose waves split K (5120 x 6144 at one
token 42.3 -> 30.0 us), with a biased-int fold, a v_perm activation broadcast and one code stream
a column
- A 16-token WMMA tile without block barriers serves 2 to 16 tokens (6- and 7-bit codes from one
token): a 4-bit weight takes 0.52-0.66 of FP8's time from one token to sixteen, 1.15-1.74x V3's
kernels from four tokens up
- The activation quantisers after the IQR gate_up (gemm_iqr_gated), the delta net's decode conv
fold (gdn_conv_recurrent_update_had) and the attention gate (gate_had_quant_i8g) are folded into
their producers, byte for byte the same codes: 128 fewer launches a decode step
- End to end on one R9700 (TP1, no speculation): IQ4R-S-V4 decodes one stream in 24.7 ms against
the MXFP4 checkpoint's 25.8 at five times lower KL; IQ3R-S-V4 is faster than MXFP4 at 1 to 8
streams. Prefill stays 8-9% behind MXFP4's 4-bit tile
Quantisation tooling:
- rescale=1 refits each row's scale to its codes after GPTQ; gptqsim measures a tensor's W16A16
form (tcq_code=mad16); an int8 trunk's calibration Grams can be recorded from the codes its GEMMs
read (--calib-dir, TP1)
- Fixed: the GPU trellis packs tcq_code=mad16's values two int16 a register
New models (merged):
- Spark 2.5 (spark25: bf16 and rotated-int8 IQ8R checkpoints, tensor parallelism with exact
collectives, reasoning and tagged tool calls) with its DSpark drafter (exact attention and Markov
walk ops), docs/SPARK25-IQ8R.md (@gostar)
- Ling-3.0-flash (bailing_hybrid: KDA, dense latent attention with mla_attn_paged, group-limited
sigmoid routing, the clipped SwiGLU and its MTP layer as a serial drafter), its w4a8 recipes and
compose files for four and two cards (@keptn42)
- Gemma 4 12B (gemma4_unified, served by the gemma4 plugins): its picture and audio embedders, a
picture's placeholders read both ways on the sliding layers as the model was trained (the
scheduler ends no prefill chunk inside such a run; RadBatch::n_bidi), windowed attention at
head_dim 512, the assistant head as MTP drafter at one, two and four ranks, suppress_tokens from
generation_config, bf16 and i8g compose files (@keptn42)
Merged:
- The prefill KV split sized by the live KV length rather than the model's max_ctx, recorded passes
keyed by their split geometry, and --gpu-memory-mib, the inverse of --gpu-headroom-mib (@gostar)
- Possessive quantifiers in tokenizer patterns where the greedy reading provably matches the same
(Ling-3.0's), and the Grafana dashboard's first screen of totals (@keptn42)
- The dashboard's history line (decode, prefill and TTFT over finished requests, kept in the
browser, JSON export), session extremes that age and reset on a restart, card-count changes, an
Advanced tab for the poll intervals, each request's prefill time from admission in /stats
(prefill_s), and the page's JavaScript run by tests/js (@Memoria)
- From PR #390: the file tier reads a routed layer with its own router's counts and waits for its
deposits; the stop-string hold-back keeps back only a tail that can still become a stop string
(before, every delta waited up to the longest stop's length); the sampler's planes are sized by
the step's token bound, the n-gram ban runs beside a drafter, and a top-1 row issues no candidate
cut (@Code000)
- The n-gram reader refills its reads as they land, and a decode gather waits on the other rank's
read of a row instead of reading it again (#369, @pokesjw)
- libr3d's GEMM structs value-initialised so the tape audit sees no padding (@RikshaDriver)
Added:
- --ngram-placement disk=DIR: the n-gram table read from its own file, DIR/ngram-<id>.bin, filled
from the container at the first start, on a faster or separate drive (#130)
Fixed:
- input_reference's H.264 round trip runs on libopenh264, which the image carries, at a quantiser
held at the crf (a side under 16 padded and cut back); a build with no H.264 encoder answers 501
(#163)
- kvtier: at most 1024 session rows under one shared first block; with one shared prompt the list
grew a row a request and prefill fell from 9k to 2.5k tok/s after 500K requests (#375)
- Speculative steps on an architecture with no pass-key callback keep their recorded passes under
the live-KV prefill split
Plugin ABI 35:
- RadArgs::kv_used_max_h and wgp_count, RadBatch::kv_used_max_h and positions_h, the optional
rad_arch_pass_key export and RAD_KERNEL_CAP_DYNAMIC_PREFILL_SPLIT; RadEncoderDecl::bidirectional
and RadBatch's n_bidi runs. The layout fingerprint table is regenerated; out-of-tree plugins
rebuild against 35
Thanks to @gostar, @keptn42, @Memoria, @Code000, @pokesjw and @RikshaDriver.
A run of more rows than `sliding_window` (1120 soft tokens against 1024)
is attended again with attn_paged_ahead, where the window bounds the keys
behind a row, as transformers' mask does. A shorter run keeps the
two-sided window, which is the same mask for it. Where no kernel serves
the ahead form, the two-sided one stays.
attn_paged_ahead and attn_paged_qrow_ahead are attn_paged at causal 0
where `window` limits the keys behind a row and every later key of the
sequence is visible. The windowed kernels take it as a launch flag (h256,
1 to 8 queries per kv head). Gemma 4's sliding layers read a picture's
rows with transformers' mask, the window AND (causal OR the same
picture), which this is for a picture longer than the window. Emulator
cases for the scalar, split and WMMA kernels.
use_bidirectional_attention "vision" (the 12B and the 31B): each
sliding layer attends a run's rows again over the cache up to the
run's end without the causal bound, over their causal result. The
global layers stay causal, as transformers' Gemma 4 masks, KerasHub
and vLLM have it. RADIANCE_MEDIA_BIDI=0 keeps every layer causal.
Score the walk on F32 head logits, reject non-I32 anchors in libref, and
assert the real proposal path. Near-tie policy vs the reference is still
open.
Hash architecture and quantizer inventories as well as kernels. Bind reusable references to model bytes, corpus, runtime, settings and data. Bind tail replay to scored reports and launch the verified candidate privately. Reject incomplete forced-length QoS responses. Add CPU-only positive and negative attribution tests; no GPU certification is implied.
Serve the Spark X2.6 trunk on IQ8R's rotated int8 grid. Six projection types a layer carry
fwht128-rotated int8 weights with a bf16 scale per 128 columns; activations are quantised into
the same 128-column groups and feed the `i8a8h` rows, exact GELU runs before the down
projection's own Hadamard quantiser, and the embedding, the two norms a layer, the head's norm
and the 16-row attention gate stay as they are. The descriptor is `w8a8_fwht128`, and the
container says `quantization_config.quant_method=w8a8`, `fmt=fwht128`.
`data/recipes/spark-x26-4b-iq8r.recipe` fits those weights by GPTQ against the model's own
calibration Hessians, which the BF16 plugin writes as RADGRAM2 files under `RADIANCE_CALIB_DIR`;
each layer's f32 [K,K] accumulators are 533 MB, so `RADIANCE_SPARK_CALIB_LAYERS=lo:hi` calibrates
a slice at a time into one directory. The output head is RTN. Column-sharded inputs and their
offsets must land on whole scale groups, so a rank with an unaligned span is refused rather than
served with misaligned scales: TP 1, 2, 4 and 8 align for these shapes, TP 3 does not for the
FFN-down shard. Calibration asks for TP=1, because the off-diagonal cross-rank terms only exist
on one card.
`tests/spark25_iq8r.py` compares a deterministic quantised fixture against the Transformers
reference, top-10 probabilities included, across cached decoding; `--tp 2` checks two fake host
ranks and `--wide-tp --tp N` the group-aligned attention and FFN shards for N from 1 to 8. Run it
under a GPU-denying device cgroup, as with the BF16 fixture.
Against this checkpoint's own BF16 container, 32 held-out chat, math, code and tool-call samples
and 31,391 positions, greedy with prefix caching off: 98.60% of positions keep their top token,
mean KL 0.00408, median 6.5e-5, p99 0.0496, p99.9 0.348, worst 11.88. The tail is the honest
part -- 13 positions above one nat -- and leaving the first twelve layers in BF16 takes the worst
to 0.247 with nothing above one nat, for about 12% of prefill and 17% of decode. One R9700, zero
cached prompt tokens: 11.8k, 11.8k and 11.3k tok/s of prefill at 1.1k, 4.4k and 9.9k-token
prompts, 93.7 tok/s of decode from a short prompt and 88.9 with a 4.4k-token context. 8.29 GiB of
BF16 weights become 4.52 GiB.
That comparison is distribution agreement against BF16, not a task benchmark, and the corpus the
Grams came from is public text held disjoint from the holdout by hash; no MMLU or GSM8K-class
number is claimed here. The numbers need the prefill softmax scaling per row rather than per
wave: while a row's rounding depended on its wave-mates, the quantised container was worse off
against BF16 than its own error explains.
Reduce attention-output and FFN-down shards in exact BF16, then widen the merged result for the FP32 residual. Keep the disjoint embedding reduction unchanged. Declare the reductions before the casts as well as issuing them in that order so buffer liveness follows the fixed graph. Clarify that TP can still differ from one card through sharded dot-product rounding.
Attention takes whole GQA groups, so a world that does not divide the KV head count still gets a
clean cut; above it the KV heads are replicated and a group splits between the ranks sharing its
KV head. Gate/up, down and the tied vocabulary take matching spans, and every query head, FFN
channel and vocabulary row belongs to exactly one rank at every world from 1 to 8.
The projection outputs are partial sums, so each block widens to f32 and issues an exact f32
all_reduce before the residual add, which keeps the single-card accumulation order.
tests/spark25_reference.py --tp N holds the sharded graph against the HF reference on N fake host
devices; the tiny fixture has 8 heads over 4 KV heads and 3584 vocabulary rows so worlds 1-8 all
get a nonempty shard.
The history split was sized by rows * heads and clamped by the step's longest table: at eight heads
one and two rows split 16 ways and three rows 11, so the k + 1 rows of a speculative verify summed
their partials in another order than the single-row decodes at the same positions, and Ling-3.0's
greedy text left the run without speculation from MTP depth 2 on. The count now comes from the
head count only; a scratch hook sizes the partials for up to 32 rows a launch, and a larger batch
takes as many splits as its scratch holds. r4d_emu's mla test holds verify launches of 2 to 32
rows to their single-row decodes bit for bit.
mla_attn_paged is the wave-per-(row, head) latent attention of mla_attn with the rotary part in
the score, one page table a sequence, the causal bound from cu_seqlens and seqused, and the head
gate in its store; a short batch splits the history and merges f32 partials as mla_attn does.
router_sigmoid_group_topk is router_sigmoid_topk's wave with the groups ranked first, a lane a
group. mla_project takes the head width as a template parameter; at 256 it is the kernel it was.
r4d_selftest holds each new row and the 128-wide mla_project to libref.