prefill_attention_paged_fp8_dflash

Function prefill_attention_paged_fp8_dflash 

Source
pub fn prefill_attention_paged_fp8_dflash(
    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,
    k_scale: f32,
    v_scale: f32,
    cache_stride: u64,
    stream: u64,
) -> Result<()>
Expand description

DFlash γ-block paged Flash Attention — FP8 KV cache variant.

Same kernel binary as prefill_attention_paged_fp8 but launched with causal_mask_enabled = 0, producing bidirectional attention within the γ-token query block. The prefix KV positions are still strictly less than q_offset so they need no causal mask in this mode (every prefix position is “older” than every query, which is the no-mask case anyway).

Used by BlockDiffusionDraftHead::forward_block once per drafter layer. q_len is γ (typically 16). q_offset is the absolute starting index of the γ-block in the drafter’s logical sequence; the kernel uses it to skip the now-disabled causal compare against kv_start+col.