ops: attn_dense at head_dim 80 and grid_embed_cpe, for the C-RADIO tower

attn_dense at head_dim 80 without GQA (C-RADIO's ViT heads), and grid_embed_cpe, RADIO's cropped
position embedding: the table resampled half-pixel bilinear onto a square and cropped to the
grid, with the class and register rows ahead of each segment. libref, libavx and libr4d; ref_test,
avx_check_hand and selftest cases; docs/OPS.md.
This commit is contained in:
keptn42 committed 2026-11-04 22:08:53 +01:00
1 parent 2420b2b383
commit b466c91b26
17 files changed
+426 -2

No files matched your search

+12
View File
@@ -544,6 +544,18 @@ void shape_cases(std::vector<Hand>& hs) {
.pi("M", 6).pi("n", N).pi("side", 4).ps("dtype", "f32");
hs.push_back(std::move(ga));
/* RADIO's cropped resample: two prefix rows (row -1, the column naming which), three of a
* 3 x 5 grid upsampling the 4 x 4 table and one of a 2 x 2 grid shrinking it. */
static const int32_t kCpeCrd[4][6] = { { -1, -1, 0, 2, 1, 0 }, { 0, 2, 0, 4, 3, 1 },
{ 3, 3, 3, 3, 3, 2 }, { 5, 5, 5, 5, 5, 2 } };
Hand gc("prefix rows and a 4 x 4 table onto 3 x 5 and 2 x 2 grids", "grid_embed_cpe", 1e-6);
gc.dense(RAD_F32, { 6, N }, hfill(61), true)
.dense(RAD_F32, { 16, N }, hfill(62))
.dense(RAD_I32, { 4, 6 }, [](int64_t i) { return (float)kCpeCrd[i / 6][i % 6]; })
.dense(RAD_F32, { 3, N }, hfill(63))
.pi("M", 6).pi("n", N).pi("side", 4).pi("n_prefix", 3).ps("dtype", "f32");
hs.push_back(std::move(gc));
/* LiLiCorr's candidates over two ranks' sample_logprobs rows: a merge that interleaves the
* ranks, an equal value on both (the lower id first), a rank with an unfilled slot. Rows
* of (max, sum, 4 (id, logit) pairs descending) a rank, k = 4, steps 3, n = 24. */