pub struct GdnPrefillBuffers {
pub qkv: DevicePtr,
pub gate_beta: DevicePtr,
pub output: DevicePtr,
pub z: DevicePtr,
pub total_len: usize,
}Expand description
Device pointers to full-sequence GDN input/output buffers.
Used by the two-phase SSM prefill: phase 1 writes GDN inputs here, phase 2 reads them for the single-launch GDN kernel, phase 3 reads output.
Uses a packed QKV layout matching the conv1d output: each token occupies
conv_dim contiguous BF16 elements as [Q(key_dim) | K(key_dim) | V(value_dim)].
This allows simple contiguous memcpy from per-chunk conv1d output buffers.
The GDN kernel reads Q/K/V via stride parameters (qk_stride = conv_dim,
v_stride = conv_dim) to index into the packed layout.
Fields§
§qkv: DevicePtrPacked Q/K/V: [total_len, conv_dim] BF16. Layout per token: [Q(key_dim) | K(key_dim) | V(value_dim)].
gate_beta: DevicePtrInterleaved gate/beta: [total_len, 2*num_v_heads] FP32. Layout per token: [gate(nv) | beta(nv)].
output: DevicePtrGDN recurrence output: [total_len, value_dim] BF16.
z: DevicePtrZ gate for gated RMS norm: [total_len, value_dim] BF16.
total_len: usizeTotal number of tokens across all chunks.