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 function

dispatch_im2col_matmul_conv3d

def dispatch_im2col_matmul_conv3d[input_type: DType, filter_type: DType, output_type: DType, //, filter_is_fcrs: Bool = False, maybe_epilogue_func: Optional[def[dtype: DType, width: SIMDLength, alignment: Int = Int(1)](Coord[*?], SIMD[dtype, width]) capturing thin -> None] = None, m_tile_byte_budget: Int = Int(268435456)](input: TileTensor[input_type, Engine=input.Engine, address_space=input.address_space, linear_idx_type=input.linear_idx_type], filter: TileTensor[filter_type, Engine=filter.Engine, address_space=filter.address_space, linear_idx_type=filter.linear_idx_type], output: TileTensor[output_type, Engine=output.Engine, address_space=output.address_space, linear_idx_type=output.linear_idx_type], stride: IndexList[Int(3)], dilation: IndexList[Int(3)], symmetric_padding: IndexList[Int(3)], num_groups: Int, ctx: DeviceContextBase) -> Bool

Try to dispatch a 3-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 1x1x1 (the vectorized naive kernel wins on tiny shapes), and K too small for the matmul fast path.

Parameters:

  • ​input_type (DType): Element type of the input tensor; must be DType.bfloat16.
  • ​filter_type (DType): Element type of the filter tensor.
  • ​output_type (DType): Element type of the output tensor.
  • ​filter_is_fcrs (Bool): True if the filter is in FCQRS layout, False if in QRSCF layout (inferred, defaults to False).
  • ​maybe_epilogue_func (Optional[def[dtype: DType, width: SIMDLength, alignment: Int = Int(1)](Coord[*?], SIMD[dtype, width]) capturing thin -> None]): Optional elementwise epilogue applied to each output element with 5-D coordinates (inferred, defaults to None).
  • ​m_tile_byte_budget (Int): Upper bound on bytes allocated for one M-tile of the im2col matrix, controlling scratch memory usage (inferred, defaults to 256 MiB).

Args:

Returns:

Bool: True if the conv was handled, False if the caller should fall back to another implementation.

Was this page helpful?