IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/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. /max/get-started.md).

Mojo function

causal_conv1d_varlen_fwd_cpu

causal_conv1d_varlen_fwd_cpu[x_dtype: DType, weight_dtype: DType, bias_dtype: DType, output_dtype: DType, cu_seqlens_dtype: DType, cache_indices_dtype: DType, has_initial_state_dtype: DType, conv_states_dtype: DType](dim: Int, total_seqlen: Int, width: Int, batch: Int, x: TileTensor[x_dtype, address_space=x.address_space, linear_idx_type=x.linear_idx_type, element_size=x.element_size], weight: TileTensor[weight_dtype, address_space=weight.address_space, linear_idx_type=weight.linear_idx_type, element_size=weight.element_size], bias: TileTensor[bias_dtype, address_space=bias.address_space, linear_idx_type=bias.linear_idx_type, element_size=bias.element_size], query_start_loc: TileTensor[cu_seqlens_dtype, address_space=query_start_loc.address_space, linear_idx_type=query_start_loc.linear_idx_type, element_size=query_start_loc.element_size], cache_indices: TileTensor[cache_indices_dtype, address_space=cache_indices.address_space, linear_idx_type=cache_indices.linear_idx_type, element_size=cache_indices.element_size], has_initial_state: TileTensor[has_initial_state_dtype, address_space=has_initial_state.address_space, linear_idx_type=has_initial_state.linear_idx_type, element_size=has_initial_state.element_size], conv_states: TileTensor[conv_states_dtype, address_space=conv_states.address_space, linear_idx_type=conv_states.linear_idx_type, element_size=conv_states.element_size], output: TileTensor[output_dtype, address_space=output.address_space, linear_idx_type=output.linear_idx_type, element_size=output.element_size], x_dim_stride: UInt32, x_seqlen_stride: UInt32, weight_dim_stride: UInt32, weight_width_stride: UInt32, out_dim_stride: UInt32, out_seqlen_stride: UInt32, conv_states_batch_stride: UInt32, conv_states_dim_stride: UInt32, conv_states_width_stride: UInt32, silu_activation: Bool, pad_slot_id: Int32, has_cache_indices: Bool, has_initial_state_flag: Bool, has_conv_states: Bool, has_bias: Bool)

Forward pass for causal conv1d with variable length sequences.

Performs causal 1D convolution on variable length sequences that are concatenated together. Uses cumulative sequence lengths to identify sequence boundaries.