forward_linear_attention

Function forward_linear_attention 

Source
pub fn forward_linear_attention<Q: QuantWeights>(
    gpu: &dyn GpuBackend,
    cfg: &Qwen35ForwardConfig,
    k: &Qwen35Kernels,
    layer: &LinearAttentionLayer<'_, Q>,
    state: &LinearAttentionState,
    scratch: &LinearAttentionScratch,
    x_in: DevicePtr,
    x_buf: DevicePtr,
    stream: u64,
    intra_dump: Option<&dyn Fn(&str, DevicePtr, u32) -> Result<()>>,
) -> Result<DevicePtr>
Expand description

Single-token GDN (linear-attention) decoder forward. Returns the DevicePtr containing the layer’s output residual stream — that pointer is x_buf, into which scratch.x_final was copied so the caller’s residual-stream buffer stays stable across layers.