Archived
radiance 2.1.0
New models. Recursive Flint (39.8B, about 2.5B active) by everplays (#422): `arch/flint`, as an IQ8R container with rotated int8 experts or a four-bit one, with a sink-aware WMMA prefill attention and the fused attention prologue at `rotary_dim` 0. Meta Muse Glimmer 30B by launch80_assets (#423): bf16, an int4 trunk or IQ8R, its windowed vision tower, its DFlash drafter, the ATEM tool dialect and context extension. Ling-3.0-tiny by RikshaDriver (#441): served from its GGUF releases or as IQ8R on `bailing_hybrid`, with six more libr3d kernels. Block FP8, MXFP4 and NVFP4 conversions of the three are not served. IQ8R containers of all three (round to nearest, no calibration) are on Hugging Face under StillDeadcode: flint-iq8r, muse-glimmer-30b-iq8r-dflash and ling-3.0-tiny-iq8r. They were checked for sane answers on two R9700; nothing was benchmarked, and Muse Glimmer's pictures, video and tool calls were not tried. Speech. Breeze-TTS-2 clones a voice from a reference recording and its transcript, with an optional delivery direction, by farcryjohn (#436). The published Breeze container needs converting again with the updated recipe before it can. Tools. A model entry with `diagnose: DIR` runs a fixed workload on the engine instead of serving and writes a report: step times, tokens a step, draft acceptance, TTFT and prefill rates by category, concurrency and prompt length, and with `diagnose-baseline` a token-for-token comparison against an earlier report (docs/DIAGNOSE.md), by Code000 (#418). Scheduler. `mixed-step-target-ms` holds a mixed prefill and decode step to a service time, off by default, by tnhnyzc (#413). `scheduler.stuck-exit` (60s by default, 0 never) ends the process when the device has advanced nothing for that long, so a restart policy brings a hung server back (#409, #415, #428). Fixed. Draft trees with the int8 KV cache, which stopped Gemma 4 31B with DFlash2 on its first request (#454, diagnosed by aelfwyne). The expert loan held at zero by a few leftover cache blocks after long sessions (#455, diagnosed by thekk1). The mapped tier's pages kept in the page cache across a load and a restore, by C_Tamas (#421). Replayed tool calls with blank arguments, and arguments that are not JSON refused naming the call, by dschmitz (#444). The dashboard's card temperature reads the junction sensor, by dschmitz (#453). The VRAM shortfall report says what the KL mode needs, by baKon (#448). The out-of-tree plugin test builds its plugins in parallel and takes its toolchain from the tree. Plugin ABI 40: out-of-tree plugins need to be rebuilt. Thanks to @everplays, @launch80_assets, @RikshaDriver, @farcryjohn, @Code000, @tnhnyzc, @C_Tamas, @dschmitz, @baKon, @aelfwyne and @thekk1.
This commit is contained in:
1 parent
ddcb9c69bb
commit
2a2b756371
166 files changed
+20749
-327
No files matched your search
+305
-5
@@ -14,6 +14,7 @@ plugin claims.
|
||||
| `arch/hyv3_bf16` | `hyv3` | *(empty)* | Tencent Hy-Memory-30B-A3B BF16 safetensors; BF16, W4 or W8A8 weights by recipe; TP1/2, BF16 KV |
|
||||
| `arch/hyv3_fp8` | `hyv3` | `fp8` | Tencent Hy-Memory-30B-A3B-FP8's descriptor: the same graph, one dense layer then sigmoid-routed MoE; its per-tensor E4M3 linears are a form this build does not serve; TP1/2, bf16 or int8 KV |
|
||||
| `arch/hyv3_gguf` | `hyv3` | `gguf_ftype_15` | llama.cpp Hy-Memory Q4_K_M GGUF, dequantized and recipe-converted to native Radiance weights; TP1/2 |
|
||||
| `arch/flint` | `flint` | *(empty)* | Recursive Flint (39.8B-A2.5B): 2 dense layers then 47 sigmoid-routed MoE layers (256 experts top-6, ungated 1024-wide shared expert), GQA 32/4 at head_dim 128 with QK RMSNorm, a learned per-head sink on every layer, RoPE on the 35 sliding layers (window 513) and NoPE on the 14 full layers; two KV groups (full and window), TP1/2 (expert parallel); BF16 or int8 KV. Weights by recipe: an IQ8R trunk with rotated int8 experts (`data/recipes/flint-iq8r.recipe`), or u4 attention, int4 experts and plain int8 dense/shared/head (`data/recipes/flint-bf16-q4.recipe`); `docs/FLINT.md` |
|
||||
| `arch/qwen35_w8a8` | `qwen35` | `w8a8_fwht128` | `qwen35_fp8` with an int8 trunk: i8 weights with a bf16 scale per 128 of K, rotated by a 128-wide Hadamard, against int8 activations under the same rotation: IQ8R and IQR-V4 (`data/recipes/q38-27b-iq8r.recipe`, `q38-27b-iq4r-s-v4.recipe`) |
|
||||
| `arch/qwen35moe_fp8` | `qwen35moe` | `fp8_e4m3` | `qwen35_fp8` with the feed-forward routed |
|
||||
| `arch/qwen35moe_w8a8` | `qwen35moe` | `w8a8_fwht128` | `qwen35moe_fp8` with `qwen35_w8a8`'s int8 trunk and rotated int8 experts, the routed arm reading the trunk's own int8 codes (`data/recipes/q36-35b-a3b-iq8r.recipe`) |
|
||||
@@ -21,7 +22,12 @@ plugin claims.
|
||||
| `arch/clef_fp8` | `clef` | `fp8_e4m3` | the same over `qwen35_fp8`'s trunk |
|
||||
| `arch/qwen4exp_fp8` | `qwen4exp` | *(empty)* | Qwen4-Exp (Qwen3.8-Flash-Next), a bf16 checkpoint quantised at convert (`data/recipes/qwen4exp-w4nl64-i8-hc8m.recipe`) or an AutoRound int4 release (`qwen4exp-autoround-i8-hc8m.recipe`) |
|
||||
| `arch/glm5next` | `glm5next` | *(empty)* | GLM-5.3-Flash: four mHC residual streams over 34 KDA and 11 sparse latent-attention (MLA) layers with a DSA indexer, 288 experts at top-8 under sigmoid routing, attention and dense layers as the container stores them; its MTP layer is a serial drafter. Pictures through its vision tower (`arch/common/rad_block_glm_vision.h`); bf16 KV |
|
||||
| `arch/bailing_hybrid` | `bailinghybrid` | *(empty)* | Ling-3.0-flash and its fine-tunes (Ling-3.0-flash-Sante) from the bf16 checkpoint: 35 KDA and 7 dense latent-attention (MLA) layers with a rotary part and a head-wise gate, 512 experts at top-8 under group-limited sigmoid routing with an ungated shared expert, the routed experts as the recipe stores them (`data/recipes/ling3-w4a8-rtn.recipe`); its MTP layer is a serial drafter; bf16 KV |
|
||||
| `arch/bailing_hybrid` | `bailinghybrid` | *(empty)* | Ling-3.0-flash and its fine-tunes (Ling-3.0-flash-Sante) from the bf16 checkpoint: 35 KDA and 7 dense latent-attention (MLA) layers with a rotary part and a head-wise gate, 512 experts at top-8 under group-limited sigmoid routing with an ungated shared expert, the routed experts as the recipe stores them (`data/recipes/ling3-w4a8-rtn.recipe`); its MTP layer is a serial drafter; Ling-3.0-tiny from its bf16 checkpoint with an IQ8R trunk and rotated int8 experts (`data/recipes/ling-3.0-tiny-iq8r.recipe`, TP1/2; flash's clamped SwiGLU layers have no int8 form); bf16 KV |
|
||||
| `arch/bailing_hybrid_gguf` | `bailinghybrid` | `gguf_ftype_25` | Ling-3.0-tiny (24 layers, MLA every fourth with a 256-wide query LoRA, 128 experts of 512 at top-8) as the IQ4_NL GGUF release, its experts re-quantised by `data/recipes/ling-3.0-tiny-iq4.recipe`; no MTP; bf16 KV |
|
||||
| `arch/bailing_hybrid_gguf_q80` | `bailinghybrid` | `gguf_ftype_7` | the same tiny family, Q8_0 GGUF release, served whole |
|
||||
| `arch/bailing_hybrid_gguf_q4km` | `bailinghybrid` | `gguf_ftype_15` | the same tiny family, Q4_K_M GGUF release, served whole |
|
||||
| `arch/bailing_hybrid_gguf_q5km` | `bailinghybrid` | `gguf_ftype_17` | the same tiny family, Q5_K_M GGUF release, served whole |
|
||||
| `arch/bailing_hybrid_gguf_q6k` | `bailinghybrid` | `gguf_ftype_18` | the same tiny family, Q6_K GGUF release, served whole |
|
||||
| `arch/nemotronh` | `nemotronh` | *(empty)* | Nemotron-3.5-Bolt-74B-A9B (`nemotron_h_omni` around `nemotron_h_puzzle`), its language model from the bf16 checkpoint: 40 Mamba-2, 40 latent-MoE and 8 NoPE attention blocks in the order `layers_block_type` gives, 240 to 496 ungated relu^2 experts a layer in a 1024-wide latent with a relu^2 shared expert; linears and experts as the recipe stores them; pictures and video through its C-RADIO tower (`arch/nemotronh/radio.h`); bf16 KV |
|
||||
| `arch/lfm2_bf16` | `lfm2` | *(empty)* | LiquidAI's LFM2 and LFM2-VL, bf16 or IQ8R, one rank |
|
||||
| `arch/spark25_bf16` | `spark25` | *(empty)* | Spark X2.6, bf16 checkpoint, mixed sliding/full attention, TP1 or TP with exact collectives ([geometry](#spark25-spark-x26)). Optional DSpark drafter when the container already holds `draft.*` tensors, TP1 only. |
|
||||
@@ -1031,10 +1037,12 @@ the four depths above.
|
||||
|
||||
---
|
||||
|
||||
# `bailing_hybrid`: Ling-3.0-flash
|
||||
# `bailing_hybrid`: Ling-3.0-flash and Ling-3.0-tiny
|
||||
|
||||
`arch/bailing_hybrid` serves Ling-3.0-flash (`model_type: bailing_hybrid`, BailingMoeV3ForCausalLM)
|
||||
and its fine-tunes from the bf16 checkpoint. The reference is vLLM's `bailing_moe_v3.py` and
|
||||
`arch/bailing_hybrid` serves Ling-3.0-flash and Ling-3.0-tiny (`model_type: bailing_hybrid`,
|
||||
BailingMoeV3ForCausalLM) and their fine-tunes from the bf16 checkpoint, tiny additionally as its
|
||||
GGUF releases through thin-include wrappers (`arch/bailing_hybrid_gguf` and kin). The reference is
|
||||
vLLM's `bailing_moe_v3.py` and
|
||||
SGLang's; the HF `modeling_bailing_moe_v3.py` agrees except for the SwiGLU clamp (below). The plugin
|
||||
reuses GLM-5.3's KDA core (`KdaState`), sigmoid router (`GlmRouter`, with groups) and draft head
|
||||
(`GlmMtp`), and `MoeFP8`; its KDA and MLA blocks are in the plugin file.
|
||||
@@ -1059,6 +1067,34 @@ feed-forward: layers 0-1 dense SwiGLU 2 x 6144; layers 2-41 MoE
|
||||
routed experts at 4 in layers 35-41, the shared one at 5 (34-39) and 7 (40-41)
|
||||
MTP: checkpoint layer 42 -- enorm, hnorm, eh_proj 5120 -> 2560, one MLA layer with the full MoE,
|
||||
final_layernorm; the trunk's embedding and lm_head
|
||||
|
||||
tiny: 24 layers, hidden 1536, rope_theta 6e6, groups of four -- MLA at 3, 7, ..., 23; 16 heads
|
||||
of 128 through the whole model
|
||||
the MLA takes its query through a LoRA: q_a 1536 -> 256, RMS-normed, then q_b 256 ->
|
||||
16 x (128 + 64), whose rows serve the two parts; kv_a 1536 -> 512 + 64, kv_b 512 ->
|
||||
16 x (128 + 128); the gate 1536 -> 16; o 2048 -> 1536 (`dense`)
|
||||
KDA, 16 heads of 128: q, k, v 1536 -> 3 x 2048, convs, forget and output gates as flash
|
||||
feed-forward: layer 0 dense SwiGLU 2 x 4608; layers 1-23 MoE, 128 routed experts of 512 at
|
||||
top-8, 8 groups of 16 ranked the same way, 4 kept; one shared expert of 512; no clamp lists
|
||||
no MTP layer (`num_nextn_predict_layers: 0`)
|
||||
|
||||
IQ8R (tiny, `data/recipes/ling-3.0-tiny-iq8r.recipe`): the KDA q|k|v, forget, gate and out, the
|
||||
MLA out, the dense pair and the shared gate/up as IQ8R (`gemm_nt_q` at `i8a8h`, group 256); the
|
||||
routed experts and the shared down rotated int8 at a bf16 scale a (row, 128) (`moe_gemm_q` and
|
||||
`gemm_nt_q` at `i8a8h`, group 128). The block norms write `rmsnorm_had_quant_i8g`'s codes (256),
|
||||
read by every KDA projection, the shared gate/up and the routed gate/up; `had_quant_act_i8g`
|
||||
(256) quantises the KDA core's gated norm and the MLA's values for their out projections;
|
||||
`gated_had_quant_i8g` writes the dense product's codes at 256, the shared and routed products'
|
||||
at 128. The KDA beta, the MLA's q_a, q_b parts, kv_a, kv_b and head gate, the taps, the router,
|
||||
the embedding and the head stay bf16. TP1 and TP2 (at TP4 the dense 1152-column slice cuts a
|
||||
256-column group and is refused).
|
||||
|
||||
GGUF releases (tiny): IQ4_NL, Q8_0, Q4_K_M, Q5_K_M, Q6_K -- the file's `general.file_type` is
|
||||
the claim (`gguf_ftype_25`, `_7`, `_15`, `_17`, `_18`); the release files carry their
|
||||
producer's renumbered ftable (IQ4_NL 25, Q4_K_M 15, Q5_K_M 17, Q6_K 18, Q8_0 7), not the
|
||||
pinned ggml enum. Q8_0, Q4_K and Q6_K import as planes and are served whole; Q5_K and
|
||||
IQ4_NL decode in checkpoint.cpp, the IQ4_NL experts re-quantise to the engine's i4 planes
|
||||
through `data/recipes/ling-3.0-tiny-iq4.recipe`.
|
||||
```
|
||||
|
||||
Traps:
|
||||
@@ -1077,6 +1113,10 @@ Traps:
|
||||
for `rope` and `[T, 32 * 128]` for the absorption. A single `[T, 32, 192]` plane with column
|
||||
views turns the wrong rows on libavx, whose `rope` reads a rank-3 operand's head stride as its
|
||||
row stride.
|
||||
- **tiny's query runs a LoRA first.** q_a 1536 -> 256 and its norm precede q_b; the same two-plane
|
||||
row maps run over `q_b_proj` against the normed latent, so the parts' GEMMs take K = 256 and read
|
||||
the LoRA's ActFP8 wire (the producer quantises it when the container stores fp8). The `need[]`
|
||||
gate admits `q_lora_rank` 256 and nothing else.
|
||||
- **The cache row is [latent | rotary key].** One KV head of 288, the row's first half in the K
|
||||
slot and the second in the V slot, so `kv_store` writes the 576-wide row contiguously and
|
||||
`mla_attn_paged` reads it as `[pages, 1, block, 576]`. Scores are taken in the latent; the head
|
||||
@@ -1103,7 +1143,16 @@ and the latent are replicated. The dense feed-forward splits its 6144 columns. A
|
||||
768 columns are six 128-column blocks: halves at two ranks, and at four 2, 2, 1, 1 blocks rotated
|
||||
by the expert's number mod 4 (`moe_gemm_q_mod4`), so every rank carries six blocks per four
|
||||
experts. The shared expert splits the same way, unrotated. A calibration run
|
||||
(`RADIANCE_CALIB_DIR`) and bf16 experts give every rank whole experts instead.
|
||||
(`RADIANCE_CALIB_DIR`) and bf16 experts give every rank whole experts instead. The IQ8R trunk
|
||||
shards the same way; its norms take no collective (each block's all-reduce stays a standalone
|
||||
`all_reduce` before the residual add), so no `ar_` norm is declared at two ranks.
|
||||
|
||||
**The trunk's form** is read from layer 0's fused q|k|v. A rotated int8 trunk needs rotated
|
||||
experts (int8 or a rotated four-bit form) and no SwiGLU clamp: the int8 gated products have no
|
||||
clamped form, so flash's clamped layers (routed 35-41, shared 34-41) are refused on it by name.
|
||||
Rotated int8 experts under an unrotated trunk are refused too. Where no loaded library serves
|
||||
`rmsnorm_had_quant_i8g` (a CPU-only engine), each int8 linear quantises the norm's bf16 output
|
||||
itself and the routed experts read a rotated int8 copy written once a layer.
|
||||
|
||||
---
|
||||
|
||||
@@ -1812,6 +1861,198 @@ is one 800-token translation run four times).
|
||||
|
||||
---
|
||||
|
||||
# `museglimmer`: Meta Muse Glimmer 30B
|
||||
|
||||
`arch/museglimmer` serves the text trunk and the vision tower of a
|
||||
`MuseGlimmerForConditionalGeneration` checkpoint (`model_type: muse_glimmer`, HF
|
||||
`meta-models/Muse-Glimmer-30B`), `arch/museglimmer_ct` the same container converted to an int4
|
||||
or IQ8R trunk (`--set quantization_config.quant_method=compressed-tensors`). The trunk block lives
|
||||
in the plugin, the tower in `arch/common/rad_block_museglimmer_vision.h`; the reference is
|
||||
transformers' `modeling_muse_glimmer`.
|
||||
|
||||
```
|
||||
Muse Glimmer 30B
|
||||
52 layers, hidden 6656, ff 19968, vocab 202048 (head not tied), rms_norm_eps 1e-5
|
||||
layer_types: sliding_attention except every 4th layer full (3, 7, ..., 51)
|
||||
sliding 32 heads / 2 kv x 128, rope theta 500000 over all 128 dims, window 2048
|
||||
full NoPE: no rotary at all (the config's layer_rope_theta is 0 there)
|
||||
q_proj and gate_proj are separate tensors, each [4096, 6656]: two GEMMs, not a fused q|gate
|
||||
q and k are RMS-normed per head with NO gain (MuseGlimmerRMSNorm with_scale=False); the query
|
||||
is then multiplied by qk_scale_factor 3.87, the key is not; scores scaled 1/sqrt(128)
|
||||
every layer norm is centered, x_hat * (1 + w): the attention's and feed-forward's inputs at
|
||||
rms_norm_eps 1e-5, their OUTPUTS at post_norm_eps 1e-8, and the residual adds the normed
|
||||
branch (Gemma-2 sandwich); the final norm is a plain gain, wadd 0
|
||||
the embedding is RMS-normed after the lookup (weightless, 1e-5); not folded into the table,
|
||||
because a drafter embeds without it
|
||||
logits are pre-scaled by output_multiplier 1/sqrt(26) (carried on the final norm's mult) and
|
||||
soft-capped: 20 * tanh(logits * mult / 20)
|
||||
```
|
||||
|
||||
Traps:
|
||||
|
||||
- **The q/k norm is weightless and the query alone carries qk_scale_factor.** Serving it as a
|
||||
plain 1/sqrt(head_dim) with no norm, or scaling both q and k, is a different model.
|
||||
- **The full-attention layers have no rotary.** A theta of 500000 there (the family default
|
||||
rope_parameters value) is wrong; the per-layer `layer_rope_theta` array is the authority, and
|
||||
where a container omits it the plugin derives it: theta on the sliding layers, 0 on the full
|
||||
ones.
|
||||
- **The output branch is normed, not the raw projection**: `x += post_norm(y)` at both junctions,
|
||||
the post norm at 1e-8.
|
||||
- **The head sees scaled inputs.** The final norm's `mult` carries output_multiplier, so logits
|
||||
are already pre-scaled when `logit_softcap` applies cap * tanh(x / cap). Scaling the head's
|
||||
weights instead would break a bf16 head against a quantised one under the same container.
|
||||
|
||||
**KV groups.** `kv_sliding` (`RAD_KV_WINDOW`, 2048) bound to the sliding layers, `kv_full`
|
||||
(`RAD_KV_FULL`) to the full ones, 2 heads of 128. The window group holds 2048 tokens a sequence
|
||||
per sliding layer, so long contexts cost a fraction of what a full pool would.
|
||||
|
||||
**Vision.** A 50-block windowed ViT (hidden 1536, 16 heads x 96, ff 8960, patch 14, temporal 2,
|
||||
merge 2) declared only when the deployment asked for media (`--mm-max-patches`). The preprocessor
|
||||
resizes to a multiple of 28 px under a 4096-token budget (closest aspect, no minimum size), emits
|
||||
patch rows as (temporal, channel, y, x) in the reference's raster order, and expands
|
||||
`<|image_start|> 200080`, `(grid/4) x <|patch|> 200092`, `<|image_end|> 200081`; video is
|
||||
`<|vid_start|>`, then per frame group `Time: {t:.1f}s` (tokenised text), the group's `<|video|>
|
||||
200091` tokens and a `<|vid_frame_separator|> 200087`, and `<|vid_end|> 200083` last, fps 2.0 at
|
||||
96 frames with a 144-token per-group budget.
|
||||
|
||||
The tower differs from Qwen-VL's (`rad_block_vit.h`) in five ways, each visible in
|
||||
`rad_block_museglimmer_vision.h`:
|
||||
|
||||
- **Window attention is a permutation, not a banded mask.** `window_order` computes the
|
||||
InternVL-style reorder (windows of `pos_emb_height` = 32 patches a side, partitioned per frame,
|
||||
ragged edges kept as smaller windows) from the coordinate planes, plus its inverse, the rope
|
||||
positions and the per-window cu. Full-attention layers pass the frame `cu` unchanged: the
|
||||
permutation moves rows within a frame, so frame boundaries survive it. Blocks run in window
|
||||
order; the inverse gather restores it before `ln_post`.
|
||||
- **The rope positions are (col + 1, row + 1)**, not (row, col): the reference flips the two
|
||||
components and offsets by one (`position_ids.flip(-1) + 1`). `window_order` emits them ready.
|
||||
- **The position table is resampled with zero-padding bilinear** (`grid_embed_pad`): at
|
||||
half-pixel centres, align_corners=False, taps beyond the 32x32 table weighted zero. `grid_embed`
|
||||
(Qwen-VL's) clamps to the border instead; they agree only at grids at or below the table.
|
||||
- **The merge is the reference's `pixel_shuffle`.** `pixtral_merge` folds each 2x2 block's four
|
||||
patch rows into one row of 4 x width with the channels interleaved
|
||||
(`[block, 4, width].permute(0, 2, 1)`); four consecutive rows concatenated instead would be a
|
||||
different tensor, and the adapter's first linear (whose weights are trained on the interleaved
|
||||
form) would read a permuted image.
|
||||
- **The DFlash drafter is declared from the same container** (`rad_block_muse_dflash.h`), when the
|
||||
conversion merged `meta-models/Muse-Glimmer-30B-assistant` under `draft.` (`rad-convert
|
||||
--draft-model`). Five plain layers over the residuals of trunk layers 1/13/25/37/49, SwiGLU,
|
||||
per-head q/k gains, no attention gate, no Markov head and no candidate selector: the head is the
|
||||
trunk's own `output.weight` and the proposal is its plain argmax over the last `block_size - 1`
|
||||
rows (the anchor row predicts nothing, so `steps()` is 15 of a 16-row block). It shards with the
|
||||
trunk at tp (q/k/v/gate_up by rows, o/down by columns, an all_reduce after each; the block's rows
|
||||
embed from the trunk's vocab-sharded table, so the partial lookup gets an exact all_reduce of its
|
||||
own, like the trunk's embedding) and its argmax
|
||||
is distributed over the vocab-sharded head (`row_topk` with `vocab_off` → `all_gather` →
|
||||
`pair_argmax`); buffers are sized by `max_seqs * steps` and the head reads the predicting rows
|
||||
through `out_ids`, so batches draft side by side.
|
||||
Its seven matrices are block fp8 / MXFP4 like the trunk's (the recipe's `dspark.*` rules;
|
||||
`DenseFP8`, an E4M3 activation per row and 128 of K), which is what the 53-tensor assistant
|
||||
release is not: converted without them it stayed bf16 and 4.76 GiB of the 26.5 GiB container,
|
||||
read in full every draft step. It also declares a **short block** of 4 rows / 3 drafts
|
||||
(`rad_drafter_short_block`; `--draft-short-from 2`), since the same graph is ranged by rows.
|
||||
Measured on one 30B trunk card (`museglimmer-30b-nvfp4.rad` and the drafter container, 300-token
|
||||
prompts, spec against the trunk's own no-speculation numbers):
|
||||
|
||||
| | tp 1 b1 | tp 1 b4 (aggregate) | tp 2 b1 | tp 2 b2 | tp 2 b4 |
|
||||
|---|---|---|---|---|---|
|
||||
| no drafter | 51.7 | 51.5 (206) | 52.1 | 51.4 (103) | 51.4 (206) |
|
||||
| bf16 drafter | 57.2 | 51.5 (202) | 57.2 | 32.7 (130) | 32.7 (130) |
|
||||
| block fp8 / MXFP4 drafter | **89.9** | **57.0 (228)** | **65.5** | **55.0 (110)** | 41.7 (167) |
|
||||
|
||||
The tp 2 b2/b4 rows of the quantised drafter measured the batched drafts while they were broken
|
||||
(the shifted read below scored each sequence's neighbour's anchor as its first draft, so batched
|
||||
acceptance sat near single digits and the drafter paid pure overhead). With the head reading
|
||||
`out_ids`, batched acceptance returns to single-stream levels: measured on the NVFP4 +
|
||||
quantised-drafter container at tp 2, 500-token answers, four streams, **18.0-19.9%** acceptance
|
||||
and **196-208 tok/s wall** against **52.3 tok/s a stream** on the drafter-less container; single
|
||||
stream runs **121-205 tok/s, 2.3-3.9x** the drafter-less container's 52.3.
|
||||
|
||||
The bf16 drafter paid 4.76 GiB of read a draft step, which dominated the step and is why tp 2's
|
||||
batches lost; quantising it takes that to 1.42 GiB and the container from 26.51 to 23.17 GiB.
|
||||
The two remaining losses at tp 2/b4 (~38 ms a speculative step against 19.8 ms plain, with the
|
||||
short block at either 4 or 2 rows) are the drafter's per-step work, not its read.
|
||||
**The workload sets the win.** Fresh prose is the drafter's floor and a rewrite/transcription task
|
||||
its ceiling: tp 2, one stream, per stream 52.1 -> 60.7 tok/s on prose, 52.1 -> 76.3 on a Python
|
||||
script written from scratch, 51.9 -> 86.4 on a script reproduced and re-documented, with the
|
||||
draft-acceptance metric reading 3.7% / ~6% / 8.5% on those three. At two sequences the same
|
||||
order holds (+8% / +1% / +36%), and at four the drafter loses in all three (~40-42 against
|
||||
~49-50), which is the step's fixed cost, not the text.
|
||||
**The head reads the scheduler's `out_ids`**, gathered out of the staged block (`w.hg`): one
|
||||
query-pass entry per drafting sequence, `block` rows, and `out_ids` its last `depth` rows (the
|
||||
scheduler's block_query fills them from each entry's own `hidden_row`). "The last `depth` rows
|
||||
of the staged block" -- an earlier read, kept when a chunked prefill handed `out_ids` that were
|
||||
not block-local -- coincides with `out_ids` only while every staged sequence drafts; at two or
|
||||
more it drops each sequence's first mask row and scores its neighbour's anchor row, whose
|
||||
logits pose as that sequence's first draft. Measured, one card on the rewrite task single
|
||||
stream: **108.5 tok/s** (2.09x the 51.9 the same prompt gets with no drafter), position-0
|
||||
acceptance 79.8%; at four streams the shifted read's acceptance collapses to a few percent
|
||||
while the text stays clean, because every rejected draft changes no token.
|
||||
**Fusions.** `gate_up|silu|quantise` is one launch (`gemm_nt_q_gated_mx` over the MXFP4 weight,
|
||||
`gemm_nt_q_gated` over block fp8), verified and measured: tp 2 b1/b2/b4 64.9/55.6/42.5 tok/s
|
||||
against 65.5/55.0/41.7 unfused -- equal within noise, so ten fewer launches a step is not what
|
||||
the speculative step spends its ~38 ms on. `rmsnorm_quant_fp8` (norm + quantise in one launch)
|
||||
is *not* usable here: declaring it makes the engine lay the drafter's fp8 attention weights out
|
||||
in `r4d.fp8.w.frag64`, and a weight in that form cannot be read where it lies, so a weight the
|
||||
planner puts on the mapped tier refuses to start ('...was placed on the mapped tier ... its
|
||||
stored form is not the container's'). Reproduced with and without the `rad_op_declared` probe,
|
||||
with the gated fold on and off; not with it undeclared.
|
||||
- **The adapter activates twice**: `gelu(fc2(gelu(fc1(x))))`, then a bias-less projection to the
|
||||
text width, then a weightless RMS norm (`perception_emb_norm`, the text model's eps) before the
|
||||
rows scatter into the embedding.
|
||||
- **The vision layer rule counts from the first block and always makes the last full** (the
|
||||
reference config's derivation); the shipped array is checked against that rule and a
|
||||
disagreement is refused.
|
||||
|
||||
**Linears.** Each trunk weight is served as its encoding stores it:
|
||||
|
||||
| recipe rule | served | activation |
|
||||
|---|---|---|
|
||||
| none (bf16) | `gemm_nt` | bf16 |
|
||||
| `codes=u4\\|u5 zero=u8 group=128 scale=f16` (CT-INT4) | `gemm_nt_q` w4a8i8_asym, decode band at w4a16_asym | int8, a scale per (row, 128) (`quant_act_i8g`) |
|
||||
| `codes=i8 group=128 scale=bf16` | `gemm_nt_q` i8a8 | int8, an f32 scale per (row, 128) (`quant_act_i8g`) |
|
||||
| `codes=i4\\|i8 group=128 scale=f16` (`museglimmer-30b-w4a8.recipe`) | `gemm_nt_q` w4a8 / w8a8 | int8, one scale a row (`quant_act_i8`; the grouped producer paired with these GEMMs makes NaN logits, as in gemma4_bf16) |
|
||||
| `codes=i8 group=256 scale=u8 scale2=bf16 block2=1x* transform=fwht128` (IQ8R, `museglimmer-30b-iq8r.recipe`) | `gemm_nt_q` i8a8h, group 256 | int8 rotated 128 wide, an f32 scale per (row, 256): written by the pre-norms (`rmsnorm_had_quant_i8g`) for q, gate, k, v and gate/up, by the gated product (`gated_had_quant_i8g`) for down, by o_proj's own `had_quant_act_i8g` for o |
|
||||
|
||||
IQ8R is a whole-trunk form: layer 0's q projection decides it before any activation is declared,
|
||||
and every trunk linear of such a container must be IQ8R (one that is not, or an IQ8R linear in a
|
||||
trunk whose layer 0 q is not, is refused by name). A layer quantises four times, once per
|
||||
distinct linear input: the centered pre-norms write the pair q, gate, k and v share and the one
|
||||
gate/up reads; the gated product writes down's and not its bf16 plane (written only when
|
||||
`--calib-dir` records the layer). The gated attention output keeps `sigmoid` + `mul` and o_proj
|
||||
quantises the product itself, since the fused gate quantiser runs per head and a head (128) is
|
||||
narrower than the 256-column scale group. No norm absorbs a collective at tp 2 (the all-reduce
|
||||
sits before the post norm), so the all-reduce form of the rotating norm is not declared; the
|
||||
linears shard as the other forms do (q, gate, k, v, gate/up by rows, o and down by columns, whole
|
||||
256-column groups a rank). Where no loaded library declares a rotating producer (the CPU
|
||||
kernels), its plain op runs instead (`rmsnorm`, `silu_mul`) and the first linear reading that input
|
||||
quantises it with `had_quant_act_i8g`: q for the four, gate/up, down. The head is plain int8
|
||||
(`codes=i8 group=128 scale=bf16`, `logits_gemm_i8`), which the drafter reads as its own head.
|
||||
|
||||
The tower's weights are never quantised: a container that quantises them is refused by name.
|
||||
|
||||
**Context extension.** The architecture takes it by mechanical means, and takes it well: 13 of
|
||||
the 52 layers are full-attention **NoPE** (`layer_rope_theta` 0 -- no positions at all) and the 39
|
||||
sliding layers carry rotary over a 2048-wide window, so the rotary is only ever read as in-window
|
||||
relative offsets. Serving past the trained 131072 positions is `--max-model-len` alone; the
|
||||
engine's warning that nothing scales the rotary is expected and harmless here. Measured at tp 2
|
||||
(NVFP4 trunk, quantised drafter, fp8 KV): a **495,145-token** prompt -- three administration
|
||||
needles at 20/50/80% of a repetitive hay -- prefills in 272 s (1822 tok/s; the tail chunks slow
|
||||
quadratically) and retrieves **all three codes in order**; decode at that depth runs 16 tok/s
|
||||
(62 ms/token: attention over 495K keys, the drafter, prompt lookup), and draft acceptance is
|
||||
*higher* than at short context (31.8-37.8% -- the repetitive hay suits the drafter and prompt
|
||||
lookup alike). For a stronger stretch, `--rope-scaling yarn:FACTOR[:ORIG]` writes YaRN into the
|
||||
container's rotary keys at load (llama.cpp's 1M recipe is factor 8 over 131072); the blend lands
|
||||
on the sliding layers' rope ops only (`yarn_from` reads the keys into the rope Geom -- the NoPE
|
||||
layers have nothing to scale) and the drafter reads its own `draft.rope_parameters`
|
||||
(`drafter_geom` already calls `yarn_from` for it). Measured under `yarn:8` at tp 2: a
|
||||
**913,130-token** prompt -- the same three needles at 20/50/80% -- prefills in 717 s (1273 tok/s)
|
||||
and retrieves **all three codes in order**; decode runs 6.6 tok/s (151 ms/token) with 21.6%
|
||||
acceptance. The windows fit the two 32 GB cards beside the weights with fp8 KV: the full pool is
|
||||
~1.6 GiB a rank at 495K and ~3.3 at 1M.
|
||||
|
||||
---
|
||||
|
||||
# `qwenimage21`: Qwen-Image 2.1 and 2.1-Turbo, an image generator
|
||||
|
||||
`arch/qwenimage21` declares a generator (`rad_declare_generator`), which makes the program a
|
||||
@@ -2316,6 +2557,65 @@ plays a lane's newest frames, four at most, as soon as they are made. It is serv
|
||||
`/v1/audio/speech` and `/v1/audio/speech/stream` ([GUIDE §5.15](GUIDE.md)), bf16 on one card. The
|
||||
checkpoint is the release directory; its codec, in `audio_tokenizer/`, is read with it.
|
||||
|
||||
Voice cloning uses the same `/v1/audio/speech` `references` array as drama-3, limited to one
|
||||
recording of at most ten seconds, with its exact transcript. Plain cloning uses guidance 1;
|
||||
reference-plus-direction also supplies `instructions` (start with guidance 4).
|
||||
`arch/breeze/reference.h` declares the tokenizer's encoder in f32: SEANet's causal convolutions
|
||||
(ELU, residual bottlenecks, strides 4/5/6/8), eight Mimi transformer layers at 25 Hz (LayerNorm,
|
||||
8 heads of 64, causal window 250, GELU feed-forward, learned residual scales), a replicate-padded
|
||||
stride-2 convolution, then independent semantic/acoustic input projections and 1+15 Euclidean
|
||||
residual quantisation steps. Centroids are EMA sums divided by usage; ties choose the lower code.
|
||||
These are the encoder's codebooks, not the decoder's dequantisation tables, and not drama-3's
|
||||
cosine quantiser. The encoder weights are included by the updated conversion recipe.
|
||||
Its f32 GEMM, LayerNorm, GELU, causal attention and full-head 64-dimensional NeoX rotary have
|
||||
device paths too; reference encoding does not depend on host-reference fallbacks. The f32 causal
|
||||
strided convolution uses the same FMA tile as the vocoder's f32 convolution.
|
||||
|
||||
The clone prompt is `<bos>[S0]transcript`, the reference frames, an audio EOS frame (sixteen
|
||||
codebook EOS indices, all zero), then `<bos>[S0]input`. Each text segment is independently encoded
|
||||
bidirectionally at position zero. Audio rows are the f32 sum of sixteen backbone codebook
|
||||
embeddings rounded once to bf16; they never pass through the text encoder. The backbone attends
|
||||
causally over the assembled prompt. At guidance 1 both branches repeat the conditional prompt,
|
||||
including its reference-frame map; no reference context is carried into another request.
|
||||
Reference direction uses `ref_edit_tata`: the final text segment is
|
||||
`<bos>[S0]<ins_bos>instructions<ins_eos>input`; its negative branch is the plain clone prompt
|
||||
with the same reference. ABI 38 appends opt-in conditional/negative direction templates to
|
||||
`RadAudioGenDecl` and host prompt boundaries to `RadAudioGenBatch`. The driver stages each
|
||||
branch's own frame map and the architecture splits text segments at the actual branch boundary,
|
||||
not half the pass length. The reference encoder still runs once. This is two-branch CFG, not
|
||||
the upstream three-branch dual-guidance scheme. Engine and plugins must be rebuilt together;
|
||||
the already-updated cloning weights do not need another conversion for direction.
|
||||
`rvq_embed` reads codebook zero from its first table and codebooks 1..15 from its second:
|
||||
the latter is a view starting at row 2051 of the shared table, just as for generated-frame
|
||||
feedback. This applies to both reference frames and their audio EOS; passing the full table
|
||||
twice shifts fifteen codebooks and corrupts the conditioning even when encoder codes are right.
|
||||
|
||||
Native cloning verification (2026-11-10, one R9700): all 688 codec indices of a synthetic
|
||||
3.44-second reference agreed with the upstream Mimi encoder. With an eight-second recording,
|
||||
the assembled reference-audio and EOS embeddings matched an independent PyTorch calculation
|
||||
exactly after correcting the residual-table view. Independently encoded text segments differed
|
||||
by about 1.1% relative L2 (cosine >0.9999); both prompt branches were byte-identical. The
|
||||
architecture recording test checks the table view for both reference frames and EOS.
|
||||
Fourteen device checks cover the encoder primitives, including Euclidean/tie behaviour,
|
||||
pitched guards, f32 causal strided convolutions and attention against a double softmax oracle.
|
||||
These checks do not constitute a speaker-similarity benchmark; listening evaluation is separate.
|
||||
The corrected eight-second-reference clone was subsequently approved by the local listener as
|
||||
matching the supplied voice. This is one subjective evaluation, not broad speaker/language
|
||||
coverage. Through the local manager on a warm R9700, 2.80 seconds of cloned speech completed in
|
||||
1.85 seconds (1.80 seconds on repeat), about 1.5 times real-time playback speed. Live PCM and
|
||||
SSE completed in 1.80 seconds each. These are whole-response times, including reference encoding
|
||||
and transfer, not measurements of time to first audio. The same seed reproduced the WAV bytes.
|
||||
Reference direction was also verified locally with the same eight-second reference and text:
|
||||
plain cloning made 9.92 seconds of speech in 6.15 seconds (RTF 0.620); soft/slow direction made
|
||||
11.44 seconds in 7.01 seconds (0.612); bright/energetic made 8.40 seconds in 5.19 seconds (0.618).
|
||||
First PCM/SSE audio arrived in about 0.27 seconds through the manager. A subsequent angry
|
||||
direction made 9.76 seconds in 6.03 seconds (0.618). The local listener approved soft, bright
|
||||
and angry delivery with the cloned voice. These are single-reference subjective checks, not
|
||||
general speaker/language validation. Plain cloning remained byte-identical to its previously
|
||||
approved native sample, and fixed-seed directed WAVs reproduced byte for byte. Host ABI,
|
||||
builder, speech, driver and architecture suites, fourteen reference GPU checks, live PCM/SSE,
|
||||
and real browser direction/reset-to-plain-clone tests passed. Lower RTF is faster.
|
||||
|
||||
```
|
||||
text T5Gemma 2's text encoder in Gemma 3 1B's shape: 26 layers of 1152, 4 query heads over one
|
||||
KV head of 256 (q/k RMS-normed, scale 1/16), sandwich RMS norms with a (1 + w) gain,
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
# the diagnose mode: the engine measures itself
|
||||
|
||||
A model entry with `diagnose: DIR` in the YAML file (`radiance --config FILE`) starts as a serve
|
||||
would — same placement, same kernels, same prefix cache — runs a fixed workload on itself instead
|
||||
of listening, and writes `DIR/diagnose.json` and `DIR/diagnose.md`. The keys are in
|
||||
[TOOLS.md](TOOLS.md#the-diagnose-mode); this file is what the numbers mean, what makes a run a
|
||||
measurement, and what is not measured yet.
|
||||
|
||||
## What the run does
|
||||
|
||||
`core/engine_diagnose.cpp` is the driver; the arithmetic and the report format are
|
||||
`core/diag/diagnose.{h,cpp}`, which know nothing about the engine and are tested on the host
|
||||
(`tests/diagnose_test.cpp`). The driver builds requests with no client, hands them to
|
||||
`Scheduler::add_all` and reads their tokens back from `server::Sink` — the same path the KL mode
|
||||
takes. The four points, each run once unmeasured and then `diagnose-runs` times:
|
||||
|
||||
| point | what it answers |
|
||||
|---|---|
|
||||
| decode by category | code, reasoning, prose, json, file_edit and summarization prompts to EOS: time per token by prompt shape, draft acceptance, tokens a step |
|
||||
| concurrency sweep | 1, 2, 4, 8 streams at once (`diagnose-concurrency`): how TTFT and per-token time give way as the batch fills |
|
||||
| prefill sweep | a prompt of 1k, 4k, 16k, 64k tokens (`diagnose-prefill`) then decode at that depth: prefill time, prefill tokens/s, and how deep context changes decode |
|
||||
| interference | a prompt that arrives while streams are running: its TTFT, and the stall of the streams it joined |
|
||||
|
||||
A point the engine cannot run — a concurrency above `max-num-seqs`, a prompt the context cannot
|
||||
hold with its decode — is skipped and said so in the report. It is never reported as a zero.
|
||||
|
||||
Per phase the report carries, from the scheduler's step ring and its counters: steps, step time
|
||||
(median, p95, worst), prefill/decode tokens a step, decode tokens/s, draft positions drafted and
|
||||
accepted, TTFT, per-token emission interval and its jitter, and each request's own tokens. Every
|
||||
statistic over an empty set is `null` in the JSON and `–` in the Markdown, with the count beside it.
|
||||
|
||||
## What makes a run a measurement
|
||||
|
||||
| what would spoil it | what the run does |
|
||||
|---|---|
|
||||
| a prefix-cache hit — the second run of a point would measure lookups, not work | every prompt carries a tag unique to its run and stream, the cache is emptied before every run, and each request's `n_cached` is checked afterwards. A hit, or step records the ring overwrote before they were read, makes the verdict `NOT A MEASUREMENT`, lists the reason, and exits non-zero |
|
||||
| the first time a shape runs (tape recording, code objects, pool growth) | each point runs once unmeasured first, in the same shape |
|
||||
| `ignore_eos` generating past EOS, where a drafter hits differently | categories stop at the model's EOS; only the concurrency and prefill sweeps use `ignore_eos`, so every stream decodes for the whole run |
|
||||
| a client-side temperature that a deployment never serves | decode runs at temperature 1 — draft acceptance is tuned on it — with the server's top_k/top_p/min_p and a fixed seed per request. Parity does not need greedy: identical logits sample identical tokens at any temperature |
|
||||
| the environment | the report lists the engine's configuration knobs **by name only**, from a fixed list (`RADIANCE_HOME`, `RADIANCE_KERNELS`, `OMP_NUM_THREADS`, …) — a value may be a path or a token, and a name that is only a prefix plus a secret suffix is not on the list. The report is pasted into issues, so it carries no path either: the model is named by its architecture and quantisation, and the corpus and baseline are named as such |
|
||||
|
||||
The mode warns, in the report, about the settings that make its numbers those of a different
|
||||
engine: `profile-ops` (recorded passes off, barriers added), `no-prefix-cache` (no lookups or
|
||||
publishing to pay for), no usable chat
|
||||
template (raw text, so tokens a step and acceptance are not chat traffic's), and a busy host.
|
||||
|
||||
## Reproducibility: whether the numbers repeat
|
||||
|
||||
The table above makes a run a measurement. Whether its numbers repeat on the next run, or on another
|
||||
day, depends on more than the workload, so every report states it in three parts and the Markdown
|
||||
gathers them under **Reproducibility**. None of them changes the verdict or the exit code: each is
|
||||
how the engine serves, and its fix makes it a different engine.
|
||||
|
||||
| what moves the numbers | what the report carries |
|
||||
|---|---|
|
||||
| the runs of one point disagree | `spread_pct`, (max − min) / median, beside every summarised number. `stability` lists each headline number above **5 %** (`diag::kMaxSpreadPct`) — ms a step for every category prompt and concurrency point (not their token rate, which also moves with the text each run samples from its own seed), TTFT and prefill rate for the prefill sweep, the arriving prompt's TTFT — and its verdict is `stable`, `UNSTABLE` or `not judged` (no point with two runs). A category's own summary pools prompts that differ by design, so its stability is judged prompt by prompt (`prompts_summary`) |
|
||||
| the machine | `conditions`: the build, the host settings that move a step's time (CPU governor and energy preference, kernel, device runtime, THP, IOMMU) and the serving cards (DPM ranges, power cap against its default, voltage offset, runtime PM, link), with the startup report's findings and their fix. A finding at warn level is also a warning of the run. `conditions.fingerprint` hashes all but the findings; with `diagnose-baseline`, `parity.conditions` lists every field that differs between the two reports — informational, since tokens do not depend on clocks |
|
||||
| the cards' state | each run's `cards`: temperature (edge, junction, memory), power, performance level and current DPM levels before and after it, read between runs only (the SMU answers under its lock). `thermal` gives each card's range over the report and warns when runs started more than 10 °C apart (`diag::kMaxStartTempSpreadC`) or the performance level changed |
|
||||
| the engine's own adaptivity | `reproducibility` notes it: dynamic placement (the heat engine moves experts as it sees routing, so a run starts with the resident set the runs before it left; `deterministic` pins it), `prefill-interleave auto` (decode-only steps sized by how long a chunk step took), a card at performance level `auto` (clocks chosen by the firmware; a fixed level such as `profile_standard` holds them, below serving clocks), and fewer than 5 runs a point |
|
||||
|
||||
For an A/B comparison of two builds: the same `conditions.fingerprint`, `diagnose-runs: 5` or more,
|
||||
`deterministic` for a MoE model, a fixed `prefill-interleave`, a fixed performance level on the
|
||||
cards, and both reports `stable`. Then a difference larger than the points' spread is the build's.
|
||||
|
||||
## Parity
|
||||
|
||||
`diagnose-baseline: FILE` compares every request's tokens with an earlier `diagnose.json` of the
|
||||
same workload, and fails the run on any difference. Two reports are comparable only if their
|
||||
`workload.fingerprint` — corpus, tokens, runs, sweeps, context, template, sampling — is the same;
|
||||
`compare_outputs` refuses rather than compare a different workload. Points only one side ran are
|
||||
reported as missing, not as equal. A drop in draft acceptance that every request shares is
|
||||
reported beside the token comparison, since it is not a correctness difference.
|
||||
|
||||
## Sequence
|
||||
|
||||
1. **Done, host-tested.** The flag, the driver, the step ring, the report with categories, the
|
||||
concurrency and prefill sweeps, and interference.
|
||||
1b. Placement, expert-streaming and link counters per phase; the dashboard's Diagnose tab reading
|
||||
the last report.
|
||||
2. An issue census: every (op, band, domain, `n`) with calls per step and operand shapes, exported
|
||||
for `rad-kbench`.
|
||||
3. Per-dispatch device time in the play path, joined to the op through a record-to-op table made at
|
||||
recording time, evaluated like `libr4d/isa/tsum.sh` and `libr4d/isa/gaps.sh`.
|
||||
4. A correctness window: repeat and oracle for chosen ops over a step window rather than the whole
|
||||
process, with ops that have no `libref` line reported as NOT CHECKED.
|
||||
|
||||
Steps 1b to 4 are listed under `not_measured` in every report, so a number that is absent says so
|
||||
in the artifact itself and never reads as a zero. The mode is host-buildable and its arithmetic is
|
||||
tested on the host; the numbers it writes on a card are the measurement, and belong with the
|
||||
hardware they came from.
|
||||
+186
@@ -0,0 +1,186 @@
|
||||
# Flint on radiance
|
||||
|
||||
Recursive Flint (39.8B total / ~2.5B active): a 49-layer decoder with 2 dense layers followed by
|
||||
47 sigmoid-routed MoE layers. The architecture plugin is `arch/flint`; the containers are built
|
||||
from the BF16 checkpoint with `rad-convert`.
|
||||
|
||||
## Status
|
||||
|
||||
- **Q4** (`flint-q4.rad`, 19.72 GiB, fits one card): u4 attention, int4 experts, plain int8
|
||||
dense/shared/head. Served on this build by the same forms as `hyv3_bf16`'s W4 and W8 recipes.
|
||||
- **IQ8R** (`flint-iq8r.rad`, about 38 GiB, two cards): an IQ8R trunk and rotated int8 experts,
|
||||
the forms `qwen35moe_w8a8` serves Qwen3.6-35B-A3B with. It replaces the plain int8 "Q8"
|
||||
container of the 1.17-era port, whose unrotated int8 experts this build does not serve (a
|
||||
container converted that way is refused by name; convert it again with the IQ8R recipe).
|
||||
|
||||
The measurements below were taken on the 1.17-era build with the forms it used then (the plain
|
||||
int8 Q8 container and that build's plain int8 grouped GEMM); they have not been repeated on this
|
||||
build. See [Measured](#measured).
|
||||
|
||||
## Geometry
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| layers | 49: 2 dense, 47 MoE |
|
||||
| attention | 32 query / 4 KV heads, head_dim 128, QK RMSNorm per head |
|
||||
| sink | learned per-head `softmax_offset` on every layer (`attn_paged_sink`) |
|
||||
| position | RoPE on the 35 sliding layers; NoPE on the 14 full layers |
|
||||
| window | 513 on the sliding layers |
|
||||
| FFN | dense `n_ff` 6144; MoE 256 experts, top-6, expert width 512, shared 1024, sigmoid routing, `norm_topk_prob` |
|
||||
| vocab | 150144, untied head |
|
||||
| KV | two groups: full (14 layers) and window 513 (35 layers) |
|
||||
|
||||
The full layers are `0, 1, 5, 9, ..., 45, 48`; the rest are sliding and carry RoPE.
|
||||
|
||||
## Containers and recipes
|
||||
|
||||
| file | contents | size |
|
||||
|---|---|---|
|
||||
| `flint-q4.rad` | U4 attention, I4 experts, INT8 dense/shared/head, BF16 router/norms/embed | 19.72 GiB |
|
||||
| `flint-iq8r.rad` | IQ8R attention/dense/shared gate-up, rotated INT8 experts and shared down, INT8 head, BF16 router/norms/sinks/embed | about 38 GiB (not re-measured) |
|
||||
|
||||
Recipes: `data/recipes/flint-bf16-q4.recipe` and `data/recipes/flint-iq8r.recipe`.
|
||||
|
||||
The plugin reads which form a container holds from layer 0's q projection:
|
||||
|
||||
- **Rotated int8 trunk** (IQ8R, or the 128-group rotated int8 form): the norms write
|
||||
`rmsnorm_had_quant_i8g`'s codes (`ar_rmsnorm_had_quant_i8g` with the fused all-reduce at TP2),
|
||||
the attention output `had_quant_act_i8g`'s and the gated products `gated_had_quant_i8g`'s, and
|
||||
every linear reads them at `i8a8h` without a quantiser of its own. The routed experts must be
|
||||
stored rotated (int8, or a rotated four-bit form with an int8 row); the grouped GEMM
|
||||
(`moe_gemm_i8a8`) reads the block input's own codes for gate/up and the gated product's, at one
|
||||
scale a 128, for down.
|
||||
- **Any other trunk** (bf16, the Q4 recipe's u4 attention, plain int8 linears): each linear reads
|
||||
the bf16 plane or quantises it itself (`quant_act_i8g` for a plain int8 weight), and four-bit
|
||||
experts read the block input's E4M3 pair (`moe_gemm_w4a8`).
|
||||
|
||||
A rotated trunk over unrotated experts, or rotated int8 experts under an unrotated trunk, is
|
||||
refused at declare with the recipe to use.
|
||||
|
||||
Two non-obvious inputs:
|
||||
|
||||
- `data/flint-zero-bias.safetensors`: Flint has no router correction bias. The sigmoid router's
|
||||
bias is selection-only, so the converter merges 47 x `[256]` zero tensors under
|
||||
`model.layers.N.mlp.expert_bias`.
|
||||
- `data/flint-chat-template.jinja`: the checkpoint's template contains `\x00`, which the Jinja
|
||||
parser rejects. This is the same template without that replace; pass it with `--chat-template`,
|
||||
or `/v1/chat/completions` answers 501 for want of a template.
|
||||
|
||||
## Convert
|
||||
|
||||
```bash
|
||||
export RADIANCE_HOME=$PWD/build/radiance_home
|
||||
|
||||
# Q4
|
||||
./build/bin/rad-convert "$HOME/models/flint" \
|
||||
--add data/flint-zero-bias.safetensors \
|
||||
--recipe data/recipes/flint-bf16-q4.recipe \
|
||||
--chat-template data/flint-chat-template.jinja \
|
||||
--report 20 --gpus 0,1 -o "$HOME/models/rad/flint-q4.rad"
|
||||
|
||||
# IQ8R
|
||||
./build/bin/rad-convert "$HOME/models/flint" \
|
||||
--add data/flint-zero-bias.safetensors \
|
||||
--recipe data/recipes/flint-iq8r.recipe \
|
||||
--chat-template data/flint-chat-template.jinja \
|
||||
--report 20 --gpus 0,1 -o "$HOME/models/rad/flint-iq8r.rad"
|
||||
```
|
||||
|
||||
`--plan-only` is the cheap pre-flight: it runs declare and resolves every op against the loaded
|
||||
kernels before reading the 75 GiB checkpoint.
|
||||
|
||||
## Serve
|
||||
|
||||
```bash
|
||||
# Q4, one card
|
||||
./build/bin/radiance --model "$HOME/models/rad/flint-q4.rad" \
|
||||
--radiance-home build/radiance_home --max-model-len 262144 --port 8090
|
||||
|
||||
# Q4, two cards (long context, expert parallel)
|
||||
./build/bin/radiance --model "$HOME/models/rad/flint-q4.rad" --tp 2 \
|
||||
--radiance-home build/radiance_home --max-model-len 262144 --port 8090
|
||||
|
||||
# Q4 with the int8 KV cache (about half the cache memory)
|
||||
./build/bin/radiance --model "$HOME/models/rad/flint-q4.rad" \
|
||||
--radiance-home build/radiance_home --max-model-len 262144 \
|
||||
--kv-cache-dtype i8 --port 8090
|
||||
|
||||
# IQ8R needs both cards: about 38 GiB of weights
|
||||
./build/bin/radiance --model "$HOME/models/rad/flint-iq8r.rad" --tp 2 \
|
||||
--radiance-home build/radiance_home --max-model-len 131072 --port 8090
|
||||
```
|
||||
|
||||
The KV cache is bf16 by default, or with `--kv-cache-dtype i8` the int8 cache: K and V as int8
|
||||
codes with one f16 scale each per token and head (`2 * head_dim + 4` bytes a token and head).
|
||||
Both KV groups, the full one and the 513-token window, take it, and the sink attention, the store
|
||||
and the fused prologue all have rows for both. No other cache dtype is served.
|
||||
|
||||
## Measured
|
||||
|
||||
Taken on the 1.17-era build, before this port: the "Q8" columns are the plain int8 container
|
||||
(unrotated int8 linears and experts, served by that build's plain int8 grouped GEMM), which this
|
||||
build no longer serves; the IQ8R container has not been measured. The Q4 container is the same
|
||||
recipe, served now by this build's kernels, and has not been re-measured either.
|
||||
|
||||
Two R9700s, greedy, warm, prefix cache disabled. Q4 and Q8 both at TP2. The payloads are
|
||||
1,325 / 8,928 / 26,073 tokens. Tokenizers differ at 26K, so the payload is not the same token
|
||||
count on both sides.
|
||||
|
||||
| context | Q4 prefill | Q4 decode | Q8 prefill | Q8 decode |
|
||||
|---|---|---|---|---|
|
||||
| 1.3K | 14,488 | 161.4 | 8,036 | 112.5 |
|
||||
| 9K | 14,019 | 154.5 | 8,232 | 109.8 |
|
||||
| 26K | 11,850 | 136.6 | 7,621 | 100.4 |
|
||||
|
||||
Reference on the same box, llama-server Q8 (fresh server, `-ngl 999 --jinja`) and Q4 (the
|
||||
release's GGUF): about 2,364 / 5,359 / ~5,028 tok/s prefill for Q8 at 1.3K / 9K / 26K, ~65-70
|
||||
tok/s decode, and 2,197 / 5,400 / ~3,290 tok/s prefill for Q4 with 77.7 tok/s decode at 1.3K.
|
||||
llama.cpp's numbers move with its build and flags; re-measure beside the run being reported.
|
||||
|
||||
## Kernels
|
||||
|
||||
- **Experts.** IQ8R: `moe_gemm_q` at dtype `i8a8h` (`moe_gemm_i8a8`), rotated int8 weights at a
|
||||
bf16 scale a (row, 128 of K) against the rotated int8 activation. Q4: `moe_gemm_q` at `w4a8`
|
||||
(`moe_gemm_w4a8`) against the E4M3 activation. Expert parallel at TP2: each rank holds 128
|
||||
whole experts a layer. On the 1.17-era build the Q4 w4a8 oracle reported the rows past
|
||||
`off[n_expert]` as a mismatch (the kernel zeros the dropped tail, the reference computes it);
|
||||
every live row agreed, and the first bad offset was `live * N`.
|
||||
- **Sink attention.** `attn_paged_sink` at head_dim 128, gqa 8, on the bf16 or the int8 cache.
|
||||
A prefill-shaped launch takes the WMMA kernel with the sink folded in: the sink seeds the running
|
||||
max and one lane's denominator in the log2 domain, and the final reduction adds both lanes.
|
||||
Decode and verify launches take the scalar kernel with split-KV, whose unsplit store and merge
|
||||
fold the sink.
|
||||
- **Residual and all-reduce.** `NormQuantFP8` folds the previous block's delta and its two-rank
|
||||
all-reduce into the norm (`fuse_ar`), so only the embedding's reduce and the last block's
|
||||
remain. Flint also sets `shared_fp32_combine` 0: the gather adds the local routed and shared
|
||||
partials and one collective covers both, which is the TP1 arithmetic. The exact cross-rank
|
||||
wire is the default; under `--tp-wire wht6` both trunk forms' norms have a 6-bit fused form
|
||||
(`ar_rmsnorm_had_quant_i8g` and `ar_rmsnorm_quant_fp8` at `wire` 6).
|
||||
- **NoPE prologue.** At decode heights the 14 full layers use `qkv_norm_rope_kv_store` with
|
||||
`rotary_dim` 0: the kernel copies the normed head through the rotary stage, so it is the norms
|
||||
and the store alone. Prefill heights take the standalone norms and `kv_store`, without a
|
||||
rope on those layers.
|
||||
|
||||
## Correctness
|
||||
|
||||
On the 1.17-era build (not repeated on this one):
|
||||
|
||||
- Needle retrieval at 8K and 32K returned `ZX-417-QQ` exactly, with BF16 and E4M3 KV, including
|
||||
after the sink-aware WMMA prefill.
|
||||
- A `get_weather` tool call parsed as `tool_calls` with `{"city":"Paris"}`; reasoning uses
|
||||
`<think>...</think>`.
|
||||
- A 250,696-token prompt completed on two cards. On one card, Q4 at 262K fit with that build's
|
||||
E4M3 KV cache: 19.37 GiB of weights plus an 11.45 GiB cache. The int8 cache of this build takes
|
||||
a few percent more a token (its two f16 scales a token and head).
|
||||
|
||||
On this build, `tests/flint_arch_test.cpp` checks the declared graph and the step of both
|
||||
containers at one and two ranks on both caches, and `tests/r4d_emu/test_attn.cpp` the sink WMMA
|
||||
prefill on the bf16 and the int8 cache.
|
||||
|
||||
## Known limitations
|
||||
|
||||
- **Decode attention.** The scalar sink kernel is the short-context ceiling: ~184 us for a
|
||||
513-window layer at 1.3K, against ~15 us of KV traffic. A flash-decoding decode form is the
|
||||
follow-up.
|
||||
- **No draft head.** Flint has no MTP head. Prompt-lookup speculation is available at serve time
|
||||
and is workload-dependent.
|
||||
+86
-5
@@ -314,6 +314,8 @@ and runs.
|
||||
| `qwen4exp_fp8` | Qwen4-Exp / Qwen3.8-Flash-Next: hybrid Gated DeltaNet + gated attention, 512 experts |
|
||||
| `gemma4` | Gemma 4 text decoders (26B-A4B MoE and the dense members): bf16 trunk, routed experts bf16 or block fp8, and the DFlash drafter |
|
||||
| `gemma4_bf16` | Gemma 4 dense in bf16, with its vision tower |
|
||||
| `museglimmer` | Meta Muse Glimmer 30B: gated attention alternating sliding-window (rotary) and NoPE full layers, Gemma-2 double norms, a 50-block windowed ViT; bf16 |
|
||||
| `museglimmer_ct` | the same trunk as an int4 container (`--set quantization_config.quant_method=compressed-tensors`) |
|
||||
| `lfm2_bf16` | LiquidAI LFM2 and LFM2-VL in bf16, including d1 (§5.13) |
|
||||
| `embgemma2` | EmbeddingGemma 2, an embedding model (§5.6) |
|
||||
| `nomicbert` | nomic-embed-text-v2-moe, an embedding model (§5.6) |
|
||||
@@ -1469,6 +1471,32 @@ short of the boundary and the next step finishes it. A prompt with nothing besid
|
||||
`off` lets a chunk take the whole step; `N` holds a shared chunk to N tokens (startup warns when N is
|
||||
under the stager's step). `radiance:engine_prefill_chunks_capped_total` counts the chunks held back.
|
||||
|
||||
**Adaptive mixed-step latency** (`mixed-step-target-ms: N`, default off). A mixed step contains
|
||||
both prefill rows and at least one decoding sequence. When this flag is set, completed mixed steps
|
||||
teach a model-agnostic controller an aggregate prefill-row cap. The cap is shared fairly among the
|
||||
prefills in that step, decode rows are reserved first, and a lone prefill remains unchanged. This
|
||||
is a soft service-time target, not a request deadline: timing starts when the engine issues the
|
||||
step and ends after its forward and speculative-drafter work. Queueing, HTTP transport and the
|
||||
client are outside it, and the legal chunk quantum, fixed decode cost, media passes or host jitter
|
||||
can make the target unattainable.
|
||||
|
||||
The controller starts at one quarter of the model's shared-step capacity, corrects an over-target
|
||||
representative chunk immediately, and grows cautiously after three clearly under-target samples.
|
||||
A true prompt tail does not change the learned cap; a checkpoint or fixed busy-chunk boundary does,
|
||||
because the prompt continues and a lower cap can shorten its next step. If the target is lower than
|
||||
one legal mixed step, the cap bottoms out at one prefill quantum and misses remain visible. Startup
|
||||
refuses configurations whose token budget or explicit busy cap cannot carry one legal prefill
|
||||
quantum beside a decode row. When the batch budget cannot carry one quantum for every simultaneous
|
||||
prefill, equal sharing applies to the requests that fit and the scheduler's priority/arrival order
|
||||
continues the rest on later steps; startup prints that capacity. Raise the batch budget if every
|
||||
admitted prefill must progress in every mixed step.
|
||||
|
||||
Use the target for an interactive multi-user deployment where long fresh prompts otherwise make
|
||||
active streams pause. It redistributes when useful work completes; it does not make the prefill
|
||||
free, and may lower fresh-prefill throughput under contention. Pin and measure the target per
|
||||
deployment rather than branching the scheduler by model name. The relevant metrics are
|
||||
`radiance:mixed_step_target_steps_total`, `_misses_total`, and `_prefill_cap`.
|
||||
|
||||
**Check the prefix cache after changing the chunk.** The larger arena shrinks the KV pool (here
|
||||
516,864 to 499,920 pool tokens, 3.3%), and §4.3's cliff is sharp. With two ~180K sessions (first
|
||||
turns back to back, then the first session's second turn), a 512 chunk took 137.7 s, 130.0 s and
|
||||
@@ -1844,7 +1872,9 @@ models:
|
||||
- `prefix-cache-mib: N` enables the host tier, up to N MiB. It holds attention blocks only; a hybrid
|
||||
model's linear-state snapshots are already in host memory, in the `checkpoint-slots` store. A
|
||||
conversation larger than the tier keeps its start there and is prefilled again past it once VRAM
|
||||
gives the rest up; the startup log warns when the tier holds less than one `max-model-len`
|
||||
gives the rest up (for a request that needs the room, or where a few leftover blocks high in the
|
||||
pool keep the expert slab's loan from most of it under `placement: expert_tiered`); the startup
|
||||
log warns when the tier holds less than one `max-model-len`
|
||||
conversation and says how many MiB would, and a `kv tiers: ... got no host copy` line appears when
|
||||
it happens (`/sessions` `moved.held_back`).
|
||||
While a KV group streams (`kv-resident`), the tier is off and its MiB are not reserved: a
|
||||
@@ -2297,6 +2327,7 @@ switch is set with `true`. The fleet's own keys (a model's `aliases`, `priority`
|
||||
|---|---|---|
|
||||
| `max-num-batched-tokens: N` | 2048 | largest token count one step may carry |
|
||||
| `prefill-interleave: N` | auto:1 (0 under `deterministic: true`, KL mode, generators) | decode-only steps after each prefill chunk while other sequences decode (§4.5), at most 64; `auto` fits them in a quarter of the chunk step's measured time, `auto:SHARE` in SHARE of it (0 < SHARE <= 4); `0` lets every step carry a chunk |
|
||||
| `mixed-step-target-ms: N` | 0 (off) | soft completed-service-time target for mixed prefill/decode steps; learns one aggregate prefill cap while decoders are active and leaves uncontended prefill unchanged (§4.5) |
|
||||
| `preempt-wait-ms: N` | 5000 | how long a preempted prefill may wait for its whole-recompute gate before reclaiming cache blocks and preempting lowest-priority running requests until one overdue request can prefill; `0` falls back on the next step. A preempted request publishes what it computed to the prefix cache, as a finished one does, so its recompute adopts its prompt instead of computing it again; under pressure the cache gives those blocks back, the newest last, before another request is preempted |
|
||||
| `busy-prefill-chunk: MODE` | auto | a prefill chunk's share of a step that has other work: `auto` leaves decode rows and waiting requests their room (§4.5), `off` takes the whole step, `N` holds it to N tokens |
|
||||
| `max-num-seqs: N` | 256 | largest number of sequences one step may carry |
|
||||
@@ -2446,6 +2477,18 @@ keys are refused on it, and so are the pixel bands.
|
||||
| `kld-lora: NAME` | run the documents through the `lora` adapter `NAME` (§4.9.1), e.g. against a reference recorded from the merged checkpoint |
|
||||
| `kld-lora-sources: PREFIX` | with `kld-lora`, only the documents whose `source` starts with `PREFIX` run through the adapter; the rest run as the base, in the same steps |
|
||||
|
||||
**Self-measurement**, instead of serving: a fixed workload, a report, an exit code; see [DIAGNOSE.md](DIAGNOSE.md)
|
||||
|
||||
| key | default | |
|
||||
|---|---|---|
|
||||
| `diagnose: DIR` | — | run a fixed workload instead of serving and write `DIR/diagnose.json` and `DIR/diagnose.md`: step times, tokens a step, draft acceptance, TTFT, emission intervals, jitter, by prompt category, concurrency and prefill depth |
|
||||
| `diagnose-tokens: N` | 256 | tokens a decode stream generates |
|
||||
| `diagnose-runs: N` | 3 | measured runs of each point, after one unmeasured |
|
||||
| `diagnose-concurrency: LIST` | 1,2,4,8 | stream counts of the concurrency sweep |
|
||||
| `diagnose-prefill: LIST` | 1024,4096,16384,65536 | prompt lengths of the prefill sweep |
|
||||
| `diagnose-corpus: FILE` | built-in | JSONL of category prompts |
|
||||
| `diagnose-baseline: FILE` | — | an earlier `diagnose.json`: compare every request's tokens with it |
|
||||
|
||||
**Diagnostics**
|
||||
|
||||
| key | |
|
||||
@@ -2488,7 +2531,7 @@ keys are refused on it, and so are the pixel bands.
|
||||
| `POST /v1/responses`, `POST /v1/responses/input_tokens` | OpenAI's Responses API, for Codex and the OpenAI SDKs' `responses` client (§5.9) |
|
||||
| `POST /completion`, `/completions`, `POST /infill` | llama-server's native completion and fill-in-the-middle, for llama.vim, llama.vscode and clients of llama-server's own API (§5.9) |
|
||||
| `GET /v1/models`, `/v1/models/:id` | what is loaded, with `max_model_len` (the context it serves) and `root` (the `model` path) as vLLM reports them, and `capabilities` (the same object `/server_info` reports); `:id` returns the entry itself, as OpenAI's retrieve does |
|
||||
| `GET /health`, `/v1/health`, `/ping`, `POST /ping` | liveness |
|
||||
| `GET /health`, `/v1/health`, `/ping`, `POST /ping` | liveness; 503 with `"status": "stuck"` once the device has advanced nothing for a minute. A device stuck for `scheduler.stuck-exit` (60s; `0` never) ends the process (exit status 70, the queues it is stuck on in the log), so a restart policy brings the server back |
|
||||
| `GET /load` | current load |
|
||||
| `GET /version` | server version |
|
||||
| `GET /props` | llama-server's props: `n_ctx`, `total_slots`, `modalities`, `model_path`, the chat template and its capabilities, `bos_token`/`eos_token`, and the request defaults under llama-server's names |
|
||||
@@ -3551,12 +3594,48 @@ curl -s http://localhost:8000/v1/audio/speech -H 'Content-Type: application/json
|
||||
minutes; the model ends the speech at the end of the text. The prompt holds at most 512 tokens.
|
||||
- **`seed`**, **`response_format`**, **`speed`** and **`voice`** are read as for music below
|
||||
(`voice` is ignored here too: the instructions say who speaks); `num_inference_steps` is refused
|
||||
(the model has no denoiser). Cloning a voice from a recording is not served.
|
||||
(the model has no denoiser).
|
||||
|
||||
**Voice cloning:** supply `references: [{"audio": "...", "text": "..."}]`, with one clean recording
|
||||
and its exact transcript. `audio` is a base64-encoded audio file or a base64 data URL, not a server
|
||||
path or remote URL. The server decodes/resamples it to 24 kHz mono. The recording may hold at most
|
||||
10 seconds, including zero-padding to whole 1920-sample frames. Its transcript, audio frames and
|
||||
new speech together must fit the 512-row prompt. Obtain the speaker's consent and rights to the
|
||||
recording before cloning.
|
||||
|
||||
```sh
|
||||
python3 - <<'PY' > clone.json
|
||||
import base64, json
|
||||
with open("reference.wav", "rb") as f:
|
||||
audio = base64.b64encode(f.read()).decode("ascii")
|
||||
print(json.dumps({"input": "Here is a new sentence in the reference voice.",
|
||||
"references": [{"audio": audio, "text": "The exact words in reference.wav."}],
|
||||
"guidance_scale": 1, "response_format": "wav", "seed": 42}))
|
||||
PY
|
||||
curl --fail-with-body http://localhost:8000/v1/audio/speech \
|
||||
-H 'Content-Type: application/json' --data-binary @clone.json -o clone.wav
|
||||
```
|
||||
|
||||
Cloning uses Breeze's `ref_clone_tata` continuation template. Omit `instructions` and use
|
||||
`guidance_scale: 1` (the default) to keep the reference delivery. To direct the cloned voice,
|
||||
also supply `instructions`, for example `"Speak softly and slowly, with a reassuring delivery."`,
|
||||
and start with `guidance_scale: 4`. This selects `ref_edit_tata`: the conditional prompt includes
|
||||
the reference and direction, while its guidance baseline includes the same reference without
|
||||
direction. Each branch has its own text length and reference-frame map; the audio is encoded
|
||||
once and shared. Higher guidance strengthens direction but can affect naturalness or identity.
|
||||
This is ordinary two-branch guidance, not Breeze's three-branch dual-guidance mode (not served).
|
||||
WAV, PCM, HTTP streaming and the speech WebSocket use the same reference encoder and templates.
|
||||
**Reconvert older Breeze `.rad` files with the updated recipe to clone voices:** older conversions
|
||||
omitted the audio encoder's weights. Such a container still serves speech as before, and a request
|
||||
with `references` is answered 400 (`this model takes no reference audio`). The new encoder and its
|
||||
Euclidean codebooks stay in f32; no Python model runtime or external encoder service is needed for
|
||||
requests.
|
||||
|
||||
Speech is played four frames (0.32 s) at a time as it is made, so the streamed forms below carry it
|
||||
as it is spoken. On one R9700 a sentence is made at 0.6 of the time it plays (5.1 s of speech in
|
||||
3.1 s), and a stream's first audio comes 0.21 s after the request; four speak at once at about the
|
||||
speed they play (43 s of speech in 12.1 s). Breeze-TTS-2 is licensed for research and
|
||||
speed they play (43 s of speech in 12.1 s). These measurements are for reference-free speech;
|
||||
cloning adds reference-encoding work before the first frame. Breeze-TTS-2 is licensed for research and
|
||||
non-commercial use only, and BreezeBlue counts hosting it as an API as commercial.
|
||||
|
||||
#### Speech: drama-3
|
||||
@@ -4152,6 +4231,8 @@ always 1 and carries the cache's settings as labels: `cache_dtype`, `block_size`
|
||||
| `draft_depth_adaptive`, `draft_verify_depth_total{depth}` | the adaptive window's mean over the running sequences, and verifies by the drafts they carried; only with `draft-window: adaptive` (§4.6) |
|
||||
| `engine_prefill_chunks_capped_total` | prefill chunks held back to share a step (§4.5) |
|
||||
| `engine_steps_held_total` | decode-only steps `prefill-interleave` ran between chunks (§4.5) |
|
||||
| `mixed_step_target_steps_total`, `mixed_step_target_misses_total` | mixed steps observed by `mixed-step-target-ms`, and those whose completed engine service time exceeded its soft target (§4.5) |
|
||||
| `mixed_step_target_prefill_cap` | current learned aggregate prefill-row cap; absent while the policy is off (§4.5) |
|
||||
| `attn_cached_tokens_total`, `linear_cached_tokens_total` | prefix reuse, both halves |
|
||||
| `linear_checkpoints_written_total`, `linear_prefix_cache_hit_rate` | |
|
||||
| `prefix_cache_evictions_total`, `prefix_cache_ckpt_evictions_total` | |
|
||||
@@ -4313,7 +4394,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 2.0.0
|
||||
I STARTUP REPORT -- radiance 2.1.0
|
||||
I CONFIGURATION -- every option, the value in force, and where it came from
|
||||
I --model /models/flashnext.rad [models.flashnext.model]
|
||||
I --tp 2 [models.flashnext.tp]
|
||||
|
||||
+4
-2
@@ -186,6 +186,7 @@ scheduler:
|
||||
load-timeout: 120s # a request waits this long for its model, then 503
|
||||
drain-timeout: 30s # a model being evicted gets this long to finish its requests
|
||||
keepalive: 10s # SSE comment interval for streaming requests waiting on a load
|
||||
stuck-exit: 60s # a device that advances nothing this long ends the process; 0 never
|
||||
warm-up: true # fill free VRAM, then host RAM, with models at start (§8.6)
|
||||
```
|
||||
|
||||
@@ -196,7 +197,7 @@ scheduler:
|
||||
| `server:` | `host`, `port`, `api-key`, `api-key-env`, `allow-host`, `trusted-proxy`, `http-threads`, `read-timeout`, `write-timeout`, `keep-alive-timeout`, `max-body-mib`, `retry-after`, `no-cors`, `live`, `log` (`info`/`debug`/`trace`), `radiance-home`, `kernels`, `download-dir`, `proceed-with-incompatible-configuration`, `debug-accept-reference-kernels` |
|
||||
| `cards:` | `all` or a list of card indices |
|
||||
| `memory:` | `gpu-headroom-mib`, `gpu-memory-mib` (per card), `host-mib`, `host-headroom-mib`, `disk-tier` |
|
||||
| `scheduler:` | `load-timeout`, `drain-timeout`, `keepalive`, `warm-up` |
|
||||
| `scheduler:` | `load-timeout`, `drain-timeout`, `keepalive`, `stuck-exit`, `warm-up` |
|
||||
| `defaults:` / `models.<name>:` | every per-model flag: model source, TP, placement, KV, scheduler, spec decode, LoRA, request defaults and limits, media limits, offline modes, debug; plus the fleet keys `aliases`, `priority`, `pin`, `ttl`, `flex`, `park` |
|
||||
| `groups:` | `together` / `exclusive` lists |
|
||||
|
||||
@@ -208,7 +209,8 @@ adds more.
|
||||
|
||||
A one-model YAML is the only way to run one model too. `radiance --model X ...` is refused with a
|
||||
message that prints the equivalent YAML, so a migration is copy and paste. Offline modes (KL
|
||||
recording, calibration) run from a one-model YAML with the `kld-*` / `calib-*` keys on that model;
|
||||
recording, calibration, the diagnose workload) run from a one-model YAML with the `kld-*` /
|
||||
`calib-*` / `diagnose` keys on that model;
|
||||
the process does that job and exits, as today.
|
||||
|
||||
### 4.5 Provenance
|
||||
|
||||
+41
@@ -206,6 +206,8 @@ at once. Run it before adding a kernel plugin; the loader names only the first c
|
||||
| `hc_project` | `M`(range) `n` `hc` `scale`:f64 `dtype` | `h`:inout, `v`, `on` |
|
||||
| `layernorm` | `M`(range) `n` `eps`:f64 `dtype` | `x`, `w`w, `b`w? → `y` |
|
||||
| `grid_embed` | `M`(range) `n` `side` `dtype` | `x`:inout, `table`w, `coord` |
|
||||
| `grid_embed_pad` | `M`(range) `n` `side` `dtype` | `x`:inout, `table`w, `coord` |
|
||||
| `window_order` | `M`(range) `window` | `coord`, `cu` → `idx`, `inv`, `pos`, `cuw` |
|
||||
| `grid_embed_aa` | `M`(range) `n` `side` `dtype` | `x`:inout, `table`w, `coord` |
|
||||
| `grid_embed_cpe` | `M`(range) `n` `side` `dtype` `n_prefix`/opt | `x`:inout, `table`w, `coord`, `prefix`w? |
|
||||
| `add` | `M`(range) `n` `dtype` `div`:f64/opt | `a`, `b` → `y` |
|
||||
@@ -339,6 +341,29 @@ is `[4, M]` (row, column, grid height, grid width); sampling is bilinear with th
|
||||
the table's (align_corners), edge taps clamped, the four taps summed in f32 and rounded to `x`'s
|
||||
dtype before the add.
|
||||
|
||||
**`grid_embed_pad`** adds the same table with the same operands in the half-pixel-centre form
|
||||
(align_corners=False) under grid_sample's `padding_mode="zeros"`: per axis taps at `floor(src)` and
|
||||
`floor(src) + 1` of `src = (i + 0.5) * side / size - 0.5`, each carrying the hat weight
|
||||
`(1 - |src - tap|)+`, and a tap whose UNCLAMPED index falls outside `[0, side)` contributes zero
|
||||
rather than reading a clamped edge. The taps are summed in f32 in `grid_embed`'s order and rounded
|
||||
the same way. For a grid no larger than the table no tap is ever out of range and the op is
|
||||
`grid_embed`'s function at the different sample positions; it differs from it materially only when
|
||||
a grid upsamples past the table, which is the common case for Muse (448 px and larger images).
|
||||
|
||||
**`window_order`** computes the window-attention permutation of one encoder pass, entirely from
|
||||
on-device coordinates: HF's `get_vision_window_index` as a gather-index computation over the packed
|
||||
pass. `coord` is `[4, P]` i32 (row, column, segment height, segment width per patch) and `cu` is
|
||||
`[S+1]` i32, the per-frame segment boundaries. Windows of `window` patches partition each segment
|
||||
(one segment == one frame), scanned window-row-major, ragged at the segment's right and bottom
|
||||
edges; patches keep raster order within a window and windows never span segments. The outputs are
|
||||
i32: `idx` `[P]`, slot -> source patch (the gather index: `permuted[slot] = x[src[idx[slot]]]`);
|
||||
`inv` `[P]`, its inverse, used to undo at the tower's end; `pos` `[2, P]`, each slot's rope
|
||||
positions `(col + 1, row + 1)`, laid out component-major like the coordinate planes (Muse's rotary
|
||||
wants the axes swapped and offset by one relative to them, HF's `position_ids.flip(-1) + 1`); and
|
||||
`cuw` `[P+1]`, the cumulative window boundaries in the permuted order, `n_windows + 1` entries
|
||||
used. `M` is the patches this pass covers; slots past `M` are the identity. `window` <= 0 makes the
|
||||
permutation the identity and `cuw = cu`.
|
||||
|
||||
**`grid_embed_aa`** is the same addition with SigLIP2's resample, torch's
|
||||
`F.interpolate(mode="bilinear", align_corners=False, antialias=True)`: per axis a triangle filter on
|
||||
half-pixel centres, widened by the scale when the grid is smaller than the table, its in-table taps
|
||||
@@ -1448,6 +1473,8 @@ libref function says which (`libref/ref_audio.cpp`).
|
||||
| `cfg_topk_sample` | `M`(range) `n_vocab` `k` `rep` `cond_k`/opt `cfg`:f64 `temp`:f64/opt `stream` `dtype` `sup_lo`/opt `sup_hi`/opt `penalty`:f64/opt `top_p`:f64/opt | `logits`, `seed`, `frame` → `ids`; `cfg`?, `lane`?, `hist`:inout? |
|
||||
| `rvq_embed` | `M`(range) `n_embd` `n_codes` `vocab` `off0` `scale`:f64 `dtype` `round`/opt `clamp`/opt | `codes`, `t0`w, `t1`w → `y` |
|
||||
| `vq_encode` | `M`(range) `n` `dim` `bins` `dtype` | `x`:inout, `in_w`w, `in_b`w, `cb`w, `out_w`w, `out_b`w → `codes` |
|
||||
| `vq_euclidean` | `M`(range) `n` `bins` `dtype` | `x`:inout, `cb`w → `codes` |
|
||||
| `elu` | `M`(range) `n` `dtype` | `x` → `y` |
|
||||
| `frame_mix_store` | `M`(range) `n_embd` `L` `stride` `rep`/opt `dtype` | `hid`, `logits`w, `scale`w, `lane`, `frame`, `status`, `dst`:inout |
|
||||
| `end_status` | `M`(range) `end` `rep` | `ids`, `lane`, `status`:inout |
|
||||
| `ras_pick` | `M`(range) `win` `lo` `hi` `rep`/opt `clear`/opt | `first`, `alt`, `lane`, `hist`:inout → `ids` |
|
||||
@@ -1503,6 +1530,20 @@ conditional first, then the unconditional) are consecutive rows, `rep` of them a
|
||||
`x -= out_w cb[code] + out_b` (`out_w` `[n, dim]`, the raw codebook row), rounded once into `x`.
|
||||
f32 arithmetic. A chain of these over a codec's codebooks, each quantising what the last left, is
|
||||
its residual quantiser.
|
||||
- `vq_euclidean`: Mimi's RVQ step (Breeze's reference encoder), after the enclosing split
|
||||
quantiser's input projection. For each row of `x` `[rows, n]`, choose the nearest row of `cb`
|
||||
`[bins, n]` by squared Euclidean distance in f32, ties to the lower index; write that index to
|
||||
`codes` i32 at its own stride, and subtract the chosen centroid from `x`. No normalisation and
|
||||
no per-codebook projections; the semantic and acoustic residual chains are independent. The
|
||||
device kernel supports f32, one workgroup a row, `n <= 4096`, `bins <= 65536`.
|
||||
- `elu`: `y = x >= 0 ? x : expm1(x)`, alpha 1, at each operand's row pitch. In-place use is valid.
|
||||
The device kernel supports f32 (Breeze's reference encoder).
|
||||
|
||||
The reference encoder also uses f32 device forms of ordinary `gemm_nt`, `layernorm` (up to 4096
|
||||
channels), exact-erf `gelu` and `attn_dense` (causal, head dimension 64, GQA 1, at most 512 rows).
|
||||
The existing `rope` entry dispatches f32 inputs to the full-head 64-dimensional NeoX form with
|
||||
one-component positions and no YaRN or Llama-3 scaling. Causal strided `conv1d` supports f32 as
|
||||
well as bf16; the explicit symmetric `pad` form remains bf16-only.
|
||||
- `frame_store`: `dst[(lane n_codes + k) stride + frame - skip] = codes[k, rep i]` for every `k`,
|
||||
when `frame >= skip` and `status[lane] >= 0`: a frame's codes into its lane's history, each
|
||||
codebook a row over the lane's frames, so a run of a lane's frames is a block of `n_codes`
|
||||
|
||||
@@ -1000,6 +1000,52 @@ H = np.zeros((k, k), np.float32); H[np.triu_indices(k)] = t; H = H + np.triu(H,
|
||||
|
||||
---
|
||||
|
||||
## The diagnose mode
|
||||
|
||||
```yaml
|
||||
# diag.yaml: the model's own keys, plus the mode
|
||||
models:
|
||||
quant:
|
||||
model: M.rad
|
||||
diagnose: DIR
|
||||
```
|
||||
|
||||
```sh
|
||||
radiance --config diag.yaml # the workload, the report, and the exit code
|
||||
```
|
||||
|
||||
Runs a fixed workload on the engine instead of serving it — decode by prompt category, a
|
||||
concurrency sweep, a prefill sweep with decode at each depth, and a prompt arriving into running
|
||||
streams — and writes `DIR/diagnose.json` and `DIR/diagnose.md`: step times and their spread, tokens
|
||||
a step, draft positions drafted and accepted, TTFT, per-token emission intervals and jitter, per
|
||||
request and per phase, with the machine and the settings it ran under. It starts as a serve would
|
||||
(same placement, same kernels, same prefix cache) and exits, so it can be run on every candidate
|
||||
build and compared.
|
||||
|
||||
| key | default | |
|
||||
|---|---|---|
|
||||
| `diagnose: DIR` | — | run the workload and write the report to DIR; `diagnose.json` is the whole report, `diagnose.md` reads it |
|
||||
| `diagnose-tokens: N` | 256 | tokens a decode stream generates |
|
||||
| `diagnose-runs: N` | 3 | measured runs of each point, after one unmeasured; median and spread are reported |
|
||||
| `diagnose-concurrency: LIST` | 1,2,4,8 | stream counts of the concurrency sweep; a count above `max-num-seqs` is skipped and reported |
|
||||
| `diagnose-prefill: LIST` | 1024,4096,16384,65536 | prompt lengths of the prefill sweep, in tokens; a length the context cannot hold is skipped and reported |
|
||||
| `diagnose-corpus: FILE` | built-in | JSONL, one `{"category", "messages" or "prompt", "max_tokens"?}` a line: code, reasoning, prose, json, file_edit, summarization |
|
||||
| `diagnose-baseline: FILE` | — | an earlier `diagnose.json` of the same workload: compare every request's tokens with it and fail the run on any difference |
|
||||
|
||||
Every prompt is salted so the prefix cache serves none of it, the cache is emptied before every
|
||||
run, and each request's cached-token count is checked afterwards: a hit, or step records the ring
|
||||
overwrote before they were read, makes the verdict `NOT A MEASUREMENT` and the exit code non-zero.
|
||||
Requests run at temperature 1 with the server's top_k/top_p/min_p and a fixed seed per request, so
|
||||
two builds of the same model are compared token for token. `diagnose` is a mode of the engine
|
||||
like `kld-ref`: it cannot be combined with the KL keys, `calib-corpus` or `debug-graph`, and the
|
||||
file names one model. `diagnose-corpus` and `diagnose-baseline` need it.
|
||||
|
||||
The report says in `not_measured` what it does not cover — per-kernel device time, placement and
|
||||
link counters per phase, op correctness over a step window, and the HTTP path. What the numbers
|
||||
mean, what makes a run a measurement and what is still missing: [DIAGNOSE.md](DIAGNOSE.md).
|
||||
|
||||
---
|
||||
|
||||
## The shell harnesses
|
||||
|
||||
`scripts/` drives a running engine: bring a model up, measure it, and assert on what comes back
|
||||
|
||||
+5
-1
@@ -19,7 +19,11 @@ The factor convention is the config's, as vLLM and transformers read it: `factor
|
||||
Validated: the Qwen3.8-27B and Qwen3.6-35B-A3B containers and both Flash-Next variants at factor 2,
|
||||
with retrieval at about 500K tokens, and TP3 perplexity with `rope-scaling` within about ±1% of
|
||||
the unscaled model at factor 2. The LLaMA plugins read the same keys and declare the same ops, but
|
||||
YaRN has not been run on a LLaMA model.
|
||||
YaRN has not been run on a LLaMA model. Muse Glimmer validated at factor 8 over 131072 (a 1M
|
||||
serving window) with retrieval at 913K tokens -- and, unusually, without any scaling at all
|
||||
(mechanical window extension to 495K, also retrieval-passing): only its 2048-wide sliding layers
|
||||
carry rotary and its full-attention layers are NoPE, so the unscaled window is the family's
|
||||
default recipe (docs/ARCHITECTURES.md, museglimmer).
|
||||
|
||||
## Metadata
|
||||
|
||||
|
||||
Reference in new issue
Block a user