Archived
radiance 2.0.0
Radiance becomes a multi-model engine: one process serves several models behind one port, loads each when a request names it, parks it in host memory or restores it from its container, and shares the cards between them (docs/MULTIMODEL.md). The configuration is one YAML file; the command line flags are gone (`radiance --config FILE`, hot reload on SIGHUP). Formats. IQ8R (rotated int8) and IQR-V4 replace FP8 and MXFP4 as whole-model formats, with an int8 KV cache (`kv-cache-dtype: i8`) in place of the fp8 one. Containers whose weights are block FP8, MXFP4, M2XFP4, NVFP4 or ParoQuant are refused at startup by the name of the first such weight. Not served until they have int8 containers: GLM-5.3-Flash, Ornith-1.5, Sage-A1.5, Nemotron-3.5-Bolt-74B, Ling-3.0-flash, drama-3 and Anima's FP8 container; Nemotron-3.5-Bolt-E4B, the Gemma 4 31B DFlash containers and MiniCPM5-2B bf16 serve without their drafter. 1.17.0 serves all of them. Speed. Chained launches for Qwen3.8-27B, Gemma 4, Gemma 3 and the small bf16 models, a new Qwen3.8-Flash-Next container (IQR-V4 experts, int8 trunk) with its decode step and prefill reworked, and a reworked adaptive draft window. Deployment. deploy/compose has two fleet files, tp1.yaml and tp2.yaml, each with its configuration beside it, in place of the per-model files. `host-pool-mib` is a model's host pool in all, split among its ranks. The dashboard is rebuilt: an hour of history kept by the server, each accelerator's memory by model, model states over time. Merged since 1.17.0: Nemotron-3.5-Bolt-74B-A9B by keptn42 (#339); GLM-5.3-Flash on four cards by AnimusNull (#397); chained launches for Flash-Next's decode step (#396) and preempted requests keeping their prefix and place (#405) by mici81; --prefill-interleave auto by Code000 (#410); eight more libr3d kernels and the w4a4 reference by RikshaDriver (#403, #407, #408); libr3d large-BAR and E4M3 decode fixes by neuromanMD (#438, #439); int4/int5 decode tiles by Kezi (#426); attention for Nanbeige 4.3 33B by everplays (#417); expert_stats_report.py by baKon (#431). Fixed: #398, #402, #419, #437 (dschmitz's patch); added the metrics of #392, and multi-model serving as asked for in #367 and #109. Plugin ABI 39: out-of-tree plugins need to be rebuilt. Thanks to @keptn42, @AnimusNull, @mici81, @Code000, @RikshaDriver, @neuromanMD, @Kezi, @everplays, @baKon and @dschmitz.
This commit is contained in:
1 parent
b4c04b6042
commit
ddcb9c69bb
696 files changed
+120770
-56596
No files matched your search
+10
-38
@@ -14,8 +14,8 @@ r4d_<family>_<op>_<the geometry it is compiled for>
|
||||
```
|
||||
|
||||
Every dimension in the name is a compile-time constant, and the entry point rejects a mismatch
|
||||
instead of running. `attn_decode_h256_gqa6_fp8kv` serves head_dim 256 with 6 queries per KV head and
|
||||
an fp8-e4m3 paged cache, and nothing else. A model with another head size needs a new
|
||||
instead of running. `attn_decode_h256_gqa6_i8` serves head_dim 256 with 6 queries per KV head and
|
||||
an int8 paged cache, and nothing else. A model with another head size needs a new
|
||||
instantiation under its own name, so no existing name changes and no caller can pick up a kernel
|
||||
that does not fit.
|
||||
|
||||
@@ -27,8 +27,8 @@ The table lists a selection; `r4d_rows.cpp` and `r4d.h` hold the full set.
|
||||
|
||||
| entry point | what it is |
|
||||
| --- | --- |
|
||||
| `attn_prefill_h256_gqa6_fp8kv` / `..._bf16kv` | paged causal attention, query-tiled; head_dim 256, 6 queries per KV head, fp8-e4m3 or bf16 KV cache |
|
||||
| `attn_decode_h256_gqa6_fp8kv` / `..._bf16kv` | the same geometry, split-KV, `q_len * gqa` ≤ 64 |
|
||||
| `attn_prefill_h256_gqa6_i8` / `..._bf16kv` | paged causal attention, query-tiled; head_dim 256, 6 queries per KV head, int8 or bf16 KV cache |
|
||||
| `attn_decode_h256_gqa6_i8` / `..._bf16kv` | the same geometry, split-KV, `q_len * gqa` ≤ 64 |
|
||||
| `attn_decode_h256_gqa6_scratch_bytes` / `attn_decode_h128_gqa4_scratch_bytes` | bytes of split-KV scratch a launch needs; ask before allocating, since the split count is chosen from the geometry |
|
||||
| `attn_vit_h72_bf16` | dense non-causal vision-encoder attention, head_dim 72 native, varlen over images |
|
||||
| `gdn_conv_prep_w4_h128_bf16` / `..._f32wgt` | the GDN prefill preamble in one kernel: causal conv (width 4, silu, with its state cache), q/k/v split, qk l2norm, gating and the per-chunk gate cumsum |
|
||||
@@ -54,12 +54,10 @@ The table lists a selection; `r4d_rows.cpp` and `r4d.h` hold the full set.
|
||||
| `gemm_mxfp4a8_nt_m64` | OCP-MXFP4 weight, fp8 activation, skinny |
|
||||
| `gemm_mxfp4a8_gemv` | the same operands for one to eight rows: the weight streamed straight to registers, no LDS staging; WMMA when K is a multiple of 128, `v_dot4` otherwise, chosen from K alone so a row's bits do not depend on M |
|
||||
| `gemm_mxfp4a8_gemv_wide` | its WMMA form at 9..64 rows: up to four 16-row tiles a wave over each weight word, two 16-column tiles a block on wide, deep weights |
|
||||
| `gemm_mxfp4a8_gated_gemv` | `gemm_nt_q_gated_mx`: the gemv WMMA form over a gate_up weight with `gated_quant_fp8`'s pass (or GeGLU's `gelu_mul` and `quant_act_fp8`) in its epilogue, M ≤ 8; the [M, 2n] product is never written |
|
||||
| `gemm_mxfp4a8_gated_gemv_wide` | the same fold at 9..64 rows over `gemv_wide`'s WMMA form: a block per gate/up tile pair, eight K waves each running both tiles, K ≥ 2688 |
|
||||
| `gemm_mxfp4a8_decode` | the same operands for the decode band (M ≤ 128): split-K across workgroups with a last-arriver reduction, the partial in the op's scratch |
|
||||
| `gemm_mxfp4a8_decode_shortk` | the decode kernel at 33..64 rows of a wide, short weight (N ≥ 8192, K ≤ 2560), above `gemm_mxfp4a8_gemv_wide`, which loses there |
|
||||
| `gemm_mxfp4a8_tiled` | the prefill sibling: the activation re-tiled into fragment order in the op's scratch and read straight into registers, the weight unpacked once per K slab for a 256-row block |
|
||||
| `attn_decode_h128_gqa4_fp8kv` / `..._bf16kv` | head_dim 128, 4 queries per KV head, sliding window: a block-diffusion drafter's geometry. Decode only; there is no prefill row at this geometry |
|
||||
| `attn_decode_h128_gqa4_i8` / `..._bf16kv` | head_dim 128, 4 queries per KV head, sliding window: a block-diffusion drafter's geometry. Decode only; there is no prefill row at this geometry |
|
||||
| `rowtopk_bf16` / `rowtopk_bf16_chunks` | exact per-row top-K over a bf16 matrix, two-stage |
|
||||
| `dflash_conv_t2_g16_bf16` | the drafter's causal conv, two taps, 16 groups |
|
||||
| `dflash_select_bf16` | the drafter's candidate selector: edge scores and the greedy path walk |
|
||||
@@ -207,7 +205,7 @@ everywhere but this corner, where it lost by 7..30 %; there this row wins:
|
||||
|
||||
Narrower N stays with `gemv_wide` (5120 × 2176 at 40 rows 39.2 µs against 52.8), as do Qwen3.8-27B's
|
||||
and TranslateGemma's two-rank shapes. It is a row rather than a rule inside the gemv entry so that
|
||||
the choice stays a lookup over constraints, and `--debug-selection` names it.
|
||||
the choice stays a lookup over constraints, and `debug-selection` names it.
|
||||
|
||||
**`gemm_mxfp4a8_decode`** (65..128 rows, and 9..64 where K is not a multiple of 128). Past 16 rows
|
||||
each wave loads its weight words straight into registers, as `gemv` does (a fragment-order word is
|
||||
@@ -229,33 +227,7 @@ rows their outputs differ from the decode row's in the last bf16 place on a few
|
||||
thousand (within the selftest's bound). A greedy text can therefore differ from one produced
|
||||
with the decode row at those rows. Within the family a row's bits do not depend on M, as above.
|
||||
|
||||
**`gemm_mxfp4a8_gated_gemv`** (`gemm_nt_q_gated_mx`, M ≤ 8, K a multiple of 128, N of 256, `act`
|
||||
`silu`, or `gelu_tanh` without `out_bf16`). The `gemv` WMMA form over a gate_up weight, a block per
|
||||
16-column tile pair of the gated output (eight K waves on the gate tile, eight on the up tile, in
|
||||
`gemv`'s K order), the bf16 product and row amaxes in the op's scratch; the last of a 128-column
|
||||
group's blocks to arrive (a counter keyed on the output) writes the group's codes and scales. Byte
|
||||
for byte `gemm_mxfp4a8_gemv` followed by `gated_quant_fp8`, or by `gelu_mul` and `quant_act_fp8`
|
||||
(`r4d_selftest`, M = 1..8, Qwen's and TranslateGemma's gate_up). It saves a launch: a dependent
|
||||
kernel costs 3.5-6.4 µs in a replayed graph on gfx1201 however little it does, and a Qwen3.8-27B
|
||||
TP2 decode step issues 631 a card. About +1.5 % at one to eight streams on Qwen3.8-27B, +4.5 % on
|
||||
TranslateGemma 27B at speculation 7.
|
||||
|
||||
**`gemm_mxfp4a8_gated_gemv_wide`** (`gemm_nt_q_gated_mx`, 9 ≤ M ≤ 64, K a multiple of 128 and at
|
||||
least 2688, N of 256, the same `act` rule). The fold over `gemv_wide`, the GEMM row of that band:
|
||||
`gemv_wide`'s kernel at two column tiles a block with the tiles taken as one gate tile and its up
|
||||
tile, so each of the eight K waves loads both tiles' weight words of its chunks and reads a chunk's
|
||||
activation fragments once for both (the narrow row's sixteen waves, eight a tile, would be
|
||||
`gemv_wide` at one tile a block, which at 32 and 64 rows took TranslateGemma's gate_up 39 % and 22 % longer).
|
||||
Up to four 16-row tiles; the waves' partials meet through LDS one half at a time (32 KB at 64 rows),
|
||||
then the narrow row's epilogue. Byte for byte `gemm_mxfp4a8_gemv_wide` followed by `gated_quant_fp8`,
|
||||
or by `gelu_mul` and `quant_act_fp8` (`r4d_selftest`, M = 9..64). No spills: 101 / 137 / 166 / 196
|
||||
VGPRs at one to four row tiles (per-(row, 128) activation scale), against `gemv_wide`'s 131 / 160 / 190
|
||||
at two to four tiles and two columns. K from 2688 keeps it out of `decode_shortk`'s corner, where the
|
||||
unfused GEMM sums 33..64 rows in the decode kernel's order. gemma3 declares the fold up to 64 rows
|
||||
where K reaches it, which at two to eight TranslateGemma streams with speculation 7 is 2-5 % more
|
||||
throughput than the unfused three past 8 rows.
|
||||
|
||||
**Tunables.** `gemv`, `gemv_wide` and `gated_gemv` have none, so a `RADIANCE_TUNE` pin on
|
||||
**Tunables.** `gemv` and `gemv_wide` have none, so a `RADIANCE_TUNE` pin on
|
||||
`gemm_nt_q` passes them by. `decode_shortk` shares the decode row's axes (`ks`, `bk`, `nt`; 0 the
|
||||
rule), so a pin of those reaches both. A pin applies to every row serving the op, and an axis a
|
||||
serving row lacks stops startup by name.
|
||||
@@ -282,15 +254,15 @@ rank's weight at TP2 on an R9700, the row alone, clocks warmed; over 20 shapes,
|
||||
|
||||
`tn` (0 the rule, 2, 4) pins the TN choice through `RADIANCE_TUNE`.
|
||||
|
||||
## The fp8 and int8 heads past 64 rows
|
||||
## The int8 head past 64 rows
|
||||
|
||||
**`logits_gemm_fp8`, `logits_gemm_i8`** took passes of 64 rows and read the head again for each.
|
||||
**`logits_gemm_i8`** took passes of 64 rows and read the head again for each.
|
||||
With `MH` = 2 a workgroup's eight waves split into two M halves of four 16-row tiles over 64 weight
|
||||
rows that share one staged tile, so a pass takes 128 rows and reads the head once. Qwen3.8's
|
||||
per-rank head (124160 × 5120) at 128 rows 3059 → 1984 µs, TranslateGemma's (131072 × 5376) 3242 →
|
||||
2036; 65..128 rows -33..-39 %, 160..256 -26..-37 %, 64 and fewer unchanged; about 1 ms a step at 16
|
||||
streams with speculation. Same scale blocks, WMMAs and K order per output: the same bytes (the
|
||||
numeric cases at 65..150 rows for the fp8 head, 100 for the int8 head).
|
||||
numeric cases at 100 rows).
|
||||
|
||||
## Notes on the kernels
|
||||
|
||||
|
||||
Reference in new issue
Block a user