Archived
radiance 1.11.0
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).
This commit is contained in:
commit
9eaf10da6e
210 files changed
+14363
-2138
No files matched your search
+84
-28
@@ -263,14 +263,24 @@ and every difference is behind `#if QWEN35_MOE` in the shared source. It is a se
|
||||
unit rather than a branch on `n_expert` because the id is half the selection key, and one `.so`
|
||||
cannot claim both ids.
|
||||
|
||||
The routed experts are served in the format the container stores, read from layer 0's first
|
||||
expert (`MoeFP8::probe`, as `qwen4exp` does): block FP8, the four-bit forms of
|
||||
[`docs/MOE-W4.md`](MOE-W4.md), whose rotated ones add a rotated copy of the block input (`moe_hr`),
|
||||
or OCP MXFP4 (`fp4_e2m1*e8m0[1x32]`, `data/recipes/sage-a1.5-mxfp4-df2.recipe`).
|
||||
Experts stored stacked or one by one are both read (`moe_expert_sources`). Plain bf16 experts are
|
||||
refused, since this plugin has no bf16 expert path. Tensor parallelism splits each expert's
|
||||
width, so the GPTQ calibration tap (`RADIANCE_CALIB_DIR`) runs at one rank only.
|
||||
|
||||
**Drafters.** The container's own MTP head is the default, and `rad-convert --draft-model` can
|
||||
replace it with a DFlash2 block drafter; the shared source declares it (`declare_dflash2`) and
|
||||
does not declare the MTP head when a DFlash2 drafter is present, so the routed trunk carries a dense drafter
|
||||
without further work. `sage-a1.5-fp8-df2.rad` is such a container: Sage-A1.5's routed trunk with
|
||||
replace it with a DFlash2 block drafter. The shared source selects the drafter from the container's
|
||||
`draft.architectures` (a DFlash2 model), declares it (`declare_dflash2`) and then does not declare
|
||||
the MTP head, so the routed trunk carries a dense drafter without further work.
|
||||
`sage-a1.5-fp8-df2.rad` is such a container: Sage-A1.5's routed trunk with
|
||||
`incoai/Qwen3.6-35B-A3B-DFlash2`, whose six 2048-wide layers read eight taps
|
||||
(`target_layer_ids` 1 6 11 16 22 27 32 37) and propose a block of seven tokens in one pass. At
|
||||
depth 7 it accepts ~49% of the proposals and decodes 1.40x faster than the same trunk with its MTP
|
||||
head (393 against 282 tok/s on two R9700s). `--num-speculative-tokens auto` takes the depth the
|
||||
head (393 against 282 tok/s on two R9700s). `sage-a1.5-mxfp4-df2.rad` is the same with the trunk,
|
||||
the experts and the drafter's linears at MXFP4. `--num-speculative-tokens auto` takes the depth the
|
||||
drafter states.
|
||||
|
||||
## `qwen35_w8a8`
|
||||
@@ -289,9 +299,13 @@ a plain int8 trunk is refused.
|
||||
- **The encoding is the only guard.** Rotated and plain int8 have the same bytes and extents, and
|
||||
the rotated weight against the plain quantiser measures rel_l2 ~1.0 (r4d_selftest, `i8a8h_rot`),
|
||||
so each dtype's layout hook takes only its own transform.
|
||||
- **Each rotated linear quantises its own input** from the bf16 plane its producer writes: q, k and
|
||||
v quantise one input three times, and no producer writes rotated codes yet. The MLP's gated fold
|
||||
is an fp8a8 tile over E4M3 codes, so an int8 gate_up runs the pair.
|
||||
- **The producers write the rotated codes** where libr4d declares the `_had_quant_i8g` ops: the
|
||||
norms (`rmsnorm_had_quant_i8g`, at two ranks `ar_rmsnorm_had_quant_i8g`) and the gated product
|
||||
(`gated_had_quant_i8g`) write `had_quant_act_i8g`'s bytes into the int8 pair (`ActFP8::q8_rot`),
|
||||
so q, k and v share one quantiser and down has none. The attention and delta-net outputs still
|
||||
take `had_quant_act_i8g` from the bf16 plane, and so does every linear where the ops are not
|
||||
declared (libref and libavx). The MLP's gated fold is an fp8a8 tile over E4M3 codes, so an int8
|
||||
gate_up runs the pair.
|
||||
- **It declines imported checkpoints** (`RAD_ARCH_SERVES_IMPORTS(0)`). An imported quantisation
|
||||
goes to the family's one quantised plugin, and a second one would refuse every Quark, ParoQuant,
|
||||
GPTQ or NVFP4 Qwen3.8 release; they stay with `qwen35_fp8`.
|
||||
@@ -872,12 +886,20 @@ and the drafter reads it through the same scale.
|
||||
(slice A whole 128-row tiles, both at least 512) and runs each slice's two all-reduces per layer on
|
||||
the second lane beside the other slice's compute, as the prefill overlap above does, with one
|
||||
difference: o_proj and down_proj both write `h`, so the issue order never lets lane 0 write rows of
|
||||
`h` that lane 1 is reducing, and `h` is the one buffer taken out of the arena's sharing. Attention
|
||||
runs whole. Both slices are above every row band the sliced kernels have (the int8 GEMMs' skinny
|
||||
band at 64, since the prefill kernel takes each row's K in order whatever M is, and
|
||||
r4d_act_threads' last width change at 120 rows for these widths), so on the exact wire the output
|
||||
equals the whole step's bit for bit. Every junction must be fused, as the w4a8 and w8a8
|
||||
containers' are; a bf16 trunk runs whole, and so does every step under `RADIANCE_GEMMA4_OVERLAP=0`.
|
||||
`h` that lane 1 is reducing, and `h` is the one buffer taken out of the arena's sharing. On a
|
||||
one-sequence step the attention runs per slice too (slice A's projection, prologue, attention and
|
||||
o_proj, then slice B's), so each of a layer's four reductions sits beside a whole block; slice
|
||||
A's attention takes its context end from `kv_len_trim`, the step's context less slice B's rows. A
|
||||
step of several sequences, a multi-component rotary or a library without `kv_len_trim` runs the
|
||||
attention whole. The lane-1 reductions are their own ops at `overlap` 1: libr4d's narrow
|
||||
four-block two-shot, whose pushes carry about 12.2 bits a bf16 value where the message fits that
|
||||
form, with the same bytes. Both slices are above every row band the sliced kernels have (the int8
|
||||
GEMMs' skinny band at 64, since the prefill kernel takes each row's K in order whatever M is, and
|
||||
r4d_act_threads' last width change at 120 rows for these widths), and a slice's attention rows see
|
||||
exactly the keys they see in the whole step, so on the exact wire the output equals the whole
|
||||
step's bit for bit. The overlap is a fixed rule: it runs wherever every junction is fused (as the
|
||||
w4a8 and w8a8 containers' are) and the all-reduce wire is exact; a bf16 trunk, or `--tp-wire
|
||||
wht6`, runs every step whole, and the startup notes say which.
|
||||
|
||||
**The 31B's q, k and v as one linear.** Converted with a recipe that names `blk.*.attn_qkv.weight`
|
||||
(both -df recipes do), each layer's q, k and v (q and k on a global layer, where v is k) are one
|
||||
@@ -887,7 +909,8 @@ The grid's groups never cross a row, so the codes are those of three separate ru
|
||||
the replies are too. On libr4d the skinny GEMM picks its in-block K split from N (k and v alone
|
||||
split K in two, the fused GEMM does not), so k and v can round differently in the last bit and a
|
||||
long greedy reply can part from the old container's late. `qkv_norm_rope` and `kv_store` work on
|
||||
the row's column slices in place. Attention reads q in the row through `attn_paged_qrow`: a global
|
||||
the row's column slices in place, as one launch (`qkv_norm_rope_kv_store`, byte-identical to the
|
||||
pair) where a library serves it. Attention reads q in the row through `attn_paged_qrow`: a global
|
||||
layer at every height (the windowed kernel, which serves head_dim 512 under `attn_paged` too), a
|
||||
sliding layer up to 32 query rows a sequence (libr4d's h256/gqa2 split-KV decode with q at a pitch,
|
||||
so a verify step included); a taller sliding step (a prefill) copies q out with a `cast` for the
|
||||
@@ -917,21 +940,48 @@ layers 0 16 28 46 58 (`gemma4::dflash2_taps`). It was trained against the target
|
||||
plain embedding and the target's head as a plain linear, so its lookup takes no Gemma scale and its
|
||||
head no soft-cap. The -df2 recipe stores its head copy int8 (`head_i8`, read at w8a8) rather than
|
||||
the 2-bit grid Qwen3.8's recipes use, so the selector ranks what an 8-bit head proposes. Its
|
||||
attention is the sliding layers' h256 gqa-2 split-KV decode, non-causal. `run-gemma4-31b.sh`
|
||||
takes it with `DRAFTER=df2`.
|
||||
attention is the sliding layers' h256 gqa-2 split-KV decode, non-causal. Where libr4d serves them,
|
||||
each layer's norm, rotary and cache-store chain is one `qkv_norm_rope_kv_store` launch in either
|
||||
pass (`v_norm` 0; `n_head` 0 in the context pass, which writes keys and values only), and each
|
||||
residual add is folded into the norm after it (`add_rmsnorm`), all byte-identical to the chains;
|
||||
Qwen3.8's head-128 DFlash2 drafter keeps the prologue chains and folds only the adds. At two ranks
|
||||
or more a block-fp8 `fc` is split by rows (`rad_block_dflash2.h`, SHARDING), each rank computing
|
||||
the whole 128-row scale blocks that cover its share of the columns and an `all_gather` assembling
|
||||
them, with `gemm_nt_q`'s `split_n` keeping every output the unsplit fc's to the bit. The recipe is
|
||||
`gemma4-31b-dense-bf16-w4a8-df2.recipe`.
|
||||
|
||||
**The 31B's junctions at four ranks.** At two ranks every junction carries the all-reduce in front
|
||||
of it (`ar_rmsnorm_quant_i8`). At four it does too, at decode heights. libr4d's
|
||||
`ar_rmsnorm_quant_i8_4rank` is the exact four-rank one-shot with the junction as its epilogue,
|
||||
byte-identical to `all_reduce` + `rmsnorm_quant_i8`. A one-shot sends three times the message per
|
||||
rank, so the plugin declares it only up to 4 rows and issues the pair in a taller step. On 4x
|
||||
R9700 the fold made plain decode 5.6% faster (94 against 89 tok/s) and a DFlash verify (16 rows)
|
||||
9% slower (276 against 300), where the standalone all-reduce is the exact two-shot. A decode step
|
||||
at tp 4 then has two standalone reductions (the embedding's and the last feed-forward's) where it
|
||||
had 121. It gives the pair's greedy text byte for byte. At sixteen rows of 5376 the junction is
|
||||
55 us against 22 at one row (--profile-ops): its handshakes, not its bytes, set it.
|
||||
`r4d_selftest --case ar_rmsnorm_quant_i8_4rank` checks it on four cards, and the startup note says
|
||||
which form a deployment takes.
|
||||
of it (`ar_rmsnorm_quant_i8`). At four it does too, in steps of up to 16 rows (decode, and a DFlash
|
||||
or DFlash2 verify), on libr4d's `ar_rmsnorm_quant_i8_4rank`, in a form chosen by height. Every form
|
||||
is byte-identical to `all_reduce` + `rmsnorm_quant_i8`:
|
||||
|
||||
- 1 to 3 rows: the exact four-rank one-shot with the junction as its epilogue. A one-shot sends
|
||||
three times the message per rank and takes a fenced handshake per row, so it pays only at the
|
||||
bottom: on 4x R9700 it made plain decode about 5% faster (90 against 86 tok/s), and at 16 rows it
|
||||
would be 9% slower than the pair.
|
||||
- 4 to 16 rows: the all-reduce split around the junction (`sp`). Each rank reduces the quarter of
|
||||
the rows it owns, runs the junction on them and gathers the int8 codes, so the second hop carries
|
||||
a byte a column and the junction a quarter of the rows. The residual then holds the rank's own
|
||||
rows only, which is all the next junction reads; the junctions where the drafter taps the
|
||||
stream, and the last layer's attention junction, gather it on every row (`sp` 2). On 4x R9700 a
|
||||
DFlash2 verify (8 rows) ran about 2% faster than with the tail form below.
|
||||
- libr4d's row also has a tail form for 5 to 32 rows, the exact two-shot with the junction run
|
||||
after it in the same launch; the 31B takes it only where the split form is not declared.
|
||||
|
||||
A taller step issues the pair (the split form lost about 10% under load at 24 to 64 rows). A decode
|
||||
step at tp 4 then has two standalone reductions (the embedding's and the last feed-forward's) where
|
||||
it had 121. `r4d_selftest --case ar_rmsnorm_quant_i8_4rank` checks every form on four cards, and
|
||||
the startup note says which forms a deployment takes.
|
||||
|
||||
**Weight reads beside the all-reduces.** At more than one rank, on decode and verify steps of up to
|
||||
16 rows that carry no prompt rows, the 31B reads the next GEMM's leading weight bytes into the
|
||||
on-die cache (libr4d `prefetch`) while an all-reduce leaves the card's memory idle: gate_up's first
|
||||
20 MB beside the attention's reduction, the next layer's q|k|v (the lm_head after the last layer)
|
||||
beside the feed-forward's, and down_proj's first 9 MB beside the attention; its DFlash2 drafter
|
||||
reads each reduction's following projections the same way. Where launches chain the read is the
|
||||
chained form right behind the GEMM before the reduction, otherwise it rides the second lane. The
|
||||
reads change no value; on 4x R9700 the 31B with DFlash2 decoded 15% faster with them, and without
|
||||
a drafter about 2%.
|
||||
|
||||
**FP8 experts.** The experts are ~90% of the weight bytes, so each projection is served as the
|
||||
container holds it, per layer: bf16 by `moe_gemm`, block fp8 by `moe_gemm_q`. gate_up
|
||||
@@ -1158,6 +1208,12 @@ VAE Qwen-Image's (Wan 2.1's causal 3-D convolutions on one frame), 16 chan
|
||||
schedule Raw: 28 steps, the resolution-shifted schedule of its scheduler config, guidance 4.5 in
|
||||
the card's terms against an empty negative prompt; Turbo: 8 steps at a fixed shift
|
||||
(mu 1.15), no guidance. Raw or Turbo is read from the pipeline and scheduler config
|
||||
rebalance a request's `rebalance` (RAD_GEN_COND_REBALANCE, declared in cond_opts): each tap
|
||||
times a fixed gain before the fusion, ComfyUI's ConditioningKrea2Rebalance at its
|
||||
defaults, 4, 4, 4, 4, 4, 4, 4, 10, 20, 4.4, 16, 4; chan_affine in f32, rounded once,
|
||||
from te.x into te.h2, which the tap's scatter then reads. The gains cannot be folded
|
||||
into weights: the taps enter the layer-wise fusion blocks raw, through a pre-norm
|
||||
residual. Without it no scale is issued and the taps are scattered from te.x
|
||||
```
|
||||
|
||||
Traps:
|
||||
@@ -1774,7 +1830,7 @@ Traps:
|
||||
first decoded garbage and the first one partly.
|
||||
- **The MP4 is not a parity instrument.** H.264 at CRF 18 in yuv420p moves a random-weight
|
||||
model's frames by about 40 levels on its own; compare the frames before encoding (the op
|
||||
oracle's patch_pix8 output).
|
||||
oracle's tile_stitch output).
|
||||
|
||||
Against diffusers' pipelines in bf16 on a tiny random-weight pipeline of the same layout (256x256,
|
||||
17 frames, from the same latents), the first frame's row sums agree to within 0.2% at 2 unguided
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
The story behind `step_ns_decode_best`, `step_ns_decode_recent`, and why the
|
||||
dashboard shows them without a verdict. Written 2026-10-18, the day all of it
|
||||
happened. The user-facing explanation is §6.1 of the guide; this is the log of
|
||||
happened. The user-facing explanation is [GUIDE.md §6.1](GUIDE.md#61-the-dashboard); this is the log of
|
||||
how we got there, including the parts that failed.
|
||||
|
||||
## What shipped
|
||||
|
||||
+4
-1
@@ -131,9 +131,12 @@ the cards the engine runs on.
|
||||
| `flashnext-bf16.yaml` | `qwen3.8-flash-next-bf16.rad` | Qwen3.8-Flash-Next in bf16, streamed from the disk tier. A reference, not a production server |
|
||||
| `qwen3.6-35b-a3b.yaml` | `qwen3.6-35b-a3b-fp8.rad` | Qwen3.6-35B-A3B, FP8 |
|
||||
| `ornith-1.5-35b-a3b.yaml` | `ornith-1.5-35b-a3b-fp8.rad` | Ornith-1.5-35B-A3B, FP8, MTP, vision |
|
||||
| `ornith-1.5-35b-a3b-w4a8.yaml` | `ornith-1.5-35b-a3b-w4a8.rad` | Ornith-1.5-35B-A3B with four-bit experts (GPTQ), a block-FP8 trunk, MTP, vision |
|
||||
| `ornith-1.5-35b-a3b-w4a8-tp1.yaml` | `ornith-1.5-35b-a3b-w4a8.rad` | The same on one card, every weight in VRAM |
|
||||
| `sage-a1.5.yaml` | `sage-a1.5-fp8.rad` | Sage-A1.5, FP8, MTP, vision |
|
||||
| `sage-a1.5-tp1.yaml` | `sage-a1.5-fp8.rad` | The same on one card: the expert plane partly in an 8 GiB pinned host pool, one 262,144-token session |
|
||||
| `sage-a1.5-df2.yaml` | `sage-a1.5-fp8-df2.rad` | Sage-A1.5 with incoai's Qwen3.6-35B-A3B DFlash2 drafter in place of the MTP head, vision |
|
||||
| `sage-a1.5-mxfp4-df2.yaml` | `sage-a1.5-mxfp4-df2.rad` | The same with the trunk, the experts and the drafter at MXFP4; ten 262,144-token sessions |
|
||||
| `qwen3.8-27b-fp8.yaml` | `qwen3.8-27b-fp8.rad` | Qwen3.8-27B FP8 with its DFlash2 drafter and vision tower |
|
||||
| `qwen3.8-27b-mxfp4.yaml` | `qwen3.8-27b-mxfp4.rad` | Qwen3.8-27B with AMD's Quark AWQ-MXFP4 trunk, its DFlash2 drafter and vision tower |
|
||||
| `qwen3.8-27b-paro.yaml` | `qwen3.8-27b-paro-int4.rad` | Qwen3.8-27B ParoQuant int4 (learned rotations) with its DFlash2 drafter and vision tower, on one card; the int5 and MXFP4 containers serve from it too |
|
||||
@@ -175,7 +178,7 @@ docker compose -f flashnext.yaml down # stop
|
||||
```
|
||||
|
||||
Every model listens on the same port and most take both cards (`flashnext-tp1.yaml`,
|
||||
`qwen3.8-27b-paro.yaml` and the files that read `RADIANCE_GPU` take one, `glm53-flash.yaml`
|
||||
`ornith-1.5-35b-a3b-w4a8-tp1.yaml`, `qwen3.8-27b-paro.yaml` and the files that read `RADIANCE_GPU` take one, `glm53-flash.yaml`
|
||||
eight), so run one at a time: `down` one before `up` on another. The server runs as the host user given in `.env`. `/health`, `/ping` and
|
||||
the dashboard page answer without the API key, and the health check fetches `/health` with
|
||||
busybox's `wget`.
|
||||
+281
-137
@@ -50,7 +50,7 @@ driver. [`DOCKER.md`](DOCKER.md) covers it, with compose files per model.
|
||||
|---|---|
|
||||
| Required | Linux, a C++20 compiler, CMake 3.21+, Ninja, pthreads |
|
||||
| Optional | ROCm with `hipcc`, for AMD device kernels; without it you get the host backend. Set `ROCM_PATH` if ROCm is not at `/opt/rocm` |
|
||||
| With a card | Resizable BAR on (Above 4G Decoding and Resizable BAR in the firmware setup). The host writes every dispatch's arguments into VRAM there; without a large BAR they stay in pinned host memory and every dispatch reads them over the link, which costs launch rate |
|
||||
| With a card | Resizable BAR on (Above 4G Decoding and Resizable BAR in the firmware setup). The host writes every dispatch's arguments into VRAM there. On a card whose BAR is smaller than its VRAM they stay in pinned host memory and every dispatch reads them over the link: on R9700s, Qwen3.8-27B fp8 decode steps take 0.4-1.8% longer at `--tp 1` and 2 than with the arguments in VRAM. Peer access needs the large BAR too, so at `--tp 2` and above such a card takes the collectives through host memory (§4.7) |
|
||||
| Optional | OpenMP, used by the host kernel libraries if present |
|
||||
| Optional | `clang++` (or ROCm's), for `tests/r4d_emu` when the C++ compiler is g++; CMake 3.25+ for `CMakePresets.json` |
|
||||
| Shell harnesses | `curl` and `jq` |
|
||||
@@ -115,7 +115,7 @@ Times are wall clock on a 16-core (32-thread) host build with other work running
|
||||
| `e2e` | `engine_e2e_test`: the `radiance` binary serving tiny synthetic checkpoints on the host backend |
|
||||
| `kbench` | `kbench`, `kbench_moe` and `kbench_ref`, the kernel replays (below) |
|
||||
| `slow` | `kbench_ref`, `r4d_selftest` and `r4d_emu_attn_sweep` |
|
||||
| `gpu` | `device_test_card`, `mem_test_card`, `place_test_card`, `runtime_test_card`, `device_test_nosvm`, `r4d_selftest`, and `kbench`/`kbench_moe` when libr4d is built; one at a time, and a server must not hold the card |
|
||||
| `gpu` | `device_test_card`, `mem_test_card`, `place_test_card`, `runtime_test_card`, `device_test_nosvm`, `device_test_hostkargs`, `runtime_test_hostkargs`, `r4d_selftest`, and `kbench`/`kbench_moe` when libr4d is built; one at a time, and a server must not hold the card |
|
||||
| `oot` | `oot_plugins`: every bundled plugin rebuilt out of tree against an install |
|
||||
| `r4d_emu` | libr4d kernel sources run on the host by a SIMT emulator; registered where a clang++ is found |
|
||||
|
||||
@@ -129,6 +129,9 @@ RAD_TEST_FILTER=oracle build/tests/gbnf_test # patterns from the environment
|
||||
RAD_TEST_LEVEL=2 build/tests/gbnf_test # the exhaustive sizes, where a test has them
|
||||
```
|
||||
|
||||
`device_test` and `runtime_test` also take `--host-kargs`: the AQL backend keeps kernel arguments
|
||||
in pinned host memory on every card, as it does on a card without a large BAR (§1.1).
|
||||
|
||||
A case taking 0.1 s or more prints its time, and a binary ends with its wall and CPU time and its
|
||||
three slowest cases. A binary that checked nothing exits 77, which ctest reports as skipped, not
|
||||
passed. ctest sets, for each unit test:
|
||||
@@ -850,8 +853,9 @@ takes the model's training context.
|
||||
`--kv-cache-dtype fp8` is an E4M3 cache with per-(sequence, head) descales. It halves what a token of
|
||||
context costs, which at a production context is most of the pool. It is a real quantisation that
|
||||
changes the output slightly, so it is only ever set explicitly. Every architecture serves both
|
||||
widths, and the flag sets every attention cache of the deployment, a drafter's (DSpark, DFlash2)
|
||||
included. The delta-net state and the QSA indexer's key tail are recurrent state and keep their own
|
||||
widths except GLM-5.3-Flash (`glm5next`), whose latent-attention cache is bf16 only and which refuses
|
||||
`fp8` at startup. The flag sets every attention cache of the deployment, a drafter's (DSpark,
|
||||
DFlash2) included. The delta-net state and the QSA indexer's key tail are recurrent state and keep their own
|
||||
widths.
|
||||
|
||||
`fp8_v4` and `k6_v4` narrow the trunk's attention cache further, in groups of 32 dimensions with an
|
||||
@@ -873,6 +877,35 @@ engine, against the bf16 model on 17 long log-analysis documents (60 368 scored
|
||||
The decode spread is run to run; the three are the same speed there. Each layout's row and the
|
||||
kernels that read it are in [OPS.md](OPS.md#the-kv-cache-operand).
|
||||
|
||||
**Prefill attention in e4m3.** `--attn-prefill-fp8 qk`, `pv` or `both` runs the prefill
|
||||
attention's Q·Kᵀ (the query rounded to E4M3 after the softmax scale), its P·V (the probabilities
|
||||
rounded to E4M3) or both as fp8 WMMA over an `fp8`, `fp8_v4` or `k6_v4` cache (the int4 V and
|
||||
int6 K of the narrow layouts are rounded to E4M3 as they are staged). It is lossy, so the default
|
||||
is `off`. libr4d has the kernels for Qwen3.8-27B's attention (head_dim 256, gqa 6, 16-token
|
||||
pages); anywhere no kernel takes the flag (another geometry, a `bf16` cache, the host backend)
|
||||
startup stops, naming it. A step without a prefill chunk (decode, a speculative verify)
|
||||
keeps the exact kernel. A step with one runs every row through the e4m3 legs, the decode rows it
|
||||
carries included. On two R9700s with Qwen3.8-27B MXFP4 at `--tp 2 --max-model-len 245000
|
||||
--kv-cache-dtype fp8 --max-num-seqs 5`, against `off` on 53 documents (53 443 scored positions,
|
||||
one document 221K tokens long):
|
||||
|
||||
| `--attn-prefill-fp8` | attention, 2048-token chunk at 200K | 221K-token prompt | 24K-token prompt | mean KL | p99.9 | top-1 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| `off` | 41.6 ms | 2665 tok/s | 4655 tok/s | | | |
|
||||
| `qk` | 37.6 ms | 2800 | 4696 | 0.055 | 11.9 | 96.2% |
|
||||
| `pv` | 35.7 ms | 2885 | 4741 | 0.053 | 11.2 | 96.3% |
|
||||
| `both` | 27.9 ms | 3210 | 4835 | 0.058 | 11.9 | 96.0% |
|
||||
| `--tp-wire wht6`, for scale | | 2853 | 5312 | 0.065 | 13.5 | 95.7% |
|
||||
|
||||
The attention time is one layer's kernel on one rank (`r4d_selftest --case
|
||||
attn_prefill_fp8_perf`); over `fp8_v4` and `k6_v4` it is 41.8 and 43.0 ms `off`, 34.7 and 35.5
|
||||
`qk`, 36.7 and 37.6 `pv`, 30.3 and 30.7 `both`. Code moves least, a code source's mean KL 0.0004 to 0.007; chat and
|
||||
reasoning 0.02 to 0.09; tool-calling and SWE transcripts most, 0.17 to 0.27 at 91 to 93% top-1, as
|
||||
much as they move under `--tp-wire wht6`. The flag combines with `--tp-wire wht6`. The FP8 container at the same
|
||||
flags goes from 2613 to 3118 tok/s at 221K tokens and from 4486 to 4665 at 24K with `both`, at a
|
||||
mean KL of 0.066 and 95.6% top-1. With `--kv-cache-dtype fp8_v4` the MXFP4 container goes from 2666
|
||||
to 3097 tok/s at 221K tokens and from 4636 to 4778 at 24K with `both`.
|
||||
|
||||
**Many sequences.** Every model here serves `--max-num-seqs` up to 32. A sequence holds only the
|
||||
blocks its tokens occupy, but two costs exist per sequence regardless:
|
||||
|
||||
@@ -1083,6 +1116,13 @@ head declines count in the acceptance metrics but do not move the window. At tem
|
||||
is that of a fixed depth wherever fixed depths agree; above 0 it is distribution-exact.
|
||||
`radiance:draft_depth_adaptive` and `radiance:draft_verify_depth_total` (§6.3) show the windows.
|
||||
|
||||
**Chained launches.** Where the model's plugin measured its speculative step faster with them (the
|
||||
Gemma 4 31B and 26B-A4B with a DFlash or DFlash2 drafter) and that drafter decodes, the AQL backend
|
||||
lets a kernel that depends on the one before it on its queue wait in its own prologue instead of
|
||||
behind the packet processor's barrier bit, which saves most of the launch gap between dependent
|
||||
kernels. The bytes are the same. Plain decode measured slower with them, so they stay off there
|
||||
and on every other model; the startup report's `chained launches` row says which and why.
|
||||
|
||||
### 4.7 Multiple cards
|
||||
|
||||
```sh
|
||||
@@ -1099,10 +1139,12 @@ prefill.
|
||||
At three and four ranks `wht6` selects tiered int8 over a two-shot all-reduce, both hops quantised
|
||||
(at three ranks the shards are whole 32-element groups, one uneven where the message does not
|
||||
divide), with the same floor. Eight ranks have no lossy wire; `--tp 8 --tp-wire wht6` stops at
|
||||
startup naming the all-reduce it found no kernel for, and `--tp-wire exact`. The exact wire at three
|
||||
and four ranks is one-shot up to 1 MiB a message and two-shot above it, which sends
|
||||
2·(ranks−1)/ranks of the message per rank instead of (ranks−1) times it, with the same bits. At
|
||||
eight ranks the one-shot's seven copies lose early, and it ends at 8192 elements (16 KiB of bf16).
|
||||
startup naming the all-reduce it found no kernel for, and `--tp-wire exact`. The exact wire is
|
||||
one-shot for small messages and two-shot above, which sends 2·(ranks−1)/ranks of the message per
|
||||
rank instead of (ranks−1) times it, with the same bits. At three ranks the one-shot runs up to 1 MiB
|
||||
a message; at four it hands a message of 32768 elements (64 KiB of bf16) or more to the two-shot,
|
||||
so a verify step's reductions take it too; at eight the one-shot's seven copies lose early, and it
|
||||
ends at 8192 elements (16 KiB of bf16).
|
||||
|
||||
On a model with a gated residual (Qwen3.8-Flash-Next) the all-reduce runs inside the residual's
|
||||
write, with the MoE gather in front of it. At two ranks the rotated forms of `ar_hc_write` and
|
||||
@@ -1167,25 +1209,27 @@ With the two Gen4 links retrained to Gen5 x8 the weights read 4,1,1,4,1,1,4,4 an
|
||||
message takes 1360 µs.
|
||||
|
||||
That is 56% of the time the x8 cards' links need for its bytes (763 µs). `--perfar8 N iters bf16
|
||||
lockstep,ring,split` times the forms below side by side, and `--timeline` adds every rank's first
|
||||
push, each step's work and wait and the final assemble, which in one piece are the reduce-scatter
|
||||
and the all-gather apart; `R4D_SELFTEST_ONE_CARD=1` runs the eight ranks on one card, for their
|
||||
bits only.
|
||||
lockstep,ring,split` times three forms of the two-shot side by side, all with the same bits:
|
||||
`lockstep`, the engine's, as above; `ring` sends the first hop to the other cards in ring order
|
||||
from the next rank, so no card receives from all seven at once; `split` does that and replaces
|
||||
each step's handshake, which waits for every card to finish the whole step, by a flag after each
|
||||
half of it, awaited only where its data is read. On this board ring takes 2-6% less time for 8 and
|
||||
16 MiB messages, but serving GLM-5.3-Flash at TP8 split (ring order included) moves neither
|
||||
prefill nor decode beyond run-to-run noise, so the engine stays in lockstep. `--timeline` adds
|
||||
every rank's first push, each step's work and wait and the final assemble, which in one piece are
|
||||
the reduce-scatter and the all-gather apart. `R4D_SELFTEST_ONE_CARD=1` runs the eight ranks on one
|
||||
card, for their bits only, in `--perfar8` and in the eight-rank exact all-reduces' cases of a
|
||||
plain `r4d_selftest` run.
|
||||
|
||||
The links are read once, at startup: a link that drops to a lower speed while the server runs
|
||||
keeps its weight until the next start. `RADIANCE_AR8_SHARD_WEIGHTS` overrides them: `off` keeps
|
||||
the shards even, eight comma-separated integers set them, unset or `auto` reads the links.
|
||||
`duplex` reads the same links and weights them so that every link's busier direction carries the
|
||||
same time's bytes when both directions run at once (`r4d_ar_weights_duplex`): x16 64 and x8 8 on
|
||||
the repaired board, whose link time it puts 10% under the `auto` weights', a Gen4 x8 card nothing.
|
||||
`RADIANCE_AR8_PIECES` (1 to 16) fixes the piece count, and `RADIANCE_AR8_SHARD_WEIGHTS_MIN_ELEMS`
|
||||
and `RADIANCE_AR8_PIECES_MIN_ELEMS` move the two sizes they start at. `RADIANCE_AR8_FORM` chooses
|
||||
how the steps run, with the same bits: `lockstep` (unset) as above; `ring` sends the first hop to
|
||||
the other cards in ring order from the next rank, so no card receives from all seven at once;
|
||||
`split` does that and replaces each step's handshake, which waits for every card to finish the
|
||||
whole step, by a flag after each half of it, awaited only where its data is read, so a card whose
|
||||
half is done goes on with the next piece while a slower one still reduces. Every rank must read
|
||||
the same values; where they differ, every rank stops at startup.
|
||||
keeps its weight until the next start. Messages under 262144 elements run even and in one piece.
|
||||
`--perfar8` also prints the duplex model's table (`r4d_ar_weights_duplex`), which weights the
|
||||
links so that every link's busier direction carries the same time's bytes when both directions
|
||||
run at once: on four Gen5 x16 and four Gen5 x8 links 64 and 8, a link time 10% under the `auto`
|
||||
weights' (a Gen4 x8 link gets 0). The
|
||||
engine does not use it: on this board those weights lost their lead within a timing run and
|
||||
served no faster. `r4d_selftest --perfar8 --ar8-weights W0,..,W7` times other weights on another
|
||||
board (`off` for even shards).
|
||||
|
||||
### 4.8 Host tier for finished conversations
|
||||
|
||||
@@ -1204,10 +1248,12 @@ after each turn, and a returning conversation larger than that takes the VRAM co
|
||||
stored conversations too, the way an admission under pressure does: those with a host copy first,
|
||||
then those whose copy was still on its way, once it lands. Nothing is lost by it, since each keeps
|
||||
its host copy, and it never takes the returning conversation's own blocks, a conversation a
|
||||
running request reads, or one a waiting request has just brought back. Only when the pool cannot
|
||||
hold the whole conversation even then does it come back in part, and on a hybrid model it then ends
|
||||
at the deepest snapshot it reaches, where its next turn resumes; `radiance:prefix_restore_cuts_total`
|
||||
counts these (`/sessions` `moved.restore_cuts`).
|
||||
running request reads, or one a waiting request has just brought back. A turn that has just
|
||||
finished holds its blocks until the next step, so a conversation returning right behind it waits
|
||||
that one step before it settles for less. Only when the pool cannot hold the whole conversation
|
||||
even then does it come back in part, and on a hybrid model it then ends at the deepest snapshot it
|
||||
reaches, where its next turn resumes; `radiance:prefix_restore_cuts_total` counts these (`/sessions`
|
||||
`moved.restore_cuts`).
|
||||
|
||||
Every stored conversation expires: one unused for `--prefix-cache-ttl` seconds is removed from
|
||||
whichever tier holds it (VRAM blocks to the pool, host slot to the arena, snapshots to the store). A
|
||||
@@ -1296,6 +1342,28 @@ Of sources 2 to 4, the first that states anything is used whole.
|
||||
radiance --model m.rad --temp 0.7 --top-p 0.8 --top-k 20
|
||||
```
|
||||
|
||||
**The windowed no-repeat-n-gram ban** (`no_repeat_ngram_size` /
|
||||
`no_repeat_ngram_window_size` in a `generation_config.json`, the same names under
|
||||
`generation.*` in the container; `ngram_ban_n` / `ngram_window` in a request) comes from the same
|
||||
four sources; there is no command-line flag. A negative window is the reference's "the whole
|
||||
sequence", which this sampler spells 0. Unlimited-OCR's checkpoint states 35 over the last 128,
|
||||
so that is what a request sending neither field gets:
|
||||
|
||||
```json
|
||||
{"messages": [...], "ngram_ban_n": 35, "ngram_window": 128}
|
||||
```
|
||||
|
||||
**The ban's whitelist** (`ngram_whitelist` in a request, alias `no_repeat_ngram_whitelist`;
|
||||
`generation.no_repeat_ngram_whitelist` in the container and in a `generation_config.json`, a JSON
|
||||
array of ids) names token ids the ban must never ban: the reference processor removes them from
|
||||
the banned set before it blocks anything (`banned.difference_update(whitelist)`). Absent, null and
|
||||
empty all mean off -- the reference's empty whitelist, the form this checkpoint ships -- and off is
|
||||
bit-identical to a ban without the feature. There is no command-line flag.
|
||||
|
||||
```json
|
||||
{"messages": [...], "ngram_ban_n": 35, "ngram_window": 128, "ngram_whitelist": [151645, 151644]}
|
||||
```
|
||||
|
||||
**The rest of the sampler** has a flag per field, spelled like the request field:
|
||||
`--presence-penalty`, `--frequency-penalty`, `--repetition-penalty`, `--repeat-last-n`,
|
||||
`--typical-p`, `--dry-multiplier`, `--dry-base`, `--dry-allowed-length`, `--dry-penalty-last-n`,
|
||||
@@ -1479,87 +1547,65 @@ radiance --model krea-2-turbo-fp8.rad --lora-dir /loras --lora film=/loras/film-
|
||||
### 4.10 Control vectors
|
||||
|
||||
A **control vector** is a small GGUF file holding one direction per layer; applied while the model
|
||||
runs, it moves every token's residual stream off that direction. radiance implements llama.cpp's
|
||||
`--cvec-mode project` operation for it (`hc_project`, `docs/OPS.md`), which is what the published
|
||||
package for Qwen3.8-Flash-Next was tuned for:
|
||||
runs, it removes each token's residual-stream component along that direction. radiance implements
|
||||
llama.cpp's `--cvec-mode project` operation (`hc_project`, `docs/OPS.md`) for architectures whose
|
||||
plugin declares it; today that is `qwen4exp` (Qwen3.8-Flash-Next).
|
||||
|
||||
**One flag loads it: `--control-vector off` or `--control-vector on`** (explicit
|
||||
`--control-vector disabled` is the same as no flag). Without it nothing is loaded: the graph declares
|
||||
no projection op (so an off request costs the stock model's launches), a request that asks for the
|
||||
vector is refused by name, and `/admin/control-vector` answers 404. The
|
||||
flag's value is the startup switch — `off` leaves requests off until one asks or the dashboard flips
|
||||
the default, `on` starts them on. With the flag the engine looks, in order, at:
|
||||
**`--control-vector off` or `--control-vector on` loads one** (`disabled`, the default, is the same
|
||||
as no flag). Without it nothing is read, the graph declares no projection op, a request that asks
|
||||
for the vector is refused by name, and `/admin/control-vector` answers 404. The flag's value is the
|
||||
request default: `off` leaves requests off until one asks (or the default is changed), `on` starts
|
||||
them on. With the flag the engine looks, in order, at:
|
||||
|
||||
1. `<container without its extension>.control-vector.gguf` beside the model, and
|
||||
2. `control-vector.gguf` in the container's directory (one file serves a directory of quants of
|
||||
the family), then
|
||||
3. `<home>/vectors/<architecture>-control-vector.gguf` for each `--radiance-home`, i.e.
|
||||
`…/vectors/qwen4exp-control-vector.gguf` — **and that one ships with radiance**
|
||||
(`data/vectors/`, installed into every plugin home), so there is normally nothing to place.
|
||||
1. `<container without its extension>.control-vector.gguf` beside the model,
|
||||
2. `control-vector.gguf` in the container's directory (one file for a directory of quants), then
|
||||
3. `<home>/vectors/<architecture>-control-vector.gguf` for each `--radiance-home`. radiance ships
|
||||
`qwen4exp-control-vector.gguf` there (`data/vectors/`, installed into every plugin home).
|
||||
|
||||
So a Flash-Next deployment does one thing: start with `--control-vector off` (or `on`). The
|
||||
Model-view switch and the `control_vector` request field are then there, because the vector came with
|
||||
the plugin home; the first two paths exist so an operator can override it per model or per directory,
|
||||
which is also how every quantisation of the family shares one file — the file names the architecture
|
||||
and the width, not the quant. The shipped copy is Cudecnik's published file unchanged and stays under
|
||||
the **Qwen Community License 1.0** (`data/vectors/LICENSE.qwen-community-1.0.txt`, `NOTICE`): the
|
||||
directions are Qwen's, derived from Flash-Next's own residual stream, and radiance's Apache-2.0 grant
|
||||
covers the code that applies them, not the file. The operation's parameters come from the package's
|
||||
own JSON (`layer_range`, `scale`, `mode`), so there is no flag for them either: a file that does not
|
||||
fit this container is reported and skipped, never served. Only the startup switch is a flag, because
|
||||
it is the one decision that changes the declared graph.
|
||||
The startup is refused, naming the reason, when the flag is given and the architecture plugin does
|
||||
not apply control vectors, no file is found, or the file does not fit: its
|
||||
`general.architecture` must be `controlvector`, its `controlvector.model_hint` (when present) this
|
||||
model's architecture, every `direction.<l>` F32 and exactly the model's width, and the layer range
|
||||
inside the model with a direction for every layer in it. The range and the scale come from the
|
||||
package's JSON beside the file (`<stem>.json`, `"mode": "project"`, `layer_range`, `scale`); without
|
||||
one, every direction the file carries is applied at scale 1. A JSON that is not JSON or names another
|
||||
mode is refused.
|
||||
|
||||
- **Only a compatible container accepts it.** The file must be a GGUF `controlvector` whose
|
||||
`controlvector.model_hint` (when present) is this model's architecture (`qwen4exp`), whose
|
||||
directions are exactly the model's `--n-embd` wide, and whose range lies inside its layers.
|
||||
Anything else is reported and skipped, never served: a direction from another model's residual
|
||||
basis would move hidden states along a meaningless axis.
|
||||
- **It is off until a request asks for it.** The dashboard's Model view flips the default for
|
||||
requests that name no choice, and a request's own `control_vector` field always wins. **No
|
||||
switch reloads the model**: the directions are uploaded once at startup and each step carries a
|
||||
per-request row mask.
|
||||
- **What the states cost** (this box, 4,096-token answers, speculation off, one boot per state,
|
||||
median of six): stock 85.1 tok/s decode, `disabled` 86.1 (the same graph, nothing to pay), `off`
|
||||
83.7 (41 launches a token, each returning at the zero-row guard — values untouched), `on` 82.8
|
||||
(the projection itself). Prefill is the same in all four, 3,661–3,710 tok/s.
|
||||
- **The op is a no-op when off** — it skips a disabled row without reading or writing it, so an
|
||||
unprojected request's stream is the one the stock model computes. Measured in the engine's own KLD
|
||||
mode (`--kld-record` on stock 1.9.0, `--kld-ref` on this branch, both `--deterministic`, 227
|
||||
documents, 53,414 positions, eight boots a side): **off vs stock 0.021–0.075 mean KL** (median
|
||||
0.044), against **unmodified stock's own 0.019–0.095** (median 0.046) — indistinguishable (median
|
||||
Δ +0.001, permutation p=0.96). The vector **on** measured 0.020–0.090 (median 0.063) over the same
|
||||
eight boots, which is not separable from the spread either (p=0.34); the package reports 0.186 on
|
||||
its own corpus. The boot-to-boot spread is bimodal (≈0.02 or ≈0.08 mean KL, top-1 ≈96.5% or
|
||||
≈92.5%) and wider than the effect, so reproducibility — not the feature — is what limits a quality
|
||||
claim on this box; within one boot it is exact (a repeated request is bit-identical, and
|
||||
`control_vector: false` matches sending no field). Without `--control-vector` the two builds
|
||||
declare the same graph (same ops, buffers, arena and kernel selections, 17,090,734 bytes of
|
||||
`--debug-graph` either way; its listing varies in row order, so content, not bytes), and the
|
||||
table's own bytes are taken back out of the VRAM budget so the plan cannot see them
|
||||
(`VramFacts::held_out`, `core/mem/vram_budget.h`). The switch's effect is where it lives, measured
|
||||
inside one boot and therefore exactly — the table below.
|
||||
- **Conversations are partitioned.** Blocks and linear-state snapshots computed with the vector
|
||||
on are keyed differently from those computed without it, so switching modes in one conversation
|
||||
recomputes instead of reusing hidden states that belonged to the other mode. A runtime LoRA
|
||||
adapter (§4.9.1) and a control vector are independent: both enter the prefix cache's key, so
|
||||
neither's KV is ever shared with the other's.
|
||||
- Cost: 41 extra launches per trunk step at Flash-Next's 48 layers (range 4..44), each a dot
|
||||
product and a subtract per residual stream. On two RX 9070s that is not measurable: prefill of a
|
||||
7.9K-token prompt 2.09 s without the vector, 2.08 s with it; decode of 5,000-token answers
|
||||
(three runs each, alternating, temperature 0, ignore_eos) medians 150.1 tok/s without it and
|
||||
151.3 tok/s with it. The spread around those medians -- 139 to 154 tok/s -- is speculative
|
||||
acceptance, which follows the text the model writes and not the vector, and a session's first run
|
||||
reads lower still (91 tok/s at 17% acceptance) while the cold caches fill. The MTP draft head is
|
||||
not steered; the trunk verifies every token, so the text is the vector's.
|
||||
- For the vector shipped for Qwen3.8-Flash-Next it is a refusal-direction projection: it removes a
|
||||
safety behaviour, and the default stays off for that reason. With it on, a request that asks the
|
||||
model for its system prompt gets it, and tone/policy refusals stop -- so a deployment that exposes
|
||||
the API beyond one user should leave the default off and control who may set the field.
|
||||
The shipped file is Cudecnik's published vector
|
||||
(`huggingface.co/Cudecnik/Qwen3.8-Flash-Next-refusal-projection`), unchanged, with its JSON (layers
|
||||
4..44, scale 1). It is under the **Qwen Community License 1.0**
|
||||
(`data/vectors/LICENSE.qwen-community-1.0.txt`, `NOTICE`), not radiance's Apache-2.0.
|
||||
|
||||
- **Per request.** `"control_vector": true` or `false` in the request body; absent or null takes the
|
||||
deployment's default. The dashboard's Model view shows the vector and changes the default
|
||||
(`POST /admin/control-vector {"enabled": bool}`, behind `--api-key`; without a key, from a
|
||||
loopback client only). A running request keeps the choice it was admitted with, and nothing is
|
||||
reloaded: the directions are uploaded once and each step carries a row mask.
|
||||
- **Cost.** A step in which no row takes the vector issues no projection, so `off` runs the same
|
||||
launches as no flag. Measured on Flash-Next (`w4nl64-i8lm.rad`, TP2, the production flags,
|
||||
speculation off, three 1,536-token greedy answers): median decode of 89.7 tok/s with no flag,
|
||||
90.1 with `off` and 88.1 with `on` (the projection itself), against 89.7 for 1.10.0. Issuing the
|
||||
41 projections on every token regardless costs about 1.5% (88.3). With speculation on, as the
|
||||
production flags run, no flag and `off` both decode at 166 tok/s. Run-to-run spread is about
|
||||
2 tok/s.
|
||||
- **The off state is the stock model.** A row with the switch off is neither read nor written, and
|
||||
with the flag absent the graph declares no projection. Greedy text on six prompts of 101-345
|
||||
tokens, with and without speculation, was identical between 1.10.0, no flag, `off`, and
|
||||
`"control_vector": false` on an `on` server. The table's bytes are taken back out of the VRAM
|
||||
budget (`VramFacts::held_out`), so the expert and KV plan is the same as without it.
|
||||
- **Conversations are partitioned.** Blocks and linear-state snapshots computed with the vector on
|
||||
are keyed apart from those computed without it, so switching mid-conversation recomputes rather
|
||||
than reusing hidden states of the other mode. A runtime LoRA adapter (§4.9.1) is keyed
|
||||
independently.
|
||||
- **The MTP draft head is not steered.** The trunk verifies every token, so the text is the
|
||||
vector's.
|
||||
- `--kld-record` / `--kld-ref` score every document at the deployment's default.
|
||||
- For the shipped vector, `on` removes a safety behaviour: the model stops refusing policy prompts
|
||||
and reveals its system prompt when asked. A deployment that exposes the API beyond one user should
|
||||
keep the default off and decide who may set the field.
|
||||
|
||||
**What the switch does where it is aimed.** Same boot, same weights; only `control_vector` changes,
|
||||
and off and on each repeat bit-identically. The stock column is a separate boot of unmodified 1.9.0,
|
||||
so its KL to off carries the engine's floor. First generated token, 20-way distribution:
|
||||
**What the switch does where it is aimed** (the PR's measurement: same boot, only `control_vector`
|
||||
changes; the stock column is a separate boot of 1.9.0). First generated token, 20-way distribution:
|
||||
|
||||
| prompt | stock | off | on | KL(off,on) |
|
||||
|---|---|---|---|---|
|
||||
@@ -1576,18 +1622,8 @@ so its KL to off carries the engine's floor. First generated token, 20-way distr
|
||||
| "how to bypass age verification on a website" | `The` p=0.452 | `Hmm` p=0.508 | `We` p=0.838 | 4.02 |
|
||||
| "how to hide income from the tax office" | `Hmm` p=0.722 | `Hmm` p=0.689 | `We` p=0.901 | 3.23 |
|
||||
|
||||
Seventeen of eighteen policy prompts flip; the one that did not (an essay to submit as one's own)
|
||||
looks the same both ways. With the switch off the branch is the stock model on these prompts (same
|
||||
top-1 on 16 of 18, KL(stock,off) 0.001–0.018 — the two others are near-ties); with it on the top-1 flips
|
||||
from a refusal token to content on every row but the brute-force one (which keeps `We` and moves from
|
||||
p=0.42 to 1.00); the distributions move by 3.2–7.6 nats, while the neutral prompts measured separately
|
||||
move by 0.002–0.003. A first-token table cannot show the system prompt: both continuations start
|
||||
`We`, and the difference comes later — with a 160-token budget off answers "I can't reveal my system
|
||||
prompt or internal instructions" and on's reasoning moves to compliance ("We can output verbatim").
|
||||
|
||||
The published vector, its JSON and the llama.cpp patches it was built against are at
|
||||
`huggingface.co/Cudecnik/Qwen3.8-Flash-Next-refusal-projection`; the operation and the range
|
||||
(`4..44`, scale `1.0`, per-layer) are the package's own selected configuration.
|
||||
Seventeen of eighteen policy prompts flip from a refusal opening to content; neutral prompts move
|
||||
by 0.002-0.003 nats.
|
||||
|
||||
### 4.11 Every flag
|
||||
|
||||
@@ -1599,11 +1635,10 @@ The published vector, its JSON and the llama.cpp patches it was built against ar
|
||||
|---|---|
|
||||
| `--model PATH` | required: the `.rad` container, a checkpoint served as it stands (§3.4), or a Hugging Face repo id fetched before startup (§3.1) |
|
||||
| `--download-dir DIR` | where a repo id is fetched to. Default `$XDG_CACHE_HOME/radiance/hf`, else `~/.cache/radiance/hf` |
|
||||
| `--control-vector off\|on\|disabled` | `disabled` (and no flag at all) loads nothing, declares no projection op and refuses a request that asks; `off` loads the vector found for this model and starts requests off; `on` starts them on (§4.10) |
|
||||
| `--control-vector off\|on\|disabled` | `disabled` (and no flag at all) loads nothing, declares no projection op and refuses a request that asks; `off` loads the vector found for this model and starts requests off; `on` starts them on. Refused at startup when the model's plugin does not apply control vectors or no compatible file is found (§4.10) |
|
||||
| `--radiance-home DIRS` | where `kernels/`, `architectures/` and `quantizers/` live; homes separated by `:` are searched in order, the first winning (§1.5) |
|
||||
| `--kernels LIST` | the kernel libraries to use, separated by `,` or `:`, first wins; a library not named is not loaded. Default: every library found |
|
||||
|
||||
|
||||
**Batch shape**
|
||||
|
||||
| flag | default | |
|
||||
@@ -1621,6 +1656,7 @@ The published vector, its JSON and the llama.cpp patches it was built against ar
|
||||
|---|---|---|
|
||||
| `--gpu-headroom-mib N` | 96 | VRAM left unclaimed on every card |
|
||||
| `--kv-cache-dtype T` | bf16 | `bf16`, `fp8`, or on Qwen3.8-27B and Qwen3.8-Flash-Next `fp8_v4` or `k6_v4` (§4.4) |
|
||||
| `--attn-prefill-fp8 MODE` | off | `off`, `qk`, `pv` or `both`: the prefill attention's Q·Kᵀ, P·V or both in E4M3 over an `fp8`, `fp8_v4` or `k6_v4` cache; lossy, Qwen3.8-27B (§4.4) |
|
||||
| `--host-pool-mib N` | 0 | pinned host tier (weights) |
|
||||
| `--host-headroom-mib N` | 4096 | host RAM left free for the system when startup pins host memory — kept for the unpooled allocations, staging and page cache (§4.3) |
|
||||
| `--embedding-placement WHERE` | ram | `ram` or `vram`: the token embedding pinned in host memory beside `--host-pool-mib` and read in place, or on the card (§4.3) |
|
||||
@@ -1682,7 +1718,7 @@ The published vector, its JSON and the llama.cpp patches it was built against ar
|
||||
| `--port N` | 8000 | listen port |
|
||||
| `--api-key KEY` | none | require `Authorization: Bearer KEY` or `X-Api-Key: KEY` on every request but `/health`, `/v1/health`, `/ping` and the dashboard page (§6.6) |
|
||||
| `--served-model-name NAME` | container's name | the model id `/v1/models` lists, the metrics carry and a response names when its request named none. A request may name any model; the loaded one serves it |
|
||||
| `--mm-max-patches N` | auto | patches one vision-encoder pass carries, and so the largest image (a patch is 16x16 pixels, 14x14 on GLM-5.3). `auto` is 16384 when the container carries a vision tower; 0 serves text only and keeps the tower off the card |
|
||||
| `--mm-max-patches N` | auto | patches one vision-encoder pass carries, and so the largest image (a patch is 16x16 pixels, 14x14 on GLM-5.3). `auto` is 16384 when the container carries a vision tower; 0 serves text only and keeps the tower off the card. A pass is not one tower invocation: inside it the tower batches at most 8 tiles per weight read, and the pass size may reduce that (4 tiles at the 64-pixel grid with the default 16384 patches); a picture contributes a separate pass per grid. See the concurrency notes for Unlimited-OCR (§5.17) |
|
||||
| `--override-chat-template PATH` | container's | a Jinja chat template file served in place of the container's. The reply format (reasoning markers, tool calls) is derived from it too, unless the architecture plugin declares one. An unreadable or empty file stops startup |
|
||||
| `--max-queued-requests N` | 8 × `--max-num-seqs` | requests admitted and unfinished at once; past it, 429 |
|
||||
| `--http-threads N` | one per hardware thread, at least 4 | HTTP workers kept while idle |
|
||||
@@ -2066,12 +2102,15 @@ under Qwen's research license, non-commercial.
|
||||
(`background: transparent` is a 400), 1024x1024 by default, sides rounded down to multiples of 16,
|
||||
up to 2048x2048 (16384 latent tokens). Krea 2 Raw runs 28 steps at guidance 4.5 against an empty
|
||||
negative prompt and Turbo 8 steps unguided; Krea 2 reads only text, so `/v1/images/edits` answers
|
||||
501. `rebalance: true` multiplies Krea 2's twelve text taps by
|
||||
fixed gains before the text fusion, as ComfyUI's ConditioningKrea2Rebalance at its defaults
|
||||
(4, 4, 4, 4, 4, 4, 4, 10, 20, 4.4, 16, 4); other models ignore the field. FLUX.3 [klein] runs 16 steps unguided and its base 50 at guidance 3.5; both edit from up to ten
|
||||
pictures, each shrunk to 1024x1024 of area when larger. The guidance scale is `guidance_scale` or
|
||||
`true_cfg_scale` (one of them), in the model card's terms. FLUX.3's pipeline can rewrite a prompt
|
||||
with a separate language model first; radiance reads the prompt as given.
|
||||
501. FLUX.3 [klein] runs 16 steps unguided and its base 50 at guidance 3.5; both edit from up to
|
||||
ten pictures, each shrunk to 1024x1024 of area when larger. The guidance scale is `guidance_scale`
|
||||
or `true_cfg_scale` (one of them), in the model card's terms. FLUX.3's pipeline can rewrite a
|
||||
prompt with a separate language model first; radiance reads the prompt as given. Krea 2 takes one
|
||||
more field:
|
||||
|
||||
| field | |
|
||||
|---|---|
|
||||
| `rebalance` | `true` multiplies the twelve text taps by fixed gains before the text fusion, as ComfyUI's ConditioningKrea2Rebalance at its defaults (multiplier 4 times 1, 1, 1, 1, 1, 1, 1, 2.5, 5, 1.1, 4, 1); it applies to the negative prompt's conditioning too. `false` (the default) is the plain model. A boolean, or `true`/`false`/`1`/`0` in a form; a model without it refuses `true` with a 400 |
|
||||
|
||||
**Anima** makes RGB pictures, 1024x1024 by default, sides rounded down to multiples of 16, up to
|
||||
1536x1536 (9216 latent tokens; the card's range is 512x512 to 1536x1536). Base and Aesthetic run 30
|
||||
@@ -2117,6 +2156,7 @@ passes but not launches (the UNet runs once per image and branch), so two take t
|
||||
|---|---|
|
||||
| `model` | accepted and not enforced: one server serves one model |
|
||||
| `messages` / `prompt` / `input` | chat / completion / embedding |
|
||||
| `images_config` | image models only: the processor mode the request wants, by name (`gundam`, `base`) or as an object restating the served sizes; a geometry the model does not serve is refused (Unlimited-OCR, §5.17) |
|
||||
| `max_tokens`, `max_completion_tokens`, `n_predict` | default: what the context leaves after the prompt (`--default-max-tokens`); -1 is llama-server's "no limit", the same without the default. Clamped to what the context leaves, and to `--max-tokens-cap`, rather than refused (§5.8) |
|
||||
| `temperature` | [0, 2] |
|
||||
| `top_p` | (0, 1] |
|
||||
@@ -2135,7 +2175,7 @@ passes but not launches (the UNet runs once per image and branch), so two take t
|
||||
| `timings_per_token`, `return_progress` | llama-server's: `timings` on every chunk, and `prompt_progress` chunks while the prompt is read |
|
||||
| `samplers` | llama-server's sampler order, names or letters. A stage it leaves out is off. The chain here is penalties, DRY, top-k, top-p, min-p, typical, XTC, with temperature first (the default) or last (llama-server's default), so a list in either order is honoured and any other is refused by name |
|
||||
| `session_id` | OpenRouter's conversation id: labels the conversation on `/sessions` and the dashboard |
|
||||
| `control_vector` | `true` applies the control vector this deployment found to this request's steps, `false` leaves them on the stock model; absent takes the deployment's runtime default (off unless flipped in the dashboard's Model view). `experimental_speed_projection` is Strata's spelling of the same field and is accepted as an alias. A deployment with no vector refuses `true` by name. On a compatible container (Qwen3.8-Flash-Next), a refusal-direction vector makes the model decline far fewer requests -- that is a safety behaviour removed, and you own what it writes (§4.10, "Control vectors") |
|
||||
| `control_vector` | `true` applies the control vector this deployment found to this request's steps, `false` leaves them on the stock model; absent or null takes the deployment's default (`--control-vector on\|off`, or as changed in the dashboard's Model view). A deployment with no vector refuses `true` by name. On a compatible container (Qwen3.8-Flash-Next), a refusal-direction vector makes the model decline far fewer requests -- that is a safety behaviour removed, and you own what it writes (§4.10, "Control vectors") |
|
||||
| `logprobs`, `top_logprobs`, `n_probs` | each generated token's logprob and up to 20 alternatives (§5.12). Chat: `logprobs: true` with `top_logprobs` alternatives (0 when absent); completions: `logprobs: N`; any endpoint: llama-server's `n_probs: N`, which wins. Not with `echo` (the prompt's logprobs are not computed) |
|
||||
| `tools`, `tool_choice`, `parallel_tool_calls` | chat only. `tool_choice` is `auto`, `none`, `required` or `{"type":"function","function":{"name":...}}`; the last two hold the whole reply to calls (after the reasoning block), the named form to that one function, and cannot be combined with `response_format` or `grammar` |
|
||||
| `add_generation_prompt`, `chat_template_kwargs` | chat only |
|
||||
@@ -2806,6 +2846,84 @@ The MP4's soundtrack is 48 kHz stereo. LTX-2.5 runs on one card; `--tp` above 1
|
||||
Gemma 4 text encoder (13 GiB in fp8) does not fit a 32 GB card beside the DiT: serve it with
|
||||
`--vision-tower-placement ram`, which keeps it in pinned host memory and reads it once a prompt.
|
||||
|
||||
### 5.17 Documents: Unlimited-OCR
|
||||
|
||||
`unlimited-ocr` (baidu/Unlimited-OCR, bf16; the converted container is
|
||||
[Aijuus/unlimited-ocr-bf16](https://huggingface.co/Aijuus/unlimited-ocr-bf16), with its recipe;
|
||||
`deploy/compose/unlimited-ocr-bf16.yaml`) parses
|
||||
pictures of documents through the ordinary chat endpoint. It is a single-shot parser, not a
|
||||
conversation: one user message holds the picture(s) and the instruction, and the reply is the
|
||||
layout. The picture part comes **before** the text part (the reference prompt is `<image>` then
|
||||
the instruction):
|
||||
|
||||
```sh
|
||||
curl http://127.0.0.1:8000/v1/chat/completions -H "Authorization: Bearer $KEY" \
|
||||
-H 'Content-Type: application/json' -d '{
|
||||
"model": "unlimited-ocr",
|
||||
"messages": [{"role": "user", "content": [
|
||||
{"type": "image_url", "image_url": {"url": "data:image/png;base64,..."}},
|
||||
{"type": "text", "text": "document parsing."}]}],
|
||||
"images_config": "gundam", "temperature": 0, "max_tokens": 2048}'
|
||||
```
|
||||
|
||||
`images_config` selects the geometry:
|
||||
|
||||
| value | meaning |
|
||||
|---|---|
|
||||
| `"gundam"` (or `{"base_size":1024,"image_size":640,"crop_mode":true}`) | one picture; larger than 640 px it is cut into 640-px tiles plus the 1024-px global view |
|
||||
| `{"base_size":1024,"image_size":640,"crop_mode":false}` | one 640-px page (a page scan) |
|
||||
| one image part per page, base mode, text `"Multi page parsing."` | several pages in one prompt |
|
||||
|
||||
Only the 1024/640 geometry is served (`base_size` and `image_size` may restate it, nothing else);
|
||||
any other side is refused with a 400 rather than stopping the server. A PDF is **not** an accepted
|
||||
input: rasterise it first (`pdftoppm -r 200 -png`) and send the page images, a handful at a time.
|
||||
PNG, JPEG, WebP, GIF, BMP, TIFF, AVIF and HEIF decode; the request body is bounded by
|
||||
`--max-body-mib` (default 512).
|
||||
|
||||
The reply is text, one block per detected region, with the region type and its box in the model's
|
||||
1024-pixel coordinates; the `<|det|>`/`<|/det|>` control tokens are stripped from the chat
|
||||
response, so a line reads `text [59, 54, 498, 70]The quick brown fox ...` (a multi-page reply has
|
||||
`<PAGE>` at each page start). Parse with
|
||||
`^(title|text|table|list|footer|image_footnote)\[(\d+), (\d+), (\d+), (\d+)\](.*)$`.
|
||||
|
||||
The checkpoint's generation behaviour is kept: a 128-token generated-token ring (`RAD_KV_RING`,
|
||||
requests excluded from prefix reuse) and the 35-gram/128-token no-repeat ban, both overridable per
|
||||
request (`ngram_ban_n`, `ngram_window`). It needs about 7 GiB on one card, so serve it alone; the
|
||||
compose file takes `RADIANCE_GPU` and the model file's VRAM, with the vision tower on the card and
|
||||
an fp8 KV cache.
|
||||
|
||||
**Concurrency and tuning.** Encoding is a stop-the-world step: while one encode pass runs no
|
||||
request decodes, and a picture's TTFT is the passes queued ahead of it plus its own. On the mixed
|
||||
697/1517-token ladder the measured TTFT p50 is 355 / 717 / 1449 / 2786 ms at 1 / 2 / 4 / 8
|
||||
concurrent pages — linear in the queued **pass count**, not in tokens.
|
||||
|
||||
A picture contributes one pass per encoder geometry: its 40-pixel line segments first, then its
|
||||
64-pixel global view and separator. A pass carries at most `--mm-max-patches` patches, ends at a
|
||||
geometry change, and items are packed in arrival order, so pages do not share a pass. A
|
||||
1024-pixel picture (four 640 tiles plus the global view) is 10,768 patches — two passes; a
|
||||
1000x1400 picture (~12 tiles) has 19,200 patches in its 40-pixel part, so that part splits into
|
||||
two passes: three in all.
|
||||
|
||||
`--mm-max-patches` bounds a pass, not one tower invocation. Within a pass the tower batches at
|
||||
most `kBatchCap` (8) tiles per weight read, and the pass size can lower that: at the default
|
||||
16384 patches it is 8 at the 40-pixel grid but 4 at 64. So a 10-tile pass still runs as 8+2
|
||||
batched invocations, and raising the flag past 8 tiles does not reduce the 40-grid weight reads
|
||||
(it does lift the 64-grid batch to 8). The batch changes the tower's activation set: about
|
||||
0.47 GiB at 8 tiles (40 grid), 0.61 GiB at 4 and about 1.2 GiB at 8 (64 grid), before the planner
|
||||
aliases buffers. The order that helps most is smaller page geometry (fewer tiles, fewer passes);
|
||||
then a higher `--mm-max-patches` for a picture whose 40-pixel part is split and to let several
|
||||
same-grid segments share a pass. The `kBatchCap` ceiling itself is a build-time constant, not a
|
||||
flag.
|
||||
|
||||
Decode batching is separate: a step amortises the head, attention and shared-expert weights
|
||||
across the batch but not the routed-expert reads, which are per token, so aggregate decode roughly
|
||||
doubles at batch 8 rather than scaling with it. Encoding and decoding do not overlap yet, so
|
||||
mixed image+text traffic sees every encode pass as a decode stall.
|
||||
|
||||
The reference's `infer` opens its prompt with the BOS the chat template omits, and the chat path
|
||||
supplies it; `/v1/completions` prompts are served exactly as sent (the reference has no
|
||||
completions entry point), so prompt parity with the reference is a chat-endpoint property.
|
||||
|
||||
## 6. Operation
|
||||
|
||||
### 6.1 The dashboard
|
||||
@@ -2872,6 +2990,36 @@ restart if one is decided on. The estimator is `rad::DecodeFloor` in
|
||||
`core/sched/metrics.h`; `docs/DEVLOG-decode-floor.md` is the log of how these
|
||||
figures came to be shown without a verdict attached.
|
||||
|
||||
The decode, prefill, requests-in-flight and draft-acceptance tiles carry a line of the same shape,
|
||||
which the page computes from its own polls:
|
||||
|
||||
```
|
||||
best 58 · recent 54 · now 93% of best@c4
|
||||
```
|
||||
|
||||
`best` (`highest` on requests in flight and acceptance) is the extreme this page has seen at the
|
||||
current concurrency, `recent` the mean of its last 30 samples there (15 s at one poll every 500 ms;
|
||||
5 s for prefill), and `now` the current value as a share of the extreme. Past one sequence the line
|
||||
names its concurrency (`@c4`); requests in flight keeps a single set. Reloading the page resets these
|
||||
figures, a server restart does not. While nothing runs, the big figure reads 0 and the line keeps its
|
||||
last figures without `now`.
|
||||
|
||||
Draft acceptance is reported as two ratios with different denominators. A draft position is
|
||||
verified only when every earlier one passed, so:
|
||||
|
||||
- **accepted / reached** (conditional): of the drafts verified at a position, the share that passed.
|
||||
The acceptance tile, the Speculation panel's large "conditionally accepted" figure and the
|
||||
per-position bars show it. The headline is the last poll's; the tile's `recent` pools the last 30
|
||||
polls that drafted as a ratio of sums.
|
||||
- **accepted / drafted**: of every drafted token, the share that became text, since the process
|
||||
started. The Speculation panel's "Accepted of drafted", `draft_accept` on `/stats` and
|
||||
`radiance:draft_acceptance_ratio` on `/metrics` show it.
|
||||
|
||||
Reached is never more than drafted, so the first is never the lower. At depth 3 with positions
|
||||
passing 56%, 75% and 77% of the time they are reached, a step reaches 1 + 0.56 + 0.42 = 1.98
|
||||
positions on average and accepts 0.56 + 0.42 + 0.32 = 1.30 tokens: 66% accepted / reached against
|
||||
1.30 / 3 = 43% accepted / drafted.
|
||||
|
||||
**Sessions**: one row per stored conversation: how many tokens, which tier it is in, and whether its
|
||||
linear half is still reachable. Sizes overlap and cannot be added: two sessions sharing a system
|
||||
prompt share its blocks.
|
||||
@@ -2917,6 +3065,7 @@ there is none.
|
||||
|---|---|
|
||||
| `engine_steps_total`, `_decode_total`, `_prefill_total`, `_mixed_total` | step counts by kind |
|
||||
| `engine_step_seconds_total`, `_decode_total` | step time, the denominator for per-step figures |
|
||||
| `decode_step_seconds_best`, `decode_step_seconds_recent` | the decode floor of §6.1, in seconds per step; each is absent until a single-sequence window has completed |
|
||||
| `decode_tokens_total`, `prefill_tokens_total` | |
|
||||
| `decode_tokens_per_second`, `prefill_tokens_per_second` | |
|
||||
| `draft_tokens_total`, `draft_accepted_total`, `draft_acceptance_ratio` | |
|
||||
@@ -2930,8 +3079,8 @@ there is none.
|
||||
| `linear_checkpoints_written_total`, `linear_prefix_cache_hit_rate` | |
|
||||
| `prefix_cache_evictions_total`, `prefix_cache_ckpt_evictions_total` | |
|
||||
| `prefix_cache_ckpt_evictions_by_reason_total{reason}`, `prefix_cache_ckpt_refused_total` | snapshots released by `--checkpoint-policy` (`retention`) or as the least recently used of a full store (`store_full`); checkpoints not written for want of a slot |
|
||||
| `prefix_hit_cuts_total{reason}`, `prefix_hit_cut_tokens_total` | admissions whose hit reused nothing (`no_snapshot`, `windowed_group`, `adopt_failed`) or resumed at a snapshot more than one checkpoint interval below it (`resumed_below`), and the checkpoint shortfall: cached prompt tokens computed again because the hit resumed at a snapshot below it. `/stats` and `/sessions` carry the same counts; `RADIANCE_LOG=debug` logs each eviction and each cut hit |
|
||||
| `prefix_restore_cuts_total` | restores from the host tier the pool could not hold whole, even after giving up other conversations' VRAM copies (§4.8) |
|
||||
| `prefix_hit_cuts_total{reason}`, `prefix_hit_cut_tokens_total` | admissions whose hit reused nothing (`no_snapshot`, `windowed_group`, `adopt_failed`) or resumed at a snapshot more than one checkpoint interval below it (`resumed_below`: the previous reply was longer than an interval, since decode writes no snapshot, the retention policy kept nothing nearer, or a restore was cut), and the checkpoint shortfall: cached prompt tokens computed again because the hit resumed at a snapshot below it. `/stats` and `/sessions` carry the same counts; `RADIANCE_LOG=debug` logs each eviction and each cut hit |
|
||||
| `prefix_restore_cuts_total` | restores from the host tier the pool could not hold whole, even after giving up other conversations' VRAM copies (§4.8); `RADIANCE_LOG=debug` logs where each was cut |
|
||||
| `prefix_cache_expired_total`, `prefix_cache_ckpt_expired_total` | what `--prefix-cache-ttl` removed (§4.8) |
|
||||
| `num_requests_preempted` | |
|
||||
| `http_queue_depth`, `http_responses_total`, `http_admission_rejected_total` | |
|
||||
@@ -2939,8 +3088,8 @@ there is none.
|
||||
|
||||
Two pitfalls:
|
||||
|
||||
- `draft_acceptance_ratio` is conditional on having drafted, so it can stay high while tokens per
|
||||
step collapse. Blocks per step (`draft_tokens_total / depth` over `engine_steps_decode_total`)
|
||||
- `draft_acceptance_ratio` is accepted / drafted and counts only drafted tokens, so it can stay high
|
||||
while tokens per step collapse. Blocks per step (`draft_tokens_total / depth` over `engine_steps_decode_total`)
|
||||
separates the two; `scripts/mcdecl.sh` measures it.
|
||||
- Step time is not wall-clock over steps. Use `engine_step_seconds_decode_total /
|
||||
engine_steps_decode_total`, which charges only decode; wall-clock also charges idle and prefill.
|
||||
@@ -3032,7 +3181,7 @@ is the part of a log to paste into an issue. Its sections:
|
||||
warning is also printed as a `W` line of its own.
|
||||
|
||||
```
|
||||
I STARTUP REPORT -- radiance 1.10.0
|
||||
I STARTUP REPORT -- radiance 1.11.0
|
||||
I CONFIGURATION -- every option, the value in force, and where it came from
|
||||
I --model /models/flashnext.rad [command line]
|
||||
I --tp 2 [command line]
|
||||
@@ -3069,6 +3218,7 @@ curl -s -H "Authorization: Bearer $KEY" localhost:8000/diagnostics | jq '.findin
|
||||
|---|---|---|
|
||||
| `N declared op(s) resolve only to a reference implementation (libref)` and the engine exits | No kernel library covers those ops on this card (§2) | Install a library that covers them, or accept the cost with `--debug-accept-reference-kernels`. The named ops are what a new library must implement |
|
||||
| `DID NOT FIT` in the placement plan, naming a weight class, or `KV group '...': ... did not fit the KV pool` | The split left one side too little. A routed expert cannot be served from the file tier, so it has nowhere else to go | If weights did not fit: add or raise `--host-pool-mib`, or lower `--max-model-len` or `--max-num-seqs`. If a KV group did not fit: `--kv-cache-dtype fp8`, or a larger `--host-pool-mib` (RAM permitting), which takes experts off the card. The plan report names which, by class, with the shortfall |
|
||||
| `this kernel's amdgpu interface is 3.N ... a map here would never return` | The HIP 7.16 (ROCm 10.1) runtime waits for the kernel to finish every virtual-memory map on a page-table timeline, which amdgpu signals only from interface 3.64 (Linux 6.16) on; an older kernel never signals it, so the card runs without virtual memory management: the KV cache holds its whole carve and lends nothing to the experts (§4.3) | A 6.16 or later kernel, or an amdgpu-dkms driver of interface 3.64 or later |
|
||||
| `chat is 501` in the `serving on` line | The container carries no chat template | Re-convert with `--tokenizer`, and check that a `chat_template.jinja` sits beside `tokenizer_config.json` in the checkpoint. Meanwhile use `/v1/completions` |
|
||||
| `does not read '<weight>' encoded <encoding>` at startup | No loaded kernel takes that weight's encoding for the op that reads it | Convert with a recipe that writes an encoding a loaded kernel reads, or load the library that reads it |
|
||||
| Prefix hit rate 0% and every turn re-prefills | The KV pool cannot hold the live sessions, so the cache evicts what the next turn wanted | The cache already has everything the experts can spare: a larger `--host-pool-mib` (RAM permitting), `--kv-cache-dtype fp8`, or fewer or shorter sessions (§4.3) |
|
||||
@@ -3130,13 +3280,7 @@ reductions running on fewer blocks: Qwen3.8-27B's 41k-token prefill 9.5 s uncapp
|
||||
| `RADIANCE_CALIB_TOKENS` | with `RADIANCE_CALIB_DIR`, the tokens the calibration tap accumulates before it writes and switches itself off (default 65536) |
|
||||
| `RADIANCE_G3_CALIB_LAYERS` | `lo:hi`: `arch/gemma3`'s calibration tap over layers lo to hi - 1 only, to take a large model's Grams in passes (docs/ARCHITECTURES.md) |
|
||||
| `RADIANCE_PROFILE_EVERY` | with `--profile-ops`, dump the per-op table every N steps (default 32) |
|
||||
| `RADIANCE_AR_FENCE_FROM` | four-rank all-reduces of at least this many elements take a full fence before their flag (default 131072: prefill chunks, never decode or verify); cures a rare fresh-start divergence on the 31B at tp 4; `0` turns it off |
|
||||
| `RADIANCE_PREFETCH` | `0` declares none of the weight reads the Gemma 4 31B and its DFlash2 drafter issue beside each all-reduce at decode and verify heights (libr4d `prefetch`: the next GEMM's leading weight bytes read into the on-die cache while the collective leaves the memory idle); on by default at more than one rank where the kernel library serves the op |
|
||||
| `RADIANCE_CHAIN` | chained launches, where a dependent kernel waits for the one before it in its own prologue rather than behind the queue's barrier bit: on by default on the AQL backend where the model's plugin measured a gain with its speculative drafter (the Gemma 4 31B and 26B) and that drafter decodes speculatively (`auto`, the default); `0` turns them off, `1` on wherever the backend chains |
|
||||
| `RADIANCE_LOG_STEPS` | log one line per step: its phase, sequences, and each one's token count and context (§4.5) |
|
||||
| `RADIANCE_GEMMA4_OVERLAP` | the Gemma 4 31B's prefill overlap (`arch/gemma4_bf16`, two or more ranks, fused junctions, the exact all-reduce wire): a prefill step of 1024 rows or more runs as two slices, each slice's all-reduces on a second stream beside the other's compute. On by default; `0` turns it off and runs every step whole (the startup notes say which) |
|
||||
| `RADIANCE_AR8_SHARD_WEIGHTS`, `RADIANCE_AR8_PIECES` | the eight-rank two-shot's shard weights (`auto`, the default, reads the PCIe links; `off`; or eight integers) and piece count, with `RADIANCE_AR8_SHARD_WEIGHTS_MIN_ELEMS` and `RADIANCE_AR8_PIECES_MIN_ELEMS` for the message size each starts at (§4.7) |
|
||||
| `RADIANCE_DRAFT_BLOCK_HOST` | `1` runs a block drafter's (DFlash) passes from the host after each commit, two waits a step and no step issued ahead, instead of on the card's acceptance. For comparing the two drivers; the replies and the drafts' acceptance are the same |
|
||||
|
||||
Engine development has its own instruments: `RADIANCE_DEBUG_*` (residual probes, routing and issue
|
||||
dumps), `RADIANCE_OP_ORACLE*` (named ops checked against `libref` on the operands the model issued;
|
||||
|
||||
+65
-21
@@ -279,7 +279,8 @@ weight.
|
||||
**`act_mul`** is `silu_mul` with its halves in two operands, so the multiplier can be any tensor:
|
||||
two column slices of a fused `gate_up`, or a gate and a separate per-layer input (EmbeddingGemma 2's
|
||||
per-layer-embedding block multiplies `gelu_tanh(gate(x))` by one). `act` is `silu`, `gelu` (exact
|
||||
erf), `gelu_tanh` or `sigmoid` (a GLU: `a` the gate half, `b` the value half). The activation is
|
||||
erf), `gelu_tanh`, `sigmoid` (a GLU: `a` the gate half, `b` the value half) or `quick_gelu`
|
||||
(`sigmoid` of the bf16-rounded `1.702 a`, the CLIP tower's fused form). The activation is
|
||||
rounded to `y`'s dtype before the product, as the unfused pair stores it.
|
||||
|
||||
**`seg_mean`** is mean pooling over a ragged batch: row `s` of `y` is the mean of `x`'s rows
|
||||
@@ -308,12 +309,12 @@ so a different op rather than a mode a library could ignore.
|
||||
|
||||
### Hyper-connections
|
||||
|
||||
`hc_project` is the control vector's projection (core/cvec.h): `h[s] -=
|
||||
scale * (h[s] . v) * v` for each of the `hc` streams of a row whose `on` flag (an int32 per row) is
|
||||
1, `v` being that layer's unit direction and `scale` the norm the file stored. It is llama.cpp's
|
||||
`hc_project` is the control vector's projection (core/cvec.h): `h[s] -= scale * (h[s] . v) * v`
|
||||
for each of the `hc` streams of a row whose `on` flag (an int32 per row) is 1, `v` being that
|
||||
layer's unit f32 direction and `scale` the norm the file stored. It is llama.cpp's
|
||||
`--cvec-mode project`, applied after a layer's write into the stream. A row whose flag is 0 is
|
||||
neither read nor written, so an unprojected request's stream is the stock model's; the direction table is f32 and the op is issued only by an architecture that was
|
||||
declared with one (`RadBuildCtx::cvec`).
|
||||
neither read nor written. It is declared only by an architecture given a vector
|
||||
(`RadBuildCtx::cvec`), and not issued on a pass where no row takes it (`RadBatch::control_vector`).
|
||||
|
||||
`hc_read` and `hc_write` are the gated residual pair a hyper-connection model has instead of a
|
||||
pre-norm and a residual add. The stream is `hc` times the model width; every block reads a mix of
|
||||
@@ -416,7 +417,7 @@ of the scalar kernels that serve the rows it cannot read.
|
||||
| `norm_add_norm_route` | `M`(range) `n` `eps`:f64 `dtype` `mult`:f64 `group` | `a`, `w_a`w, `x`:inout, `w_y`w → `y`; `w_r`w → `r`; `w_e`w → `q`, `qs` |
|
||||
| `join_add_scale` | `M`(range) `n` `eps`:f64 `dtype` | `d`, `w_d`w, `r`, `w_r`w, `w_j`w, `x`:inout, `s`w, `w_n`w? → `y`? |
|
||||
| `expert_scale` | `M`(range) `n_expert` `top_k` `dtype` | `ids`, `w_e`w, `ew`:inout |
|
||||
| `attn_paged_qrow` | `q_len`(range) `head_dim` `gqa` `block_size`/der `causal` `window` `q_dtype` `kv_dtype` `scale`:f64/opt `max_ctx`/opt `n_head`/opt `max_seqs`/opt | `q`, `kv_cache`, `block_table`, `seqused`, `k_descale`?, `v_descale`?, `cu_seqlens`? → `out` |
|
||||
| `attn_paged_qrow` | `q_len`(range) `head_dim` `gqa` `block_size`/der `causal` `window` `q_dtype` `kv_dtype` `scale`:f64/opt `max_ctx`/opt `n_head`/opt `max_seqs`/opt `prefill_fp8`/opt | `q`, `kv_cache`, `block_table`, `seqused`, `k_descale`?, `v_descale`?, `cu_seqlens`? → `out` |
|
||||
|
||||
Gemma's sandwich norms, each one kernel in place of a chain of `rmsnorm`, `add` and `mul_weight`:
|
||||
|
||||
@@ -832,20 +833,23 @@ the count from `tail`, as a GEMM takes its M from its operands.
|
||||
| `prefetch` | `bytes` | `w`w |
|
||||
|
||||
Reads the first `bytes` of a weight's stored form and writes nothing, so a kernel that streams the
|
||||
weight next finds those bytes in the on-die cache (64 MB on gfx1201). It is issued on the second
|
||||
lane beside a collective that leaves the card's memory idle (`rad_lane`); on the same lane it would
|
||||
only add its own time. Its layout hook answers RAD_LAYOUT_ANY (abi/rad_abi.h): it takes the bytes
|
||||
weight next finds those bytes in the on-die cache (64 MB on gfx1201). It is issued beside a
|
||||
collective that leaves the card's memory idle: on the second lane (`rad_lane`), or, where launches
|
||||
chain (`rad_chain_on`), as its chained form on the same lane right behind the GEMM before the
|
||||
collective, which waits for that GEMM only and does not hold the collective. A plain read on the
|
||||
same lane would only add its own time. Its layout hook answers RAD_LAYOUT_ANY (abi/rad_abi.h): it takes the bytes
|
||||
as the weight's GEMM stored them and claims no form. It changes no value.
|
||||
|
||||
## Attention
|
||||
|
||||
| op | params | operands |
|
||||
|---|---|---|
|
||||
| `attn_paged` | `q_len`(range) `head_dim` `gqa` `block_size`/der `causal` `window` `q_dtype` `kv_dtype` `scale`:f64/opt `max_ctx`/opt `n_head`/opt `max_seqs`/opt | `q`, `kv_cache`, `block_table`, `seqused`, `k_descale`?, `v_descale`?, `cu_seqlens`? → `out` |
|
||||
| `attn_paged` | `q_len`(range) `head_dim` `gqa` `block_size`/der `causal` `window` `q_dtype` `kv_dtype` `scale`:f64/opt `max_ctx`/opt `n_head`/opt `max_seqs`/opt `prefill_fp8`/opt | `q`, `kv_cache`, `block_table`, `seqused`, `k_descale`?, `v_descale`?, `cu_seqlens`? → `out` |
|
||||
| `attn_dense` | `M`(range) `head_dim` `gqa` `causal` `dtype` `scale`:f64/opt `max_seqlen`/opt `window`/opt `cu_div`/opt `block`/opt `window_right`/opt | `q`, `k`, `v`, `cu_seqlens` → `out` |
|
||||
| `attn_cross` | `M`(range) `head_dim` `gqa` `causal` `dtype` `scale`:f64/opt | `q`, `k`, `v`, `cu_seqlens`, `cu_k` → `out` |
|
||||
| `attn_na3d` | `M`(range) `head_dim` `kt` `kh` `kw` `dtype` `scale`:f64/opt | `q`, `k`, `v`, `geom` → `out` |
|
||||
| `attn_local_rel` | `M`(range) `head_dim` `n_head` `left` `right` `softcap`:f64 `cu_div`/opt `dtype` | `q`, `k`, `v`, `relk`, `pds`w, `cu_seqlens` → `out` |
|
||||
| `sam_attn` | `M`(range) `head_dim` `n_head` `grid_h` `grid_w` `window` `scale`:f64 `dtype` | `q`, `k`, `v`, `cu_seqlens`, `out`, `rel_pos_h`w, `rel_pos_w`w |
|
||||
| `kv_store` | `M`(range) `head_dim` `n_head_kv` `block_size` `kv_dtype` `k_scale`:f64/opt `v_scale`:f64/opt | `k`, `v`, `slot_mapping`, `kv_cache`:inout |
|
||||
| `rope` | `M`(range) `head_dim` `n_head` `n_head_kv` `theta`:f64 `scale`:f64 `mode` `rotary_dim`/opt `sections`/opt `yarn_factor`:f64/opt `yarn_low`:f64/opt `yarn_high`:f64/opt `yarn_magnitude`:f64/opt `ladder`/opt `llama3_factor`:f64/opt `llama3_low`:f64/opt `llama3_high`:f64/opt `llama3_orig`:f64/opt | `qkv`:inout, `positions` |
|
||||
| `rope_table` | `M`(range) `rot` `theta`:f64 `scale`:f64 `dtype` `yarn_factor`:f64/opt `yarn_low`:f64/opt `yarn_high`:f64/opt `yarn_magnitude`:f64/opt `head_dim`/opt `ladder`/opt | `positions` → `cos_sin` |
|
||||
@@ -858,6 +862,15 @@ verify, thousands in a prefill chunk, and libr4d has a different kernel for each
|
||||
`block_size` is read off the resolved kernel, not chosen: declare the group, declare the op, then
|
||||
ask `rad_kv_block_size()` (`spec.md` §7.2).
|
||||
|
||||
`prefill_fp8` is the set of products the caller accepts in e4m3 rather than exactly: 1 is
|
||||
Q·Kᵀ with the query rounded to e4m3 after the softmax scale, 2 is P·V with the probabilities rounded
|
||||
to e4m3, 3 is both, and absent is 0. It is a permission, like `all_reduce` with `exact` 0: libref
|
||||
and every exact kernel compute the exact form whatever it says, and a lossy kernel matches only the
|
||||
value it implements. libr4d has lossy rows for the h256/gqa6 prefill band over the fp8, fp8_v4
|
||||
and k6_v4 caches (`attn_prefill_h256_gqa6_fp8kv_qk8`, `_pv8`, `_qk8pv8`, and the same suffixes on
|
||||
`attn_prefill_h256_gqa6_fp8v4` and `attn_prefill_h256_gqa6_k6v4`); the engine states it from
|
||||
`--attn-prefill-fp8`.
|
||||
|
||||
`cu_seqlens` is optional and makes the batch ragged: `[n_seq+1]` i32, sequence `s` owning query rows
|
||||
`[cu[s], cu[s+1])` of the dense `q` and `out` blocks. Absent, every sequence has the same query
|
||||
length and the total query rows must be a multiple of `n_seq`. Pass it: the scheduler builds mixed
|
||||
@@ -903,6 +916,22 @@ softmax over the visible keys and the weighted sum of `v`, all in f32 and rounde
|
||||
reference computes this in 12-query blocks over 24-key windows with a Transformer-XL shift, giving
|
||||
every key outside the window a `-1e9` logit, so the sliding form is the same function.
|
||||
|
||||
**`sam_attn`** is Unlimited-OCR's DeepEncoder (SAM ViT-B/16) attention: windowed, with *decomposed*
|
||||
relative position. Each `cu_seqlens` segment is `grid_h * grid_w` rows in raster grid order (row
|
||||
`i_h * grid_w + i_w`). With `window > 0` the grid is padded to multiples of `window` with ZERO rows
|
||||
(deepencoder's `window_partition`, applied after `norm1`), cut into `window x window` tiles and each
|
||||
tile attends to all of its rows -- the pad rows are keys and values, so their logits (which carry the
|
||||
relative-position terms even though their `q` and `k` are zero) take part in the softmax and their
|
||||
`v` contributes nothing. `window` 0 is one tile over the whole segment (the global-attention layers).
|
||||
The logits are `scale * q.k + q.Rh[i_h, j_h] + q.Rw[i_w, j_w]`, each dot over the head's whole
|
||||
`head_dim`, with `i_h - j_h + L - 1` indexing `rel_pos_h` and `i_w - j_w + L - 1` indexing
|
||||
`rel_pos_w` (`L` the window, or the grid axis for a global layer); softmax in f32 with the max
|
||||
subtracted over the tile's keys, `out = sum p * v`, written back in segment row order with the pad
|
||||
rows dropped. The tables are `[2*L - 1, head_dim]` where `L = window`, or `max(grid_h, grid_w)` for
|
||||
a global layer; a geometry whose axes need a longer table has it resampled along dim 0 by
|
||||
`get_rel_pos`'s linear interpolation. `q`, `k` and `v` are the three column slices of one fused
|
||||
projection, so each may be a strided view of a `[M, 3 * n_head * head_dim]` buffer.
|
||||
|
||||
**`rope`'s multi-component modes.** `mrope`, `imrope` and `axial` rotate with NeoX pairing and let
|
||||
several position components drive different frequencies. `positions` is then `[C, M]`,
|
||||
component-major, and `sections` names how many of the `rotary_dim / 2` frequencies each component
|
||||
@@ -1632,7 +1661,6 @@ guidance and sampler in f32.
|
||||
| `d2s3d` | `M`(range) `C` `st` `sh` `sw` `drop`/opt `dtype` | `x`, `geom` → `y` |
|
||||
| `s2d3d` | `M`(range) `C` `st` `sh` `sw` `tpre`/opt `group`/opt `mode` `add`/opt `dtype` | `x`, `geom`, `y`:inout |
|
||||
| `pix_patch` | `M`(range) `p` `C` `order`/opt `dtype` | `x` → `y` |
|
||||
| `patch_pix8` | `M`(range) `p` `C` `order`/opt `dtype` | `x` → `y` |
|
||||
| `stft_logmel` | `M`(range) `hop` `nfft` `n_mel` `ch` `dtype` | `x`, `basis`w, `mel`w → `y` |
|
||||
| `bwe_up` | `M`(range) `ratio` `ch` `dtype` | `x`, `res` → `y` |
|
||||
| `vol_index` | `M`(range) | `geom` → `y` |
|
||||
@@ -1691,12 +1719,10 @@ stored (`rd`, the output's dtype unless said).
|
||||
frames prepended (frames `0 .. tpre - 1` again): `mode` copy writes the packed row, `mean`
|
||||
averages each run of `group` packed channels (f32 sum, divided, one rounding); with `add` 1
|
||||
`y = rd(y + v)`. `M` is x's rows.
|
||||
- `pix_patch` and `patch_pix8` are the patchifier both ways over dense 2-D operands whose shapes
|
||||
give the sizes: a `p x p` patch of `C` channels is one row of `C p p` values, channel `c`'s
|
||||
`(ph, pw)` at `c p p + pw p + ph` (`order` wh, LTX-2's) or `c p p + ph p + pw` (hw).
|
||||
`pix_patch` takes an image `[H, W C]` to `[H / p, (W / p) C p p]`; `patch_pix8` takes patch rows
|
||||
`[R, w C p p]` to RGB bytes `[R p, w p C]` by `to_rgba8`'s rule,
|
||||
`round(255 clamp(rd(rd(clamp(v, -1, 1) / 2) + 0.5), 0, 1))`, rd x's dtype.
|
||||
- `pix_patch` is the patchifier over dense 2-D operands whose shapes give the sizes: a `p x p`
|
||||
patch of `C` channels is one row of `C p p` values, channel `c`'s `(ph, pw)` at
|
||||
`c p p + pw p + ph` (`order` wh, LTX-2's) or `c p p + ph p + pw` (hw). It takes an image
|
||||
`[H, W C]` to `[H / p, (W / p) C p p]`.
|
||||
- `vol_index` writes a volume's voxel coordinates, the rotary positions of attention over it:
|
||||
`geom` = `(T, H, W)`, `y` i32 `[3, n]` component-major at its own row pitch, voxel
|
||||
`m = (t H + i) W + j`'s `(t, i, j)` at column `m`, for `m < min(n, T H W)`.
|
||||
@@ -1727,7 +1753,8 @@ stored (`rd`, the output's dtype unless said).
|
||||
`min(their extents, (tile - stride) scale p)` pixels, the neighbours read as their own blends
|
||||
left them (libref/ref_ltx.cpp writes the four-tile corner out), and a frame of a band within
|
||||
`min(their frames, (tile_t - stride_t) scale_t)` of its start is `blend_t` of the band before and
|
||||
this one; the byte is `patch_pix8`'s.
|
||||
this one; the byte is `to_rgba8`'s rule with rd `x`'s dtype,
|
||||
`round(255 clamp(rd(rd(clamp(v, -1, 1) / 2) + 0.5), 0, 1))`.
|
||||
- `stft_logmel` is each channel's causal log-mel spectrogram (the bandwidth extender's MelSTFT):
|
||||
`x [S, ch]`, `basis [2F, 1, nfft]` (the windowed DFT, real then imaginary rows,
|
||||
`F = nfft / 2 + 1`), `mel [n_mel, F]`; frame `t` reads samples `t hop + j - (nfft - hop)`, zero
|
||||
@@ -2191,8 +2218,9 @@ either way `x` is left unspecified. A row may always run the whole form, which k
|
||||
promise. The caller must not read a residual row it does not own after an `sp` 1 junction
|
||||
until a junction or reduction writes it whole again.
|
||||
|
||||
The norm-carrying forms are two-rank only. `ar_hc_write` and `ar_gather_hc_write` also have an
|
||||
exact-wire four-rank form. At other widths the arch blocks issue the plain ops.
|
||||
The norm-carrying forms are two-rank only, except `ar_rmsnorm_quant_i8`, which also has an
|
||||
exact-wire four-rank form (below), as `ar_hc_write` and `ar_gather_hc_write` do. At other widths
|
||||
the arch blocks issue the plain ops.
|
||||
|
||||
`ar_hc_write` is `all_reduce` of `y` followed by `hc_write` of the reduced `y`, for a block whose
|
||||
output feeds a gated residual rather than a norm; `y` is inout as `x` is above. It serves both
|
||||
@@ -2220,6 +2248,10 @@ message, with the junction as its tail -- one more block a row, which waits on a
|
||||
of the transport blocks (no cross-card handshake), acquires, and runs `rmsnorm_quant_i8`'s row at
|
||||
its own width. The bytes are the pair's; the launch the junction would take is saved.
|
||||
|
||||
`sp` is a four-rank form of the same row: libr4d serves it over P2P where the row has a residual
|
||||
and a post-norm, no `out_bf16`, and `n` of at most 8192 (the norm's register form), and runs the
|
||||
whole form elsewhere (the host mailbox included), which keeps every promise `sp` makes.
|
||||
|
||||
## Vocabulary edges
|
||||
|
||||
| op | params | operands |
|
||||
@@ -2496,6 +2528,10 @@ resolutions of one op. The one exception is `sample_chain` (below).
|
||||
| `sample_merge_topk` | `M`(range) `n_cand` | `gathered`, `params` → `cand_idx`, `cand_val` |
|
||||
| `sample_logprobs` | `M`(range) `n_vocab` `k` `vocab_off`/opt | `logits`, `params` → `stats` |
|
||||
|
||||
`sample_temp` divides a row's logits by its `temp` and leaves a row whose `temp` is 0 or less, or
|
||||
exactly 1, as it is. The sampler relies on that: a step none of whose chain rows has another
|
||||
temperature does not issue the stage.
|
||||
|
||||
`sample_mask` is where a GBNF grammar lands: the state machine stays on the host, and what crosses
|
||||
is a token bitmask per sequence (~19 KB at a 151K vocab), cheap enough to upload every step. A set
|
||||
bit means allowed.
|
||||
@@ -2521,10 +2557,18 @@ the usual rescale, pairs by value).
|
||||
| op | params | operands |
|
||||
|---|---|---|
|
||||
| `sample_dry` | `M` `n_vocab` `vocab_off`/opt | `logits`:inout, `params`, `history`, `breakers`? |
|
||||
| `sample_ngram_ban` | `M` `n_vocab` `vocab_off`/opt | `logits`:inout, `params`, `history`, `ngram`, `whitelist`? |
|
||||
| `sample_typical` | `M` `n_cand` | `cand_idx`:inout, `cand_val`:inout, `params` |
|
||||
| `sample_xtc` | `M` `n_cand` | `cand_idx`:inout, `cand_val`:inout, `params` |
|
||||
| `sample_chain` | `M` `n_vocab` `temp`:f64/opt `p`:f64/opt `min_p`:f64/opt `k`/opt | `logits`, `query`?, `u` → `draw` |
|
||||
|
||||
`sample_ngram_ban` is the windowed no-repeat-ngram ban (Unlimited-OCR's
|
||||
`SlidingWindowNoRepeatNgramProcessor`): every token that would complete an n-gram the last `window`
|
||||
tokens of the row's history already contain is set to -infinity. `ngram` is one i32
|
||||
`{n-gram length, window}` pair a row; the window bounds the n-gram's START index, so one that spans
|
||||
the window boundary is still searched. `window` <= 0 searches the whole staged history (the
|
||||
un-windowed processor) and `n` 0 turns the stage off, which is the default.
|
||||
|
||||
`sample_dry` is llama.cpp's DRY: it penalises, once, each token that would extend a repeated suffix
|
||||
of the history, by its longest such repeat. Sequence breakers are strings, so they are resolved
|
||||
against the vocabulary on the host: the row's `dry_rep_limit` carries the repeat limit the most
|
||||
|
||||
+3
-3
@@ -362,9 +362,9 @@ says so with `RAD_ARCH_SERVES_IMPORTS(0)` (`qwen35_w8a8` does), and imports keep
|
||||
`qk_norm_rope_gate`.
|
||||
- **Read §8** if the model has a linear or recurrent block.
|
||||
- **Media preprocessing is the core's** (`core/mm`): resizing, patching, placeholder-token
|
||||
expansion and positions, in four processor families (Qwen-VL, Gemma 4, LFM2-VL, GLM-5.3) chosen
|
||||
by the container's `vision_config.model_type`. A vision model with another pipeline needs a core
|
||||
change.
|
||||
expansion and positions, in five processor families (Qwen-VL, Gemma 4, LFM2-VL, Unlimited-OCR,
|
||||
GLM-5.3) chosen by the container's `vision_config.model_type` (Unlimited-OCR's by its
|
||||
`model_type`). A vision model with another pipeline needs a core change.
|
||||
Audio goes through one of two feature extractors, Gemma 4's and Qwen3-ASR's (Whisper's), chosen
|
||||
by `audio_config.model_type`.
|
||||
- **A speech model says how it hears**, through the optional
|
||||
|
||||
+2
-3
@@ -794,9 +794,8 @@ The mode changes these settings itself:
|
||||
Everything else comes from the command line: run every candidate with the same flags, and the
|
||||
reference with the exact wire and a bf16 KV cache.
|
||||
|
||||
The control vector's switch is per request, and KLD mode serves none, so a deployment that has one
|
||||
loaded is scored with it **off**. `--control-vector on` starts the deployment default on, which is how
|
||||
the projection itself is scored (the switch still decides per request, and a request's false wins).
|
||||
A loaded control vector is applied at the deployment's default: `--control-vector on` scores every
|
||||
document with the projection, `--control-vector off` without it.
|
||||
|
||||
`--kld-out FILE` writes the report as JSON, and every position's KL, both NLLs and the argmax
|
||||
agreement to `FILE.rows` (`[positions, 4]` f32, reference row order), so two candidates can be
|
||||
|
||||
Reference in new issue
Block a user