gdn_decode_wy2

Function gdn_decode_wy2 

Source
pub fn gdn_decode_wy2(
    gpu: &dyn GpuBackend,
    kernel: KernelHandle,
    h_state: DevicePtr,
    query: DevicePtr,
    key: DevicePtr,
    value: DevicePtr,
    gate: DevicePtr,
    beta: DevicePtr,
    output: DevicePtr,
    h_state_intermediate: DevicePtr,
    batch_size: u32,
    num_k_heads: u32,
    num_v_heads: u32,
    k_dim: u32,
    v_dim: u32,
    qk_stride: u32,
    v_stride: u32,
    gb_stride: u32,
    state_is_table: bool,
    stream: u64,
) -> Result<()>
Expand description

WY-chunkwise 2-token GDN decode (2-pass algorithm).

Drop-in replacement for gdn_decode_chunk2. Computes both H^T @ k_t dot products in a single pass over H, then applies WY algebraic correction. 2 passes vs 3, reducing memory traffic by 33%.

Grid: (num_v_heads, batch, 1) Block: (128, 1, 1)