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 function
causal_conv1d_channel_first_fwd_cpu_no_bias
def causal_conv1d_channel_first_fwd_cpu_no_bias[x_dtype: DType, weight_dtype: DType, output_dtype: DType](batch: Int, dim: Int, seqlen: Int, width: Int, x: TileTensor[x_dtype, Engine=x.Engine, address_space=x.address_space, linear_idx_type=x.linear_idx_type], weight: TileTensor[weight_dtype, Engine=weight.Engine, address_space=weight.address_space, linear_idx_type=weight.linear_idx_type], output: TileTensor[output_dtype, Engine=output.Engine, address_space=output.address_space, linear_idx_type=output.linear_idx_type], silu_activation: Bool, ctx: Optional[DeviceContext[CompilationTarget()]] = None)
CPU implementation of causal conv1d for channel-first layout without bias.
Optimizations:
- Parallelization across batch*channel dimensions using sync_parallelize.
- Pre-loaded weights in registers to reduce memory access.
Parameters:
- x_dtype (
DType): Element type of the input tensorx. - weight_dtype (
DType): Element type of the weight tensorweight. - output_dtype (
DType): Element type of the output tensoroutput.
Args:
- batch (
Int): Batch size. - dim (
Int): Number of channels. - seqlen (
Int): Sequence length. - width (
Int): Kernel width. - x (
TileTensor[x_dtype, Engine=x.Engine, address_space=x.address_space, linear_idx_type=x.linear_idx_type]): Input tensor of shape (B, C, L). - weight (
TileTensor[weight_dtype, Engine=weight.Engine, address_space=weight.address_space, linear_idx_type=weight.linear_idx_type]): Weight tensor of shape (C, W). - output (
TileTensor[output_dtype, Engine=output.Engine, address_space=output.address_space, linear_idx_type=output.linear_idx_type]): Output tensor of shape (B, C, L). - silu_activation (
Bool): Whether to apply SiLU activation. - ctx (
Optional[DeviceContext[CompilationTarget()]]): The context to execute the work on.