15 Commits
Author SHA1 Message Date
Deadcode 2a2b756371 radiance 2.1.0
New models. Recursive Flint (39.8B, about 2.5B active) by everplays (#422): `arch/flint`, as an
IQ8R container with rotated int8 experts or a four-bit one, with a sink-aware WMMA prefill
attention and the fused attention prologue at `rotary_dim` 0. Meta Muse Glimmer 30B by
launch80_assets (#423): bf16, an int4 trunk or IQ8R, its windowed vision tower, its DFlash
drafter, the ATEM tool dialect and context extension. Ling-3.0-tiny by RikshaDriver (#441):
served from its GGUF releases or as IQ8R on `bailing_hybrid`, with six more libr3d kernels. Block
FP8, MXFP4 and NVFP4 conversions of the three are not served. IQ8R containers of all three
(round to nearest, no calibration) are on Hugging Face under StillDeadcode: flint-iq8r,
muse-glimmer-30b-iq8r-dflash and ling-3.0-tiny-iq8r. They were checked for sane answers on two
R9700; nothing was benchmarked, and Muse Glimmer's pictures, video and tool calls were not tried.

Speech. Breeze-TTS-2 clones a voice from a reference recording and its transcript, with an
optional delivery direction, by farcryjohn (#436). The published Breeze container needs
converting again with the updated recipe before it can.

Tools. A model entry with `diagnose: DIR` runs a fixed workload on the engine instead of serving
and writes a report: step times, tokens a step, draft acceptance, TTFT and prefill rates by
category, concurrency and prompt length, and with `diagnose-baseline` a token-for-token comparison
against an earlier report (docs/DIAGNOSE.md), by Code000 (#418).

Scheduler. `mixed-step-target-ms` holds a mixed prefill and decode step to a service time, off by
default, by tnhnyzc (#413). `scheduler.stuck-exit` (60s by default, 0 never) ends the process when
the device has advanced nothing for that long, so a restart policy brings a hung server back
(#409, #415, #428).

Fixed. Draft trees with the int8 KV cache, which stopped Gemma 4 31B with DFlash2 on its first
request (#454, diagnosed by aelfwyne). The expert loan held at zero by a few leftover cache blocks
after long sessions (#455, diagnosed by thekk1). The mapped tier's pages kept in the page cache
across a load and a restore, by C_Tamas (#421). Replayed tool calls with blank arguments, and
arguments that are not JSON refused naming the call, by dschmitz (#444). The dashboard's card
temperature reads the junction sensor, by dschmitz (#453). The VRAM shortfall report says what the
KL mode needs, by baKon (#448). The out-of-tree plugin test builds its plugins in parallel and
takes its toolchain from the tree.

Plugin ABI 40: out-of-tree plugins need to be rebuilt.

Thanks to @everplays, @launch80_assets, @RikshaDriver, @farcryjohn, @Code000, @tnhnyzc, @C_Tamas, @dschmitz, @baKon, @aelfwyne and @thekk1.
2026-11-15 16:00:05 +01:00
Deadcode ddcb9c69bb radiance 2.0.0
Radiance becomes a multi-model engine: one process serves several models behind one port, loads
each when a request names it, parks it in host memory or restores it from its container, and
shares the cards between them (docs/MULTIMODEL.md). The configuration is one YAML file; the
command line flags are gone (`radiance --config FILE`, hot reload on SIGHUP).

Formats. IQ8R (rotated int8) and IQR-V4 replace FP8 and MXFP4 as whole-model formats, with an
int8 KV cache (`kv-cache-dtype: i8`) in place of the fp8 one. Containers whose weights are block
FP8, MXFP4, M2XFP4, NVFP4 or ParoQuant are refused at startup by the name of the first such
weight. Not served until they have int8 containers: GLM-5.3-Flash, Ornith-1.5, Sage-A1.5,
Nemotron-3.5-Bolt-74B, Ling-3.0-flash, drama-3 and Anima's FP8 container; Nemotron-3.5-Bolt-E4B,
the Gemma 4 31B DFlash containers and MiniCPM5-2B bf16 serve without their drafter. 1.17.0
serves all of them.

Speed. Chained launches for Qwen3.8-27B, Gemma 4, Gemma 3 and the small bf16 models, a new
Qwen3.8-Flash-Next container (IQR-V4 experts, int8 trunk) with its decode step and prefill
reworked, and a reworked adaptive draft window.

Deployment. deploy/compose has two fleet files, tp1.yaml and tp2.yaml, each with its
configuration beside it, in place of the per-model files. `host-pool-mib` is a model's host pool
in all, split among its ranks. The dashboard is rebuilt: an hour of history kept by the server,
each accelerator's memory by model, model states over time.

Merged since 1.17.0: Nemotron-3.5-Bolt-74B-A9B by keptn42 (#339); GLM-5.3-Flash on four cards by
AnimusNull (#397); chained launches for Flash-Next's decode step (#396) and preempted requests
keeping their prefix and place (#405) by mici81; --prefill-interleave auto by Code000 (#410);
eight more libr3d kernels and the w4a4 reference by RikshaDriver (#403, #407, #408); libr3d
large-BAR and E4M3 decode fixes by neuromanMD (#438, #439); int4/int5 decode tiles by Kezi
(#426); attention for Nanbeige 4.3 33B by everplays (#417); expert_stats_report.py by baKon
(#431). Fixed: #398, #402, #419, #437 (dschmitz's patch); added the metrics of #392, and
multi-model serving as asked for in #367 and #109.

Plugin ABI 39: out-of-tree plugins need to be rebuilt.

Thanks to @keptn42, @AnimusNull, @mici81, @Code000, @RikshaDriver, @neuromanMD, @Kezi, @everplays, @baKon and @dschmitz.
2026-11-14 22:32:28 +01:00
neuromanMD c6ef279a12 libr3d: branch-free, bit-identical e4m3_to_f32
The old decode looped over a subnormal's shift, so every fp8 staging loop diverged on gfx11. Normals
re-bias the exponent (+120), a subnormal m is exactly m * 2^-9, S1111111 is the NaN: bit-identical on all
256 codes (the old form is kept as e4m3_to_f32_ref for the check). W7900: the fp8-KV prefill attention
tile 71.6 -> 67.3 ms at 30K keys, output unchanged.
2026-11-11 22:31:33 +01:00
neuromanMD aafec91773 libr3d: mxfp4a8 -- do not scan a VRAM e8 plane from the host
e8_scan_once used hipHostGetDevicePointer to decide whether the host can read the e8 plane. It succeeds
for device memory on a large-BAR discrete GPU, so the host byte-scanned VRAM over PCIe (~12 MB/s measured
on a Radeon Pro W7900: 8 s for a 34816 x 5120 plane), and the 16-entry cache was smaller than a DFlash2
drafter's ~36 MXFP4 planes, so every issued pass rescanned most of them -- 70-120 s first requests and
~1 tok/s decode at long context. Scan only host memory (hipPointerGetAttributes), unbounded seen-set; the
kernel's e8 guard already gives reserved values the scale zero in device planes.
2026-11-11 16:53:54 +01:00
Asim Siddiqui e3d65f3a7c libr3d: fix the w4a4 activation row pitch (strides are elements, not bytes)
The launcher passed a->stride[0] straight as the byte pitch, but strides are
in elements (abi/rad_types.h): an int4 row of K nibbles is K/2 bytes. The
kernel read row 2*src instead of row src (row 0 correct, every other row from
the wrong source, and past the plane for larger M). The weight side already
converts (r3d_tab_of's s0 = stride*bits/8, the kernel uses w_ld/2); the
activation now does too. The libref reference had the same bug and is fixed on
the w4a4-libref-wip branch, so the two now agree on the correct row.

Missed because r3d_selftest checks finiteness only and ref_test checks status
only on the libref sweep geometries.
2026-11-05 14:59:08 +01:00
Asim Siddiqui 4bd9c39728 libr3d: accept a null params in sample_logprobs, per the canonical schema
The canonical sample_logprobs schema declares params optional (an absent
optional operand arrives as null data, rad_abi.h), and libr4d's kernel
already honours that (no params = every row). libr3d's launcher refused a
null params and its kernel dereferenced it unconditionally, so since the
canonical schema went optional (3b278dc) the engine refuses the whole
libr3d plugin at load: op 'sample_logprobs' has two different schemas.

Mirror libr4d: the kernel's flag test gains a null guard (no params:
every row runs), the launcher no longer refuses null, and the row's spec
marks the operand optional.
2026-11-05 21:18:00 +11:00
Asim Siddiqui 036bd8fec0 libr3d: register the fused gdn_conv_recurrent_update row
The kernel and launcher (libhalo's, r3dh_gdn_recurrent_update.hip) have
been in the tree since 1.16.0, but no row referenced them, so the op
always landed on libavx's CPU row. Register them:

- the op's schema (12 params, 18 operands: the convolution's inputs,
  then the recurrence's minus q, k and v, which the fused kernel never
  materialises), identical to libavx's and libref's;
- the constraint set: q_len >= 1, head_k 128, head_v 128, conv width 4;
- the row at R3D_PRIO_ONLY, NOTUNE (one kernel configuration), no
  layout hooks;
- the selftest case (hand-built, as the sibling GDN rows): T=4, Hg=2,
  H=4, K=V=128, window 4, state f32; o_q and o_scale absent;
- the README row, the table count (111 rows over 72 schemas) and the
  decode-path prose.

rad-schemas over the four libs: 244 shared ops, 0 disagree (the new
schema matches the canonical registries). gfx1102 (RX 7600):
r3d_selftest 118 rows / 0 failed, the new row runs with 8 output
planes finite; ref_test 153,146 checks / 294 cases / 0 failures.
2026-11-05 09:49:06 +01:00
Asim Siddiqui 87c604370d libr3d: add 8 kernels — MoE GEMM (w4a8, w4a4, mod4), dequant_w4, row_topk_merge, ngram_ids, gemm_nt_q_bias, gemm_nt_q_short
moe_gemm_q w4a8: the 2-class MoE GEMM with bf16 weight scale and bf16
output. E4M3 activation codes, bf16 weight scale (not f32), single
16x128-block i32 wave-matrix config. The w4a8 dtype row is folded into
the existing moe_gemm_q op as a dtype variant, not a separate op.

moe_gemm_w4a4: the 2-class MoE GEMM with int4 activation codes and
int4 weight codes. i32 wave-matrix core (no E4M3 decode table),
symmetric int4 x int4 multiply-accumulate. Single fixed 16x128-block
config.

moe_gemm_q_mod4: the 4-class MoE GEMM. Experts route to class e%4
(entry e/4 within the class). Same E4M3 wave-matrix core as
moe_gemm_q_e4m3, with 8 individual R3dTab parameters (4 weight + 4
scale tables) to stay within the gfx1102 kernel parameter limit.

dequant_w4: packed int4 weight to row-major bf16. Each 32-bit word
holds 8 int4 codes; the scale is f16 in the low 16 bits, the zero
point is -(1024+zero) as f16 in the high 16 bits. One warp per 32
output elements.

row_topk_merge: top-R of gathered per-rank candidate sets. Each rank
contributes a sorted candidate list; the merge selects the top-R
global candidates by score. int32 ids are bit patterns in an f32
plane (memcpy, not cast).

ngram_ids: hashed n-gram row ids for PLE (Per-Layer Embedding).
Computes the row index for each n-gram in the sequence using a
FNV-1a hash folded into the embedding table size.

gemm_nt_q_bias: narrow fp8 GEMM (M <= 16) with per-column bf16 bias
fused into the epilogue. The bias is added to the f32 accumulator
before the single bf16 narrowing at the store. Extends
r3d_gemm_nt_q_fp8_ex with a bias parameter.

gemm_nt_q_short: narrow fp8 GEMM (M <= 16) for short-prompt decode,
unsplit K. Forces sk=1 (no K-split) in r3d_gemm_nt_q_fp8_ex. The
short-prompt path avoids the K-split overhead when K is small.

The two narrow fp8 rows carry the tGemmM16 tune matrix (sk 0/1/2/4/8/16,
wv 1/2/4/8, nt, the two E4M3 decode impls, 16-row tiles) like the other
gemm_nt_q rows, measured per card by rad-tune.

The six new ops adopt the canonical op schemas. The engine enforces
schema identity across kernel libraries: the first library to declare
an op fixes its schema, and a disagreeing plugin is refused whole at
load. libavx loads first, so the specs match the canonical registries:
- moe_gemm_q_mod4: 15 params / 13 operands (the eight weight tables at
  the RAD_OPD_WTAB role); the launcher reads a_order (token/sorted),
  requires group = 128, checks the activation's row count against the
  output, and refuses unequal class shapes (N_1..K_3 differ from N/K)
  as moe_gemm_q does with N_odd/K_odd.
- ngram_ids: 4 params / 11 operands under the canonical names; state
  required; per, W and the ids pitch derive from the operand shapes.
- row_topk_merge: 4 params (+dtype) / 3 operands.
- gemm_nt_q_short: the family's four optional params (pb1, pb2,
  split_n, w_rb) and two optional operands (a_sum, b_ref).
- gemm_nt_q_bias: a_scale required, not optional.
- dequant_w4: the dtype param, twos required, the scale operand named
  ws; the launcher refuses zero rows with RAD_E_SHAPE like every
  other op.

A kernel audit found five launcher param reads the engine can never
populate (the spec's params plus the row's tune axes are the only
sources): pb1/pb2 in the gemm_nt_q_bias launcher, splits in the decode
attention path, and nt/kb/sk in the tiled rows that tune only impl.
Each always took its default; the reads are deleted, behavior-
identical.

All 8 verified bit-exact on gfx1102 (RX 7600, box card 2).
Selftest: 117 rows clean, 0 failed. rad-schemas over libavx, libr3d,
libr4d and libref: 244 shared ops, 0 disagree.
2026-11-05 09:49:06 +01:00
Asim Siddiqui 702a0970cc libr3d: value-init the GEMM's by-value structs so the tape audit sees no padding
The recorded-pass audit (Ctx::tapes_agree -> a_tape_diff) byte-compares the serialized
kernel arguments of a pass against its recording, and on the first disagreement it concludes
"the pass depends on something the recording's key does not carry" and stops the engine. On
gfx1102 with the dspark drafter that self-stop fired on the third request:

  E rank 0: draft pass -1 at 23 tokens issued differently from its recording after 0 plays,
    so the pass depends on something the recording's key does not carry:
    record 1: kernel fp8a8_tiled_kernel: its arguments differ at byte 28

Byte 28 is not a pointer offset. With ActQ = 24 bytes (a pointer, a long long, an int, and a
4-byte trailing hole) and WQ = 64 bytes (with a 4-byte trailing hole), the argument block is
a[0,8) aq[8,32) b[32,40) h[40,104) ...; inside aq, gmode ends at 28 and bytes 28..32 are
padding. The audit found the first difference at 28, so every real field before it -- a,
aq.scale, aq.row, aq.gmode -- was identical: only the padding differed.

The launcher built those structs with aggregate-init (ActQ aq{ptr, ll, int};), which
initializes the three members and leaves the trailing padding indeterminate. HIP serializes
the whole struct, padding included, into the kernel-argument block, so the record and the
audit each captured whatever garbage was on the stack. Whether the two garbage patterns match
is a coin flip per run -- a Heisenbug that only surfaced once the stack states diverged.

Value-init the structs (ActQ aq{}; WQ h{}; MxWQ h{};) and assign the fields: value-init
zeroes the entire object including padding, aggregate-init does not. The kernel reads none of
the padding, so behaviour is unchanged -- only the serialized bytes become deterministic, and
the audit can no longer mistake a padding byte for a missing key. Applied to both the
fp8a8_tiled and mxfp4a8_tiled launchers, the only two libr3d kernels that pass a struct by
value.

Verified on the box (RX 7600, gfx1102): r3d_selftest 109 rows clean, 0 failed; the rig with
the dspark drafter armed (speculation at its auto depth) now serves back-to-back requests
past the point that self-stopped it before, with no schema or tape refusal.
2026-11-03 19:06:47 +01:00
Deadcode 769b4c64a6 radiance 1.16.0
New models:
- Hunyuan3D-2 (hunyuan3d2): an untextured 3-D mesh from one picture of an object. DINOv2-giant
  over the picture, a FLUX-shaped flow-matching DiT (16 double-stream and 32 single-stream blocks
  of 1024) over 3072 latents with both guidance branches in one step, and the shape VAE's
  geometry decoder. Converted from tencent/Hunyuan3D-2's hunyuan3d-dit-v2-0 folder with
  data/recipes/hunyuan3d-2-bf16.recipe (fp16 cast to bf16, 4.4 GiB, one card). The licence
  (Tencent Hunyuan 3D 2.0 Community License) does not cover the EU, the UK or South Korea
- Served on Hunyuan3D-2's own API server routes, so its Blender add-on and scripts work
  unchanged: POST /generate answers with the mesh, POST /send runs it in the background and
  GET /status/{uid} reports steps_done and then the file. GLB, OBJ, PLY or STL; the field is
  sampled coarse to fine as FlashVDM's hierarchical decoding does, or densely with
  "volume_decoding": "dense"; seed, steps, guidance and octree_resolution as the reference.
  Texturing (Hunyuan3D-Paint) is refused for now (docs/GUIDE.md §5.17)

Merged:
- libr3d rewritten for RDNA3's wave matrix (@RikshaDriver): bf16, f16, int8-activation and vocab
  GEMMs retiled to 16x128 blocks with a double-buffered k-walk; fp8, mxfp4a8, w2a8, w4a16, w5a16
  and w8a8 quantised GEMMs and the gated form; grouped MoE GEMMs (bf16, fp8a8f32, mxfp4a8); the
  norms and quantisers, the QSA state ops and the MoE router, scatter and gather. Brought onto the
  op contract before release (13 schemas, the MoE GEMMs on weight tables with a_order and bf16
  output, moe_gather's gate pitch, moe_scatter above 1024 slots, the mxfp4 m16 dispatch) and its
  gated-delta-net kernels replaced by libhalo's; every op it serves now passes rad-kbench against
  libref on a gfx1151, and r3d_selftest checks its MoE GEMMs by value
- Gemma 4 31B: asymmetric int5 linears (w5a8i8 above 64 rows, w5a16 up to 64, a scale per 128),
  the norm, GELU and two-rank all-reduce junctions at quant_act_i8g's grid (rmsnorm_quant_i8g,
  gelu_mul_quant_i8g, ar_rmsnorm_quant_i8g) so the prefill overlap runs on the i8a8, a4 and w5
  trunks, and compose files for the 31B i8g, heretic-ara-i8g and w5 on two cards (@keptn42)
- The norms' lane sum reads eight at a time: TranslateGemma 27B decode is back from 225 to 239
  tok/s a stream at four streams, bit for bit the same output (@mici81)
- The head-256 prefill softmax rescales each row by its own maximum, not by a vote of the wave, so
  a row's rounding no longer depends on which rows share its launch (@gostar)

Anthropic Messages API:
- /v1/messages takes min_p, presence_penalty, frequency_penalty, repetition_penalty and
  repeat_last_n as top-level fields with the chat path's names, ranges and meaning, so clients that
  speak only the Anthropic format (Claude Code) can set a model card's sampling, such as Qwen's
  presence_penalty 1.5. The penalties count the last repeat_last_n tokens of prompt and reply (64
  by default, --repeat-last-n), as llama.cpp does

Plugin ABI 33:
- Shape generators: rad_declare_shape_generator, RadShapeGenBatch (RadBatch::sgen_b) and
  RadArchProbe::gen_shape, with the SCOND, SSTEP, SLATENT and SQUERY passes. The layout
  fingerprint table is regenerated; out-of-tree plugins rebuild against 33
- New op point_fourier ([x | sin(x 2^j) | cos(x 2^j)], times pi on request) in libref, libavx,
  libr4d and libhalo
- A checkpoint for a model that reads no text gets a one-token vocabulary

More cards from the one image:
- stilldeadcode/radiance now carries libr3d (RDNA3: gfx11-generic, every gfx11 chip) and libhalo
  (Strix Halo: gfx1151, preferred there over libr3d) beside libr4d (gfx1201). docker/build.sh and
  the Dockerfile default to gfx1201;gfx11-generic;gfx1151
- libr3d loads only where the KFD topology lists a gfx11 card and libhalo only where it lists a
  gfx1151; a process without /dev/kfd sees neither. On an RDNA4 card, or with no card at all,
  the image therefore behaves exactly as before, and rad-convert lays weights out as before
- libhalo and libr3d now declare gemm_nt_q's w_rb, and libhalo gram_accum's upper, as libr4d
  does. Before, any build carrying them refused both at load ("9 parameters vs 8"), so a build
  for Strix Halo or RDNA3 had no device kernel library
- libhalo does not yet have every op libr4d added after it was ported (the IQR rows, Pixtral and
  Ministral rope, the tree-attention and DFlash-tree rows, among others); halo_parity lists them
  and is left out of the image's test stage until they are ported

Fixed -- container and checkpoint parsing:
- A .rad expert-1 entry inside or before expert 0 is refused; a vocab section whose count names
  an array at offset 0 is refused rather than read from the file header; offset checks no longer
  wrap; header tables must sit on their element alignment
- An imatrix array of arrays (unbounded recursion) and a safetensors header naming a tensor twice
  are refused; a failed RadWriter undo says the container is damaged; a tune cache measured on
  another machine is refused, as its format contract says

Fixed -- plugins:
- Two plugins declaring one op with different parameter roles are refused; before, the core
  applied the first one's chunk/capacity roles to the other's rows
- Null tables behind nonzero counts, unknown roles, keyless parameters or constraints and more
  operands than an issue carries are refused by name at load; on the host backend device rows are
  dropped even when no fat binary was registered; rad-schemas checks the ABI layout fingerprint as
  the engine does

Fixed -- device:
- Stream slots are recycled under a new generation: before, 1024 stream create/destroy cycles
  (LoRA loads, lanes, uplinks) made every later rad_stream_create fail
- A stream whose drain fails keeps its queue and kernarg ring instead of freeing them under the
  card; the kernarg ring no longer leaks when its access grant fails; a block over 1024 work-items
  is refused
- rad_dev_free takes the allocation off the ledger the pin-cap check reads; the host backend
  charges pages to the card the range was reserved for

Fixed -- engine and server:
- Two NDEBUG-only asserts (runtime-window totals, ring blocks per group) are refusals; a
  plugin-declared lcm past int64 saturates so the quantum check refuses it; every share view rect
  and part span is bounded by its entry
- Video: the timestep regions hold the refine rungs a schedule appends, a zero-frame encode is
  refused, /v1/videos bounds each side before the area product, and a realtime session needs a
  clip length to cut a turn at

Fixed -- kernels and quantisation:
- A trellis run shorter than a state's codes (tcq_rows=1, or N % tcq_rows == 1) read its seam
  out of bounds; the encoder now refuses it as the decoder does, and tcq_rows below one state is
  refused at parse
- qsa_tail_store bounds its slot index by the state plane (libr4d and libhalo); paged attention
  refuses kv_heads <= 0; libavx row_amax skips a NaN as libref does

Fixed -- tools:
- pad_tp.py no longer runs cp through a shell with shard names from the checkpoint's index
  (quote injection, path traversal): names must be bare file names
- ops_doc_check.sh runs under mawk (Ubuntu's awk); rad-kbench --max-cases/--max-bytes are checked
  integers; oot_plugins fails unless the installed replay passed a case and failed none

Thanks to @RikshaDriver, @keptn42, @mici81 and @gostar.
2026-11-02 18:35:02 +01:00
Asim Siddiqui 34c52ebe96 libr3d: the RDNA3 (gfx11) wave-matrix kernel plugin
A self-contained HIP kernel plugin for gfx11 (RDNA3) that exposes the
libref-declared ops as device rows the engine can tune and dispatch:

  * GEMMs (bf16, f16, int8-activation, vocab) retiled to 16x128 on the
    wave-matrix (WMMA) builtins. The retile removes the 8x wave
    redundancy of the naive tile and stages the activation once per
    16x128 block; the 16-row and 64-row forms share the stage. The k-walk
    double-buffers the 128-deep tile (the next tile stages while the
    current one multiplies), on the m64 and tiled forms.
  * Quantised GEMMs: fp8-e4m3 x e4m3 (tiled and ALU), mxfp4 x a8, w2a8,
    w4a16, w5a16, w8a8 (the prefill heights 17..127 on the wave matrix),
    and the gated (swiglu) form. E4M3 decodes exactly to f16 through a
    256-entry LDS table; the WMMA fragments bit-cast the staged halfs
    (a uint16-to-_Float16 assignment is a value conversion, not a
    reinterpret).
  * Half-precision-accumulate arms (acc = 1) on the m64 wave matrix:
    the f16/bf16 16x16x16 builtins with the compile-time opsel half
    select.
  * Grouped MoE GEMMs (bf16, e4m3 with F32 block scales, mxfp4a8, w4a8),
    retiled the same way, over the run-walk / gather structure.
  * Normalisation (layernorm / rmsnorm) and the quantisation ops.
  * GDN linear-attention, the QSA/KV state ops, and the MoE
    router/scatter/gather family (router_topk_scatter, router_sigmoid_topk
    with the correction bias, moe_gather, moe_gather_inv; the top-k
    router runs to n_expert 512).

Every row implements an op libref declares; the selector (tune) picks
the implementation and the NOTUNE rows carry the untuned default.
Selftest-clean (121 rows, schema + finiteness); values verified against
CPU references per op.
2026-11-01 20:56:25 +01:00
Deadcode 9ed3ef7a7b radiance 1.15.0
New models and formats:
- IQR for Qwen3.8-27B: weights on the int8 grid under GPTQ, a trellis down each GPTQ column
  (IQR-V2), and IQR-V3, a computed trellis code under one scale a row, kept at its codes' width in
  VRAM and decoded in the GEMM; 15 IQR-V3 recipes from ~2 to ~7 bits a weight
  (data/recipes/q38-27b-*-v3.recipe, docs/IQR.md)
- libhalo: a kernel library for Strix Halo (gfx1151), preferred there over libr3d
- Nemotron 3.5 Embed 1B and 8B (nemotron35_embed): text and image embeddings through a Pixtral
  tower, on the card and on the CPU
- Nemotron 3.5 Rerank 8B
- /v1/systemone: Cloudflare's clef and clef-flash, Convai Innovations' Laya and Mica beside
  LiquidAI d1; scored steps read the candidates' logits from the head table with no lm_head pass
- LFM2's 8-bit trunk: block-fp8 or int8 linears with the fused producers, and the d1-3B recipe
- DeepSeek-V4.1's reply format with DSML tool calls and typed argument tags

Weights on the drive:
- The file tier reads only the experts the pass routes rows to; the draft head's weights stay in
  the host pool
- A hot VRAM cache for routed experts read off the drive, reads deposited straight into free host
  pool slots, and copyless evictions; the file tier's counters are now ssd_*
- GLM-5 Next shards its routed experts by expert, not by width, so they can live on the drive
- The stall watch counts drive reads as progress, and the DMA lane's room check reads the lane's
  own completion fence

Quantisation tooling:
- --calib-corpus, --calib-dir and --calib-layers record each linear's input Hessian; beside
  --kld-record the reference's own run records them
- --kld-top N records a sparse KL reference (the N most likely tokens and the tail's mass)
- GPTQ in a third of the time with the same codes, trellis GPTQ on the card, vector codebooks
  with coordinate descent, and rad-convert --reuse repeated, each container supplying what the
  earlier ones lack

Speculation:
- Prompt lookup alone (--spec-ngram K, --spec-ngram-min/-max): each sequence keeps an index of its
  n-grams, and a proposal is verified only when its measured step cost says it pays;
  --draft-window adaptive follows it

Speed:
- IQR decode: the narrow tile splits K for four times the int8 tile's waves and folds each 128-K
  block once; at 8 tokens down and the output projections run in 0.61-0.82x and 0.70-0.92x FP8's
  time (2-6 bits); IQ6R-S-V3 with its DFlash2 drafter steps in 26.3 ms at TP2, against 29.4 ms
  before and FP8's 27.3
- Qwen MXFP4 feed-forward: the gated fold up to 16 rows, not 8
- libr4d: the gated prefill fold, the short-prompt split row, and the rows forms of rmsnorm and
  rope; KLATE again for the head-256 gqa6 paged prefill; gram_accum on the matrix cores

Features:
- /health, /v1/health and /ping answer 503 with "status": "stuck" once the device has advanced
  nothing for a minute or a queue has faulted, so a supervisor can restart a wedged server (#356)
- --image-gen-max-pixels and --image-gen-max-refs size an image generator's buffers (#344)
- The startup report lists only the options not at their default, with a count; -v lists all
  (#250)
- --preempt-wait-ms bounds how long a preempted prefill waits for its whole-recompute room
- --placement layer_offload spills dense layers so one --max-model-len sequence fits
- Startup refuses amdgpu with CWSR off and says how to fix it;
  --proceed-with-incompatible-configuration starts anyway under an UNSUPPORTED banner

Fixes:
- The n-gram read-ahead hands each row to the reader once and reads only as far ahead as the row
  cache holds, and pauses while decode reads: about one drive read a row instead of two (#355)
- A file-tier window reads each of its runs once, not once a run per run
- The decode split law's verify floor is bounded by the batch's workgroups: max_seqs 256 no longer
  declares 64x the scratch (#342)
- A prefetch DMA list's mark stays out of the signal pool until the engine has read it, and a
  prefill stage copies only the blocks its own tables name (#343)
- The split-KV row sum is read with fetch-inactive (#328)
- LFM2 on the host backend: libref and libavx serve the row-form ops it declares (#348)
- The preempted-prefill gate skips a KV group that holds no blocks (#352)
- Every request entry point bounded, gated and sanitised (JSON depth, invalid UTF-8, control bytes
  in the log, the dashboard's CSP, cross-origin browsers on the loopback-only routes); a prompt id
  outside the vocabulary refused at admission; --api-key "" refused at startup
- The telemetry the HTTP thread reads is atomic
- An RMS norm row no longer depends on how many rows its launch carries; prefill attention's
  rescale is decided by live rows only
- A --kld-record prefill chunk that finishes no sequence gets its logits on a tied-head model
- A kernel's lazily made counter block is zeroed outside the lock other ranks take (a TP2 first-step
  hang)

Changes: Plugin ABI 32. Every plugin exports a layout fingerprint of the ABI structs and the loader
refuses a plugin without it or with another (#302), so out-of-tree plugins must be rebuilt.
Appended: RadBuildCtx calib_* and gen_max_*, RadArchProbe gen_max_*, RadBatch score_only and
plugin_words, RadDeviceProps::unified, RadChatFormat arg_json_value_prefix.
2026-10-30 22:01:01 +01:00
Deadcode 4a61d7296b radiance 1.14.0
New models and formats:
- libr3d: a kernel library for RDNA3 (gfx11) cards
- nomic-embed-text-v2-moe (the nomicbert plugin)
- Gemma 4 E2B with its per-layer MLP width, and Google's unmodified E2B/E4B directories in bf16
- DeepSeek-V4.1-Flash converted straight from its release: the Engram tables, the fused imatrix and
  rad-convert --chat-template for a release that ships no template
- GGUF Q8_0, Q4_K and Q6_K tensors import as their planes; rad-convert writes them without a recipe
- Qwen3.8-Flash-Next-FP8 converts and serves through qwen4exp_fp8

Speed:
- hc_read's decode kernels as one grid (34.7 -> 25.2 us at 4 rows) and its tiled up-mix pipelined
- gemm_fp8a8: the narrow form's scales staged through LDS (Flash-Next int8 at 32 rows 83.6 -> 68.3
  us), the gated three-tile form at 8 waves (gate_up at 48 rows 272.9 -> 180.6 us)
- Qwen3.8-27B: the delta net's out-projection read beside its decode recurrent update (x1 19.40 ->
  19.10 ms a step), and the verify's split-KV attention sized by context depth (x3 at 180K 42.4 ->
  40.3 ms a step)
- Hy-Memory (HYV3) decode: fused QK norm, RoPE and KV store, residual adds folded into the norms,
  coalesced one-token expert GEMMs
- spechub: the coupled verify walks the live candidates only (151 -> 31 us a launch)

Speculation:
- DFlash2: lossless coupled acceptance at T > 0 (--draft-coupling on)
- A block drafter's proposals verified as a tree, on by default for the Gemma 4 31B's DFlash2, with
  a block-16 tree that runs its short block under load

Features:
- Decode-hot residency: --draft-expert-placement host, --expert-profile, --expert-pin-top, and
  --expert-stats FILE for the routed experts each layer selects
- --ngram-placement ram=DIR: one n-gram table shared by engines on separate cards
- Prefix cache: --prefix-resume exact (default) resumes a hit on the cold run's own chunk grid, so it
  answers bit-identically; snapshots at a head other prompts share, from 528-token prompts, and for
  tip-only one drafter window below the tip; hits on models whose KV groups have different block
  sizes; the snapshot store keeps a floor of 8 ahead of --host-headroom-mib
- Typed tool-call argument tags; rad-chatparse --request renders and reads back one request as the
  server does
- MiniMax-H3: keyframes ride a latent upscale
- Gemma 3's fused all-reduce junction on the lossy wire

Fixes:
- A speculative step shorter than its band (an MTP step of 4 rows at gqa 8) no longer stops the
  engine with a scratch refusal at issue (#293)
- --p2p off: prefill back to 1.12.0's rate; 1.13.0's push check read a host-memory slot over the link
  twice (#323)
- A chat template that cannot render a conversation is refused at load, not mid-request
- imatrix entries found under llama.cpp's spelling; the W4A8 prefill's tail scale read; the GDN conv
  kernels on an f32 weight; dense integer rows at the group they compute (a Q8_0 weight at group 32)
- --expert-profile refuses a profile recorded on another model
- hc_read's one-grid wait traps past its deadline instead of reading a stale value

Changes: Plugin ABI 31, unchanged. RADIANCE_DRAFT_TREE, DFLASH2_TREE_NODES, DFLASH2_TREE_TEMP and
DFLASH_Q_TEMP are gone (trees run where the probe says they pay; temperatures 1.25 / 0.6).
2026-10-29 12:04:24 +01:00
Asim Siddiqui 890715fd96 libr3d: the wave-matrix record -- the six 16x16x16 variants, the MAC-core measurement, the i8-x4 gap
RDNA3's ISA lists exactly six wave-matrix instructions (f16, bf16, int8 and
int4 in; f32, f16, bf16 and i32 accumulating) and the toolchain emits them on
every gfx11 target; they run over multiple cycles driving the DOT pipeline
internally, and the MAC-core measurement on the 16-CU gfx1102 part confirms
it: f32-acc f16 19.11, f32-acc bf16 19.24, f16-acc f16 19.44, i32-acc i8
19.29 against the paired dot2 path's 18.86 TFLOP/s -- the same pipe within
three percent, matching the full-kernel 1.99-vs-1.97 already in r3d_common.h.
The i32-acc i4 tile is the exception at 25.68 TFLOP/s, 35% above, but it takes
i4 in both operands and the grids served here pair i8 activations against i4
and i2 weights: there is no mixed-precision integer WMMA on RDNA3, so that
pipe is unreachable from the w4a8 and w2a8 rows.

Commentary only -- the rationale passages in the README, CMakeLists.txt,
r3d_rows.cpp, r3d_plugin.h and r3d_selftest.cpp now state the measured
record; no kernel, lane map or numeric path changes, and the rebuilt library
is byte-identical (selftest 78 rows, 0 failed, 0 skipped).
2026-10-28 13:51:45 +01:00
Asim Siddiqui 6cb9826975 libr3d: the gfx11 (RDNA3) kernel library
A complete row set for the gfx11 family (1100/1101/1102/1103/1150/1151 plus gfx11-generic),
mirroring libr4d's structure: the quantised GEMM rows (m16, tiled, gated, the bf16 logits
gemm), the paged and ragged attention for decode and prefill, the KV store, the sampler
spine and the spec rows, with the recorded-fixture, board, selftest and comparison-driver
gates for each.

The gates are the record. Every row is measured against libref on the shape matrix: the
recorded fixture at 1153 cases with worst rel_l2 1.362e-03, the board's five modes with
bit-identical decision lines, the selftest at 74 rows, and the 233-case served-shape pairing
at 0 divergent against the tree libref. End-to-end on a 2B fp8 checkpoint served on the
card, coherent through prefix-cache adoption.

Two platform laws each shape the design. A kernel that calls device printf takes the
implicit hidden_hostcall_buffer argument and is undispatchable by the AQL backend, so the
trace records are plain stores behind a budget. And a plugin-owned __device__ global is not
a channel into the engine's dispatch path: in a dlopened plugin the runtime's symbol stub
is not the address the kernel's module writes, so the served trace channel is a hipMalloc'd
record slot passed as a kernel argument, with the device-global ring kept for the board.

kv_store bounds its slots at the pool's own plane (n_blocks x block_size), the span the
cache operand declares, not at the step's own span: a request that adopts a cached prefix
writes its new tokens at the allocator's global block indices, which sit past any bound
built from the step's token count, and a slot lost there is KV that attention then reads
stale. A corrupt slot map is dropped at the same bound.
2026-10-28 13:51:45 +01:00