conv1d_update_chunk2

Function conv1d_update_chunk2 

Source
pub fn conv1d_update_chunk2(
    gpu: &dyn GpuBackend,
    kernel: KernelHandle,
    conv_state: DevicePtr,
    input: DevicePtr,
    weight: &DenseWeight,
    output: DevicePtr,
    conv_state_intermediate: DevicePtr,
    d_inner: u32,
    d_conv: u32,
    batch_size: u32,
    stream: u64,
) -> Result<()>
Expand description

Fused 2-token conv1d sliding window update + SiLU.

Each thread handles one channel independently. The 2-token dependency (token 1’s window includes token 0’s input) is resolved in registers. Saves intermediate conv_state (after token 0) for rollback.

Kernel: causal_conv1d_update_chunk2(conv_state, input, weight, bias, output, conv_state_intermediate, batch, dim, d_conv) Grid: (ceil(dim/256), batch, 1) Block: (256, 1, 1)