libhalo: windowed attention at head_dim 128 with 4 queries per kv head, and the row-form names of rope and rmsnorm

What LFM3 needs on gfx1151 beyond the rows libhalo has. The window kernel is
instantiated at (128, 4) as in libr4d: the decode leg keeps q_len <= 16 and
every longer q_len, windowed or not, lands on the new pair. rope_rows and
rmsnorm_rows are registered under their row-form names and launched as rope
and rmsnorm, as libavx and libref register them, so a plugin written for
libr4d's row forms resolves on this part instead of falling to the host.

Emulator cases as libr4d's (split verify, ragged window, fp8, non-causal with
a missing block, WMMA prefill with and without the window) and selftest
launches.
This commit is contained in:
DokterSmol authored and StillDeadcode committed 2026-11-17 18:12:32 +01:00
1 parent 21c4544b61
commit 1f00224501
7 files changed
+74 -8

No files matched your search

+11
View File
@@ -30914,6 +30914,17 @@ static void device_phase(const Plugin& pl) {
attn_numeric_case(pl, "attn_window_h512_gqa8_bf16kv", 512, 8, 32, "bf16", 0);
attn_numeric_case(pl, "attn_window_h512_gqa8_fp8kv", 512, 8, 1, "fp8_e4m3", 0);
attn_numeric_case(pl, "attn_window_h512_gqa8_bf16kv", 512, 8, 1, "bf16", 0);
/* LFM3: 16 query heads over 4 kv heads at head_dim 128, full and with its 256-token window; the
* rows take what the decode leg's band (q_len <= 16) leaves. Launches, then numeric checks, the
* last two with a context past the window. */
attn_case(pl, "attn_window_h128_gqa4_fp8kv", 128, 4, 32, "fp8_e4m3", 1);
attn_case(pl, "attn_window_h128_gqa4_bf16kv", 128, 4, 32, "bf16", 1);
attn_case(pl, "attn_window_h128_gqa4_bf16kv", 128, 4, 32, "bf16", 1, 256);
attn_numeric_case(pl, "attn_window_h128_gqa4_fp8kv", 128, 4, 32, "fp8_e4m3", 0);
attn_numeric_case(pl, "attn_window_h128_gqa4_bf16kv", 128, 4, 32, "bf16", 0);
attn_numeric_case(pl, "attn_window_h128_gqa4_bf16kv", 128, 4, 17, "bf16", 0, 300);
attn_numeric_case(pl, "attn_window_h128_gqa4_bf16kv", 128, 4, 64, "bf16", 256, 700);
attn_numeric_case(pl, "attn_window_h128_gqa4_fp8kv", 128, 4, 64, "fp8_e4m3", 256, 700);
/* The h256/gqa2 prefill numeric check with ctx 2048 > window 1024, so the window applies: for
* query row 0, pos = 2048-64 = 1984 and the visible keys are [961..1984], so wlo0 = 961 and
* tstart = 961/48 = 20. This exercises the window mask and the below-window tile skip (tiles