pub fn paged_decode_attn_bf16_gqa(
gpu: &dyn GpuBackend,
kernel: KernelHandle,
q: DevicePtr,
k_cache: DevicePtr,
v_cache: DevicePtr,
output: DevicePtr,
block_tables: DevicePtr,
seq_lens: DevicePtr,
max_blocks_per_seq: u32,
num_seqs: u32,
num_q_heads: u32,
num_kv_heads: u32,
head_dim: u32,
block_size: u32,
inv_sqrt_d: f32,
q_stride: u32,
sliding_window: u32,
stream: u64,
) -> Result<()>Expand description
2026-09-25: GQA-packed BF16-KV paged decode, one block per (kv_head, seq).
Same arguments, argument order and block as paged_decode_attn_bf16; only
the grid’s x extent changes, to num_kv_heads, because the kernel
(kernels/gb10/common/paged_decode_attn_bf16_gqa.cu) keeps a KV head’s
whole query group in registers.
Preconditions: num_q_heads == num_kv_heads * DECODE_GQA_PACK_WIDTH and
head_dim == DECODE_GQA_PACK_HEAD_DIM. The kernel derives its heads as
kv_head * PD_GQA + h and sizes its register arrays from PD_GQA. The
caller checks both with metrale_kernels::attn_splitk::gqa_pack_shape_ok
and uses the unpacked kernel when they fail.