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

get_conv_tile_shape

def get_conv_tile_shape[dtype: DType](c: Int, filter_window_size: Int, micro_kernel_width: Int) -> IndexList[Int(2)]

Compute the (c, f) tile shape in L2.

Assume NHWC layout, the tile shape is (R, S, c_tile, f_tile). R and S are by default fully covered. The heuristic tried to block in C as much as possible. If C is small, it would start to block F.

Parameters:

  • ​dtype (DType): Element type of the convolution operands, used to derive the target SIMD width and L2 tile size.

Args:

  • ​c (Int): Number of input channels, bounding the C tile size.
  • ​filter_window_size (Int): Flattened filter window size (the product of the spatial filter dimensions, for example R * S for 2D), divided into the L2 tile budget to size the C and F tiles.
  • ​micro_kernel_width (Int): Micro-kernel width in SIMD lanes; multiplied by the SIMD width to give the micro-kernel size in the F dimension, which sets the F tile granularity.

Returns:

IndexList[Int(2)]

Was this page helpful?