kda_chunked

Function kda_chunked 

Source
pub fn kda_chunked(
    q: &[f32],
    k: &[f32],
    v: &[f32],
    gate: &[f32],
    beta: &[f32],
    dims: KdaDims,
    chunk: usize,
    state: &mut [f32],
) -> Vec<f32>
Expand description

Prefill formulation: chunked (WY-style) delta rule, mirroring HF’s chunk_kimi_delta_attention. Included at reference level because the per-channel decay mask is exactly the part that a scalar-decay GDN kernel cannot express — proving it here is cheaper than proving it in CUDA.

Handles tokens % chunk != 0 by zero-padding, the same way HF does.