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).
Python function
causal_conv1d_varlen_fwd
causal_conv1d_varlen_fwd()
max.nn.state_space.causal_conv1d_varlen_fwd(x, weight, bias, conv_states, query_start_loc, cache_indices, has_initial_state, activation='silu', channels_last=False, use_residual=False)
Applies a slot-indexed varlen causal depthwise conv1d for prefill and decode.
Mutates the conv-state pool conv_states in place at slot
cache_indices[batch_item] — the Qwen3.5 GatedDeltaNet conv
pattern. The builtin registers conv_states as a
MutableInputTensor at operand position 4 (after output, x, weight, bias).
-
Parameters:
-
- x (TensorValue) – The
[dim, total_seqlen]input (channels-first, model dtype), or[total_seqlen, dim]whenchannels_lastis true. - weight (TensorValue) – The
[dim, width]depthwise conv weights. - bias (TensorValue) – The
[dim]per-channel bias (empty to disable). - conv_states (BufferValue) – The
[max_slots, dim, width - 1]mutable conv-state pool. - query_start_loc (TensorValue) – The
[batch + 1]int32 cumulative sequence lengths. - cache_indices (TensorValue) – The
[batch]uint32 slot indices intoconv_states. - has_initial_state (TensorValue) – The
[batch]bool, whether to use the stored state. - activation (str) –
"silu"or"none". - channels_last (bool) – If true,
xand the output are tokens-major[total_seqlen, dim]. The kernel indexes through runtime strides, so this only relabels the axes — it avoids the materialized transposes the[dim, total_seqlen]contract forces on a tokens-major caller. - use_residual (bool) – If true, adds
xto the convolution sum at each output position, beforeactivation.
- x (TensorValue) – The
-
Returns:
-
The conv output with the same shape/layout as
x.conv_statesis mutated in place. -
Return type: