radiance 1.8.0

- video: MiniMax-H3 and FastVideo's FastH3 8-Step V2, a video with its stereo soundtrack from text
  on OpenAI's /v1/videos, block fp8 on two cards
- music: MiniMax-Music3, songs from lyrics and a description on /v1/audio/speech
- speech: Breeze-TTS-2 on /v1/audio/speech and vLLM-Omni's realtime WebSocket
- runtime LoRA adapters beside the base model, picked per request by `model` (baKon, #105)
- several agent streams keep their cached history: --checkpoint-slots auto, the new default, sizes
  the snapshot store by --max-num-seqs (#108)
- the Swift 1.5 27B W4 releases convert and serve: compressed-tensors AWQ and GPTQ int4, AutoRound,
  ModelOpt NVFP4 (#110)
- the image's host tests pass where perf_event_open is refused, as in BuildKit's sandbox (#106)
- plugin ABI 21: out-of-tree plugins must be rebuilt
This commit is contained in:
Deadcode committed 2026-10-18 11:38:37 +02:00
1 parent 91127395ee
commit 7a7707a955
179 files changed
+37542 -1892

No files matched your search

+234 -9
View File
@@ -43,6 +43,8 @@ std::vector<Case> build_cases() {
add("layernorm", { HI("M", 5), HI("n", 645), HF("eps", 1e-5), HS("dtype", dt) },
EB(5, 645, w, 2));
add("add", { HI("M", 9), HI("n", 645), HS("dtype", dt) }, EB(9, 645, w, 3));
add("add", { HI("M", 9), HI("n", 645), HS("dtype", dt), HF("div", 3.0) },
EB(9, 645, w, 3));
add("mul", { HI("M", 9), HI("n", 640), HS("dtype", dt) }, EB(9, 640, w, 3));
add("silu_mul", { HI("M", 6), HI("n", 645), HS("dtype", dt) }, EB(6, 645, w, 3));
add("gelu_mul", { HI("M", 6), HI("n", 645), HS("dtype", dt) }, EB(6, 645, w, 3));
@@ -132,6 +134,10 @@ std::vector<Case> build_cases() {
}
add("ngram_ids", { HI("M", 9), HI("heads", 3), HI("ngram", 4), HI("eos", 2) });
/* One scale per column over the rows: no group. */
add("quant_cols_fp8", { HI("M", 5), HI("n", 256), HS("dtype", "bf16") }, EB(5, 256, 2, 1.5));
add("quant_cols_fp8", { HI("M", 7), HI("n", 96), HS("dtype", "f32") }, EB(7, 96, 4, 1.25));
/* Quantisation. 128 is the real grid; 64 tests a second block edge. n = 256 is divisible by
* both, which the had_* forms require (a rotation block may not straddle the row end). */
for (int group : { 64, 128 }) {
@@ -254,13 +260,12 @@ std::vector<Case> build_cases() {
2.0 * M * 192 * 256);
add("gemm_nt_q_gated", { HI("M", 7), HI("N", 512), HI("K", 256), HI("group", 128),
HS("dtype", "fp8a8"), HS("act", "silu") }, 0, 2.0 * 7 * 512 * 256);
/* Runtime LoRA. libref's description draws `slot` in [0, S], so S itself -- a base row --
* comes up in every case of more than one row and the comparison covers rows neither op may
* touch (a single row draws an adapter, or the case would compare nothing). M = 1 takes the
* shrink's team-over-columns arm and 9 and 65 its team-over-rows one; K = 1000
* leaves a partial scale group and a vector tail at every level; R = 48 is not a power of two.
* The dtype is `a`'s for shrink -- the coded ones with their scale stream -- and `y`'s for
* expand. */
/* Runtime LoRA. libref's description draws `slot` in [0, S], so S itself, a base row, comes
* up in every case of more than one row (a single row draws an adapter, or the case would
* compare nothing). M = 1 takes the shrink's team-over-columns arm and 9 and 65 its
* team-over-rows one; K = 1000 leaves a partial scale group and a vector tail at every level;
* R = 48 is not a power of two. The dtype is `a`'s for shrink (the coded ones with their scale
* stream) and `y`'s for expand. */
for (int M : { 1, 9, 65 }) {
for (const char* dt : { "f32", "bf16", "f16", "fp8_e4m3", "i8" })
for (int K : { 256, 1000 })
@@ -300,6 +305,12 @@ std::vector<Case> build_cases() {
add("attn_dense", { HI("M", 24), HI("head_dim", 64), HI("gqa", 2),
HI("causal", causal), HS("dtype", dt), HF("scale", 0.125),
HI("max_seqlen", 24), HI("window", 5) });
/* A non-causal window reaching further right than left (a sliding encoder layer that sees 4
* keys behind and 7 ahead). */
for (const char* dt : { "f32", "bf16" })
add("attn_dense", { HI("M", 24), HI("head_dim", 64), HI("gqa", 2), HI("causal", 0),
HS("dtype", dt), HF("scale", 0.125), HI("max_seqlen", 24),
HI("window", 5), HI("window_right", 8) });
/* Blocks: each segment cut into blocks of 7 rows that attend within themselves (a chunked
* encoder's windows), the last block of a segment short. */
for (const char* dt : { "f32", "bf16" })
@@ -436,6 +447,13 @@ std::vector<Case> build_cases() {
}
add("rope_table", { HI("M", 12), HI("rot", 32), HF("theta", 10000.0), HF("scale", 1.0),
HS("dtype", "f32"), HI("head_dim", 64), HS("ladder", "head") });
/* Llama 3's frequency scaling at a depth decoder's settings (theta 5e5, factor 32, original
* length 16): kept, blended and divided frequencies all present. */
for (const char* dt : { "f32", "bf16" })
add("rope", { HI("M", 12), HI("head_dim", 128), HI("n_head", 4), HI("n_head_kv", 2),
HF("theta", 500000.0), HF("scale", 1.0), HS("mode", "neox"),
HF("llama3_factor", 32.0), HF("llama3_low", 0.001953125),
HF("llama3_high", 0.0078125), HF("llama3_orig", 16.0), HS("dtype", dt) });
/* A rotary wider than 1024 (libref takes up to 2048, i.e. 1024 frequencies), plain and with
* contiguous sections, and QSA's key at the same width. */
add("rope", { HI("M", 3), HI("head_dim", 1280), HI("n_head", 1), HI("n_head_kv", 1),
@@ -456,6 +474,18 @@ std::vector<Case> build_cases() {
add("rope", { HI("M", 12), HI("head_dim", 72), HI("n_head", 4), HI("n_head_kv", 4),
HF("theta", 10000.0), HF("scale", 1.0), HS("mode", "axial"),
HI("rotary_dim", 72), HS("sections", "18 18"), HS("dtype", dt) });
/* MiniMax-H3's: the DiT's 3-axis rotary over 96 of 128 channels, the video decoder's
* over 48 of 64; and the norm alone (rotary_dim 0, no positions). f32 positions and
* absent gains are avx_check_hand.cpp's. */
add("qk_norm_rope", { HI("M", 12), HI("head_dim", 128), HI("n_head", 2), HI("n_head_kv", 2),
HF("theta", 10000.0), HF("eps", 1e-5), HS("mode", "axial"),
HI("rotary_dim", 96), HS("sections", "16 16 16"), HS("dtype", dt) });
add("qk_norm_rope", { HI("M", 12), HI("head_dim", 64), HI("n_head", 4), HI("n_head_kv", 4),
HF("theta", 100.0), HF("eps", 1e-5), HS("mode", "axial"),
HI("rotary_dim", 48), HS("sections", "8 8 8"), HS("dtype", dt) });
add("qk_norm_rope", { HI("M", 12), HI("head_dim", 64), HI("n_head", 4), HI("n_head_kv", 2),
HF("theta", 10000.0), HF("eps", 1e-6), HI("rotary_dim", 0),
HI("v_norm", 1), HS("dtype", dt) });
add("grid_embed", { HI("M", 20), HI("n", 72), HI("side", 6), HS("dtype", dt) });
/* Two table sides. A drawn grid never exceeds the table, so upscaling is covered by
* avx_check's hand-built case. */
@@ -617,6 +647,8 @@ std::vector<Case> build_cases() {
EB(7, 645, dt[0] == 'f' ? 4 : 2, 2));
add("gate_add", { HI("M", 7), HI("n", 645), HS("dtype", dt) },
EB(7, 645, dt[0] == 'f' ? 4 : 2, 3));
add("gate_add", { HI("M", 7), HI("n", 645), HS("dtype", dt), HS("act", "none") },
EB(7, 645, dt[0] == 'f' ? 4 : 2, 3));
for (int gated : { 1, 0 })
add("ln_mod_quant_fp8", { HI("M", 5), HI("n", 256), HF("eps", 1e-6), HI("group", 128),
HI("gated", gated), HS("dtype", dt) });
@@ -631,8 +663,10 @@ std::vector<Case> build_cases() {
HS("dtype", dt) });
add("flow_euler", { HI("M", 24), HI("n", 64), HI("stride", 16), HS("dtype", dt) });
for (const char* mode : { "fma", "inv" })
add("chan_affine", { HI("M", 9), HI("n", 67), HS("mul", kMul.c_str()),
HS("add", kAdd.c_str()), HS("mode", mode), HS("dtype", dt) });
for (int round : { 1, 0 })
add("chan_affine", { HI("M", 9), HI("n", 67), HS("mul", kMul.c_str()),
HS("add", kAdd.c_str()), HS("mode", mode), HS("dtype", dt),
HI("round", round) });
for (const char* act : { "silu", "none" })
add("l2norm_chan", { HI("M", 9), HI("n", 645), HS("act", act), HS("dtype", dt) });
add("to_rgba8", { HI("M", 9), HI("n", 4), HS("dtype", dt) });
@@ -671,6 +705,187 @@ std::vector<Case> build_cases() {
HI("n_head", 4), HS("qk", qk) });
}
/* ================================================================== video generation
*
* MiniMax-H3's DiT row ops at an odd width, both gated forms; its sampler step over an f32
* state; the decoder's patch unfold, tiles, stitch and positions over the cube geometry
* libref describes (one value in every `geom` entry). Uneven grids, a chunk between two
* others and views of wider planes are avx_check_hand.cpp's. */
static const std::string kStd24 = [] {
std::string s;
for (int i = 0; i < 24; ++i) s += (i ? " " : "") + std::to_string(0.4 + 0.07 * i);
return s;
}();
static const std::string kMean24 = [] {
std::string s;
for (int i = 0; i < 24; ++i) s += (i ? " " : "") + std::to_string(0.031 * i - 0.37);
return s;
}();
for (const char* dt : { "f32", "bf16" }) {
for (int gated : { 1, 0 }) {
add("rms_mod", { HI("M", 7), HI("n", 645), HF("eps", 1e-5), HI("gated", gated),
HS("dtype", dt) });
add("rms_mod_quant_fp8", { HI("M", 5), HI("n", 256), HF("eps", 1e-5), HI("group", 128),
HI("gated", gated), HS("dtype", dt) });
}
add("flow_x0_step", { HI("M", 9), HI("n", 645), HS("dtype", dt) });
for (int pt : { 1, 4 })
add("patch_unfold", { HI("M", 8 * 4 * pt), HI("C", 24), HI("pt", pt), HI("ph", 2),
HI("pw", 2), HS("mul", kStd24.c_str()),
HS("add", kMean24.c_str()), HS("dtype", dt) });
/* Three frames of 3 x 3: two tiles of 2 a side overlapping by 1, two register rows and
* one zero row a tile. */
add("vtile_gather", { HI("M", 60), HI("n", 37), HI("tile", 2), HI("overlap", 1),
HI("frames", 3), HI("period", 15), HI("n_reg", 2), HS("dtype", dt) });
}
/* A 3 x 3 latent of 3 frames, 2 x 2 tiles a row apart past their voxels, decoded at scale 2
* and two clip frames a latent one: the kept frames and the overlap of a video's only
* chunk. */
add("vtile_stitch", { HI("M", 108), HI("tile", 2), HI("overlap", 1), HI("scale", 2),
HI("pt", 2), HI("skip", 1), HI("keep", 2), HI("blend", 1),
HI("period", 13), HS("mean", "0.485 0.456 0.406"),
HS("std", "0.229 0.224 0.225") });
add("grid_pos3", { HI("M", 40), HI("T", 2), HI("H", 3), HI("W", 4), HI("period", 27),
HF("scale", 6.283185307179586) });
/* Video sparse attention over the cubes libref describes: a 3 x 3 x 3 grid in boxes of 2
* after two dense segments of as many rows (P 8, V 8; sparsity 0.8 keeps 2), with and without
* the coarse operands; and MiniMax-H3's boxes of 4 at patch 2 over a 10 x 5 x 5 grid after
* one segment (P 4, V 12). attn_vsa at k = 1, the one selection a description draws; the
* others are avx_check_hand.cpp's. `n_head`, `coarse` and `dtype` are the description's. */
for (const char* dt : { "f32", "bf16" }) {
for (int coarse : { 1, 0 }) {
add("vsa_select", { HI("M", 81), HI("head_dim", 64), HI("tile_t", 2), HI("tile_h", 2),
HI("tile_w", 2), HI("patch", 1), HF("sparsity", 0.8),
HI("n_head", 2), HI("coarse", coarse), HS("dtype", dt) });
add("attn_vsa", { HI("M", 81), HI("head_dim", 64), HI("tile_t", 2), HI("tile_h", 2),
HI("tile_w", 2), HI("patch", 1), HF("sparsity", 0.9),
HI("n_head", 2), HI("coarse", coarse), HS("dtype", dt) });
}
for (double sp : { 0.5, 0.0 })
add("vsa_select", { HI("M", 500), HI("head_dim", 128), HI("tile_t", 4), HI("tile_h", 4),
HI("tile_w", 4), HI("patch", 2), HF("sparsity", sp),
HI("n_head", 2), HS("dtype", dt) });
add("attn_vsa", { HI("M", 500), HI("head_dim", 128), HI("tile_t", 4), HI("tile_h", 4),
HI("tile_w", 4), HI("patch", 2), HF("sparsity", 0.95), HI("n_head", 2),
HS("dtype", dt) });
}
/* ================================================================== audio generation
*
* The vocoder's convolutions over two sequences (a stereo latent's halves as libref describes
* them), odd channel counts, the codec's kernel widths and dilations and every stride an
* upsampling block uses; the sampler at both branch counts, with and without the conditional
* candidate cut; the window ops over three and four entries, so the drawn flags reach FIRST,
* JOIN and LAST in several combinations. The first case of each op stays inside libref's four
* lanes at twice its rows, which the zero-row check describes. */
for (const char* dt : { "f32", "bf16", "f16" }) {
for (int dil : { 1, 3 })
for (const char* act : { "none", "tanh" })
add("conv1d", { HI("M", 24), HI("cin", 20), HI("cout", 13), HI("k", 7),
HI("dil", dil), HS("act", act), HS("dtype", dt) });
add("conv1d", { HI("M", 24), HI("cin", 20), HI("cout", 13), HI("k", 3), HI("dil", 9),
HS("dtype", dt) });
add("conv1d", { HI("M", 9), HI("cin", 33), HI("cout", 17), HI("k", 1), HI("dil", 1),
HS("dtype", dt) });
/* Causal: all of the padding on the left (odd k; an even k is a hand-built case, which
* libref's description does not draw). */
for (int dil : { 1, 3 })
add("conv1d", { HI("M", 24), HI("cin", 20), HI("cout", 13), HI("k", 7),
HI("dil", dil), HI("causal", 1), HS("dtype", dt) });
for (int s : { 2, 4, 8 })
add("conv_t1d", { HI("M", 12), HI("cin", 20), HI("cout", 13), HI("stride", s),
HS("dtype", dt) });
/* The causal transposed form, a codec's upsampler: no padding, a sequence's first
* output rows reading its first input row alone. */
for (int s : { 2, 4, 8 })
add("conv_t1d", { HI("M", 12), HI("cin", 20), HI("cout", 13), HI("stride", s),
HI("pad", 0), HS("dtype", dt) });
/* A kernel of one stride (one tap a phase), without padding and with some. An odd stride
* is a hand-built case, which libref's description does not draw. */
add("conv_t1d", { HI("M", 12), HI("cin", 20), HI("cout", 13), HI("stride", 2),
HI("k", 2), HS("dtype", dt) });
add("conv_t1d", { HI("M", 12), HI("cin", 20), HI("cout", 13), HI("stride", 4),
HI("k", 4), HI("pad", 1), HS("dtype", dt) });
/* BigVGAN's upsamplers: kernel 9 at stride 5 (three taps in some phases, two in
* others), and a kernel of six strides whose padding passes a stride. */
add("conv_t1d", { HI("M", 12), HI("cin", 20), HI("cout", 13), HI("stride", 5),
HI("k", 9), HS("dtype", dt) });
add("conv_t1d", { HI("M", 12), HI("cin", 20), HI("cout", 13), HI("stride", 2),
HI("k", 12), HS("dtype", dt) });
add("conv1d", { HI("M", 24), HI("cin", 20), HI("cout", 13), HI("k", 7), HI("dil", 1),
HS("act", "clamp"), HS("dtype", dt) });
add("snake", { HI("M", 6), HI("n", 645), HS("dtype", dt) });
add("snake", { HI("M", 6), HI("n", 645), HI("log", 1), HS("dtype", dt) });
/* The alias-free SnakeBeta at BigVGAN's 12-tap filters over two sequences, and an odd
* filter at ratio 3. */
for (int lg : { 0, 1 })
add("snake_aa", { HI("M", 24), HI("n", 37), HI("ratio", 2), HI("k", 12),
HI("log", lg), HS("dtype", dt) });
add("snake_aa", { HI("M", 10), HI("n", 645), HI("ratio", 3), HI("k", 7), HS("dtype", dt) });
add("resample_nearest", { HI("M", 9), HI("n", 645), HS("dtype", dt) });
add("resample_nearest", { HI("M", 4), HI("n", 64), HS("dtype", dt) });
add("chan_split", { HI("M", 9), HI("n", 645), HI("parts", 2), HS("dtype", dt) });
add("chan_split", { HI("M", 5), HI("n", 64), HI("parts", 3), HS("dtype", dt) });
add("interleave2", { HI("M", 645), HS("dtype", dt) });
}
for (int rep : { 1, 2 })
for (int ck : { 0, 40 })
add("cfg_topk_sample", { HI("M", 4 * rep), HI("n_vocab", 645), HI("k", 50),
HI("rep", rep), HI("cond_k", ck), HF("cfg", 1.5),
HI("stream", 3), HS("dtype", "f32") });
add("cfg_topk_sample", { HI("M", 6), HI("n_vocab", 645), HI("k", 645), HI("rep", 2),
HF("cfg", 1.7), HF("temp", 0.8), HI("stream", 0),
HS("dtype", "f32") });
/* A speech model's backbone pick: reserved ids suppressed (the vocabulary's last class stays a
* candidate), a temperature, the penalty idle without a history. */
for (int rep : { 1, 2 })
add("cfg_topk_sample", { HI("M", 2 * rep), HI("n_vocab", 645), HI("k", 50),
HI("rep", rep), HF("cfg", 4.0), HF("temp", 0.9), HI("stream", 0),
HI("sup_lo", 600), HI("sup_hi", 644), HF("penalty", 1.1),
HS("dtype", "f32") });
for (const char* dt : { "f32", "bf16" }) {
for (double sc : { 1.0, 0.7 })
add("rvq_embed", { HI("M", 7), HI("n_embd", 645), HI("n_codes", 8), HI("vocab", 64),
HI("off0", 5), HF("scale", sc), HS("dtype", dt) });
/* One rounding of the whole sum: sixteen codebooks, as a speech model's frame embedding. */
for (double sc : { 1.0, 0.7 })
add("rvq_embed", { HI("M", 7), HI("n_embd", 645), HI("n_codes", 16), HI("vocab", 64),
HI("off0", 0), HF("scale", sc), HI("round", 1), HS("dtype", dt) });
add("frame_mix_store", { HI("M", 2), HI("n_embd", 645), HI("L", 9), HI("stride", 5),
HI("rep", 2), HS("dtype", dt) });
add("frame_mix_store", { HI("M", 4), HI("n_embd", 64), HI("L", 3), HI("stride", 2),
HI("rep", 1), HS("dtype", dt) });
for (int round : { 1, 0 })
add("fourier_embed", { HI("M", 5), HI("n", 256), HI("round", round),
HS("dtype", dt) });
add("win_input", { HI("M", 24), HI("n_lat", 37), HI("n_zero", 0), HI("n_cond", 64),
HI("stride", 12), HS("dtype", dt) });
add("win_input", { HI("M", 36), HI("n_lat", 64), HI("n_zero", 3), HI("n_cond", 37),
HI("stride", 16), HS("dtype", dt) });
for (int ov : { 6, 16 })
add("win_prep", { HI("M", 32), HI("n", 64), HI("stride", 16), HI("ov", ov),
HS("dtype", dt) });
add("win_prep", { HI("M", 64), HI("n", 37), HI("stride", 16), HI("ov", 4),
HS("dtype", dt) });
add("win_finish", { HI("M", 32), HI("n", 64), HI("n_cond", 37), HI("stride", 16),
HI("ov", 6), HS("dtype", dt) });
add("win_finish", { HI("M", 64), HI("n", 64), HI("n_cond", 37), HI("stride", 16),
HI("ov", 4), HS("dtype", dt) });
add("win_finish", { HI("M", 36), HI("n", 37), HI("n_cond", 64), HI("stride", 12),
HI("ov", 5), HS("dtype", dt) });
}
add("end_status", { HI("M", 2), HI("end", 5), HI("rep", 2) });
add("end_status", { HI("M", 4), HI("end", 3), HI("rep", 1) });
add("frame_store", { HI("M", 2), HI("n_codes", 16), HI("stride", 9), HI("rep", 2),
HI("skip", 0) });
add("frame_store", { HI("M", 4), HI("n_codes", 3), HI("stride", 5), HI("rep", 1),
HI("skip", 1) });
add("iota", { HI("M", 645), HI("start", 3), HI("step", 2) });
add("iota", { HI("M", 7), HI("start", -5), HI("step", 1) });
add("cu_repeat", { HI("M", 5), HI("mult", 3) });
add("cu_repeat", { HI("M", 9), HI("mult", 1) });
/* ================================================================== speed-only, at model size
*
* Timed by rad-avx-bench, skipped by rad-avx-check. The cases above are sized to break kernels;
@@ -880,6 +1095,16 @@ std::vector<Case> build_cases() {
2.0 * 1024 * 12288 * 4096);
speed("gemm_nt_q", { HI("M", 1024), HI("N", 12288), HI("K", 4096), HI("group", 128),
HS("dtype", "fp8a8") }, 0, 2.0 * 1024 * 12288 * 4096);
/* The music vocoder's third stage (384 channels; a window's two streams there are 88192 rows,
* timed over 8192): a residual unit's dilated 7-tap convolution and its 1 x 1, the stage's
* stride-4 upsampling from 768 channels, and the snake before each. */
speed("conv1d", { HI("M", 8192), HI("cin", 384), HI("cout", 384), HI("k", 7), HI("dil", 3),
HS("dtype", "bf16") }, 0, 2.0 * 8192 * 384 * 384 * 7);
speed("conv1d", { HI("M", 8192), HI("cin", 384), HI("cout", 384), HI("k", 1), HI("dil", 1),
HS("dtype", "bf16") }, 0, 2.0 * 8192 * 384 * 384);
speed("conv_t1d", { HI("M", 2048), HI("cin", 768), HI("cout", 384), HI("stride", 4),
HS("dtype", "bf16") }, 0, 2.0 * 8192 * 384 * 2 * 768);
speed("snake", { HI("M", 8192), HI("n", 384), HS("dtype", "bf16") }, 8192.0 * 384 * 2 * 2, 0);
return c;
}