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

dispatch_im2col_matmul_conv2d

def dispatch_im2col_matmul_conv2d[input_type: DType, filter_type: DType, output_type: DType, //, filter_is_fcrs: Bool = False, maybe_epilogue_func: Optional[def[dtype: DType, rank: Int, width: Int, alignment: Int = 1](IndexList[rank], SIMD[dtype, width]) capturing -> None] = None, m_tile_byte_budget: Int = 268435456](input: TileTensor[input_type, address_space=input.address_space, linear_idx_type=input.linear_idx_type, element_size=input.element_size], filter: TileTensor[filter_type, address_space=filter.address_space, linear_idx_type=filter.linear_idx_type, element_size=filter.element_size], output: TileTensor[output_type, address_space=output.address_space, linear_idx_type=output.linear_idx_type, element_size=output.element_size], stride: IndexList[2], dilation: IndexList[2], symmetric_padding: IndexList[2], num_groups: Int, ctx: DeviceContext) -> Bool

Try to dispatch a 2-D conv as explicit im2col + generic matmul.

Returns True if the conv was handled; False if the caller should fall back to another implementation (naive Mojo kernel, cuDNN, etc.).

Skips on: non-bf16 dtype, grouped conv, dilation != 1, kernel size 1x1 (the vectorized naive kernel wins on tiny shapes), and K too small for the matmul fast path.

Returns:

Bool