Archived
libr3d: register the fused gdn_conv_recurrent_update row
The kernel and launcher (libhalo's, r3dh_gdn_recurrent_update.hip) have been in the tree since 1.16.0, but no row referenced them, so the op always landed on libavx's CPU row. Register them: - the op's schema (12 params, 18 operands: the convolution's inputs, then the recurrence's minus q, k and v, which the fused kernel never materialises), identical to libavx's and libref's; - the constraint set: q_len >= 1, head_k 128, head_v 128, conv width 4; - the row at R3D_PRIO_ONLY, NOTUNE (one kernel configuration), no layout hooks; - the selftest case (hand-built, as the sibling GDN rows): T=4, Hg=2, H=4, K=V=128, window 4, state f32; o_q and o_scale absent; - the README row, the table count (111 rows over 72 schemas) and the decode-path prose. rad-schemas over the four libs: 244 shared ops, 0 disagree (the new schema matches the canonical registries). gfx1102 (RX 7600): r3d_selftest 118 rows / 0 failed, the new row runs with 8 output planes finite; ref_test 153,146 checks / 294 cases / 0 failures.
This commit is contained in:
1 parent
87c604370d
commit
036bd8fec0
4 files changed
+167
-2
No files matched your search
+4
-2
@@ -65,10 +65,10 @@ The table groups the rows by family; `r3d_rows.cpp` and `r3d.h` hold the full se
|
||||
| `quant` | `quant_act_fp8_bf16`, `quant_act_i8_bf16`, `quant_act_i8g_bf16`, `had_quant_act_{i8,fp8}_bf16` and `had_quant_act_i8g_bf16` (the same with a block Walsh-Hadamard rotation), `gated_had_quant_{i8,i8g,fp8}_bf16`, `gelu_mul_quant_i8_bf16`, `quant_cols_fp8_bf16`, `rmsnorm_quant_{fp8,i8}_bf16` (norm and quantiser in one pass), `gated_quant_fp8_bf16`, `dequant_fp8`, `dequant_e5m2`, `dequant_i8` |
|
||||
| `sample` | pre-filters `sample_{penalties,dry,ngram_ban,mask,logprobs}_f32`; spine `sample_{argmax,temp,topk,pick,topp,minp,typical,xtc}_f32` — f32 logits in and out, the draw the reference's in its order, the top-R scan single-pass (the plane read once) |
|
||||
| `moe` | `expert_scale_bf16` (the renormalised top-k weight times the expert's per-expert scale, in place), `moe_router_topk_bf16` (softmax top-k, renormalised if `norm`), `moe_router_topk_scatter` (the top-k and the counting sort as one op), `moe_router_sigmoid_topk` (the GLM-style router: sigmoid scores, selection on scores + bias, the kept weights scaled by `route_scale`), `moe_scatter_small` (the routed slots' stable counting sort: one workgroup up to 1024 slots, three passes over 256-slot tiles above), `moe_gather` (fold the expert outputs back to the token, with the optional shared arm), `moe_gemm_q_e4m3` (grouped E4M3 GEMM; the `impl` axis: 16x16 table decode, 16x16 ALU decode, 16x128 block with the F32 scales folded), `moe_gemm_bf16` (unquantised experts, wave matrix), `moe_gemm_mxfp4a8` (canonical MXFP4 experts), `moe_gemm_w4a8` (int8 activation, packed two's-complement int4 experts: the i32 wave matrix, an f32 a-scale and a bf16 w-scale per (row, 128 of K), token- and sorted-order `a`), `moe_gemm_w4a4` (int4 activation, packed two's-complement int4 experts: both widen to int8 on the i32 wave matrix, an f32 a-scale and a bf16 w-scale per (row, 128 of K), token- and sorted-order `a`), `row_topk_{bf16,f32}` (the reference files the op under `moe`, so the row does too) |
|
||||
| `gdn` | `gdn_kkt_solve_c64` (`A = (I + strict_lower(diag(beta) K K^T e^{g_i-g_j}))^-1` per 64-chunk; libhalo's kernel), `gdn_chunk_scan_k128_v128_c64` (the chunked scan: WY recompute, state recurrence and output in one kernel; libhalo's), `gdn_gated_rmsnorm_h128`, `gdn_gated_norm_had_quant_i8` (the gated norm fused with the rotation and quantiser), `gdn_conv_prep_w4_h128` (causal conv, split, l2norm, gating and the per-chunk gate cumsum in one prefill kernel), `gdn_conv_update_w4_h128` (the same convolution at decode over a rolling conv-state buffer), `gdn_recurrent_update_k128_v128` (the decode-time recurrent state update, per_candidate or anchor; libhalo's) |
|
||||
| `gdn` | `gdn_kkt_solve_c64` (`A = (I + strict_lower(diag(beta) K K^T e^{g_i-g_j}))^-1` per 64-chunk; libhalo's kernel), `gdn_chunk_scan_k128_v128_c64` (the chunked scan: WY recompute, state recurrence and output in one kernel; libhalo's), `gdn_gated_rmsnorm_h128`, `gdn_gated_norm_had_quant_i8` (the gated norm fused with the rotation and quantiser), `gdn_conv_prep_w4_h128` (causal conv, split, l2norm, gating and the per-chunk gate cumsum in one prefill kernel), `gdn_conv_update_w4_h128` (the same convolution at decode over a rolling conv-state buffer), `gdn_recurrent_update_k128_v128` (the decode-time recurrent state update, per_candidate or anchor; libhalo's), `gdn_conv_recurrent_update_k128_v128` (the convolution and the recurrent update as one decode kernel, q/k/v never materialised; libhalo's) |
|
||||
| `draft` | `dflash_select_bf16`: the drafter's accept step, a walk over the draft block's candidate lattice |
|
||||
|
||||
The table holds 110 rows over 71 schemas; `r3d_selftest` checks every schema slot for slot against
|
||||
The table holds 111 rows over 72 schemas; `r3d_selftest` checks every schema slot for slot against
|
||||
the `libref.so` beside the plugin. Fourteen rows carry tune axes (see
|
||||
[Tunable params](#tunable-params)); the rest are single-implementation.
|
||||
|
||||
@@ -430,6 +430,8 @@ the qk l2norm, the gating and the per-chunk gate cumsum in one prefill kernel, a
|
||||
`gdn_conv_update_w4_h128` / `gdn_recurrent_update_k128_v128` are the same convolution and the
|
||||
recurrent state update at decode, over a rolling conv-state buffer and a paged f32 or f16 state
|
||||
cache, per candidate token or as one committed state with a replay scratch slot (`anchor`).
|
||||
`gdn_conv_recurrent_update_k128_v128` is the two as one kernel: the fold holds q, k and v in
|
||||
registers, so they are never written and the step is one launch instead of two.
|
||||
|
||||
The QSA rows are the indexer's tail: `kv_len_trim_i32` trims each sequence's context lengths by
|
||||
`trim` (the slice's own last row), and `qsa_tail_store_bf16` writes the QSA indexer's tail into a
|
||||
|
||||
Reference in new issue
Block a user