pub fn prefill_attention_fp8kv(
gpu: &dyn GpuBackend,
kernel: KernelHandle,
q: DevicePtr,
k_fp8: DevicePtr,
v_fp8: DevicePtr,
output: DevicePtr,
seq_len: u32,
batch: u32,
num_q_heads: u32,
num_kv_heads: u32,
head_dim: u32,
inv_sqrt_d: f32,
causal: bool,
stream: u64,
) -> Result<()>Expand description
Contiguous prefill Flash Attention — FP8 E4M3 K/V variant (BR=64).
Q is BF16, K/V are FP8 E4M3 (dequantized to BF16 in shared memory). Halves K/V memory reads compared to the BF16 kernel.
Grid: (num_q_heads, ceil(seq_len/64), batch) Block: (256, 1, 1)