prefill_attention_512_sink

Function prefill_attention_512_sink 

Source
pub fn prefill_attention_512_sink(
    gpu: &dyn GpuBackend,
    kernel: KernelHandle,
    q: DevicePtr,
    k: DevicePtr,
    v: 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,
    sliding_window: u32,
    sinks: DevicePtr,
    stream: u64,
) -> Result<()>
Expand description

DeepSeek-V4 full-attention (non-CSA) prefill with a per-head attention sink.

Same as prefill_attention for HDIM=512 (BR=16), but passes the per-head sinks logit so the softmax denominator matches the decode path (which always applies the sink). Launches the V4-specific inferspark_prefill_512 kernel. sinks may be DevicePtr::NULL for no sink.