From 0792d863757a0dd3d1618d48482b47b1961c139a Mon Sep 17 00:00:00 2001 From: mici81 Date: Sat, 24 Oct 2026 10:34:25 +0000 Subject: [PATCH] libr4d: the paged prefill attention h256 gqa6 asks for KLATE again 75b4c92 brought the kernel side of KLATE (tile t+1 K fetched once tile t has its scores) and set P_OPT to (3954187 | O_KLATE) in this launcher; a later merge restored the old P_OPT line, so the kernel code is there but Qwen3.8 prefill no longer takes it. This puts the bit back. Load order only: the bytes are the same. Co-Authored-By: Claude Opus 5.5 (1M context) --- libr4d/r4d_attn_paged_h256_gqa6.hip | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libr4d/r4d_attn_paged_h256_gqa6.hip b/libr4d/r4d_attn_paged_h256_gqa6.hip index be0869d3..0a0896ab 100644 --- a/libr4d/r4d_attn_paged_h256_gqa6.hip +++ b/libr4d/r4d_attn_paged_h256_gqa6.hip @@ -10,9 +10,10 @@ // taken only when the caller's `prefill_fp8` asks for them. // // `opt` is a bitmask of optimisation steps: -// prefill 3954187 = f16 operands | mask skip | folded query scale | contiguous-k fragments +// prefill 3954187 | KLATE = f16 operands | mask skip | folded query scale | contiguous-k fragments // | prefetch 2 + scheduling barrier | dot2 row sum | block table in SGPRs // | wide K fetch | V prefetch across the m-tile loop | LDS-scoped barrier +// | 8-bit K fetched a tile ahead (KLATE) // decode 3429947 = the same minus the wide K fetch (its K never reaches LDS), plus K read // straight from the paged cache (bit 16) and f16 split-KV partials (32). // Each bit is defined where it is used (r4d_attn_prefill_h256_gqa6.hip, @@ -50,7 +51,7 @@ extern "C" void r4d_attn_dims(int* head_dim, int* gqa, int* block_size, int* max #define P_TILE 48 // K prefetch 2, not 4: four fragments in flight make the m-tile loop spill at six waves per SIMD // (36-48 bytes per lane, ~4% of the prefill). At 2 the spill is 20 bytes, outside the WMMA groups. -#define P_OPT 3954187 +#define P_OPT (3954187 | O_KLATE) // ---- the prefill KV split (r4d_attn_prefill_split.h) ------------------------------------------- // Query positions a workgroup: 64.