prefill_attention_paged_512

Function prefill_attention_paged_512 

Source
pub fn prefill_attention_paged_512(
    gpu: &dyn GpuBackend,
    kernel: KernelHandle,
    q: DevicePtr,
    k_cache: DevicePtr,
    v_cache: DevicePtr,
    output: DevicePtr,
    block_table: DevicePtr,
    q_len: u32,
    kv_len: u32,
    q_offset: u32,
    num_q_heads: u32,
    num_kv_heads: u32,
    head_dim: u32,
    cache_block_size: u32,
    sliding_window: u32,
    inv_sqrt_d: f32,
    stream: u64,
) -> Result<()>
Expand description

Paged prefill Flash Attention for HDIM=512 (Gemma-4 full-attention) — BF16 KV.

Uses dynamic shared memory (101,120 B) opt-in. Single-buffered K, 8 warps. Required for chunked long-context prefill on layers with head_dim==512 where the standard 4-warp template doesn’t fit GB10’s 99 KB smem cap.