IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo struct

GatedDeltaConv1dFwd

struct GatedDeltaConv1dFwd

Gated DeltaNet causal conv1d forward pass (Pass 1 of two-pass prefill).

Reads/writes a single mutable conv-state pool of shape [max_slots, conv_dim, kernel_size-1] in place at slot slot_idx[batch_item]. No state-out tensor; the only output is the per-token conv output. The pool's dtype is independent of the working dtype, so the caller can keep the per-token tensors at fp32 while storing the pool at the model's native dtype (bf16).

Tensor Shapes: - conv_output_ragged : [total_seq_len, conv_dim] (OUT) - qkv_input_ragged : [total_seq_len, conv_dim] - conv_weight : [conv_dim, kernel_size] - conv_state : [max_slots, conv_dim, kernel_size-1] (MUT) - slot_idx : [batch_size] uint32 - input_row_offsets : [batch_size + 1] uint32

Implemented traitsโ€‹

AnyType, ImplicitlyDeletable

Methodsโ€‹

executeโ€‹

static def execute[work_dtype: DType, state_dtype: DType, target: StringSlice[ImmStaticOrigin]](conv_output_ragged: ManagedTensorSlice[IOSpec[_, _].Output, static_spec=conv_output_ragged.static_spec], qkv_input_ragged: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=qkv_input_ragged.static_spec], conv_weight: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=conv_weight.static_spec], conv_state: ManagedTensorSlice[IOSpec[_, _].MutableInput, static_spec=conv_state.static_spec], slot_idx: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=slot_idx.static_spec], input_row_offsets: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input_row_offsets.static_spec], ctx: DeviceContext)