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

calculate_tile_n_k

def calculate_tile_n_k[a_type: DType, b_type: DType, c_type: DType, kernel_cols: Int](n: Int, k: Int) -> IndexList[2]

Helper heuristic function to decide on tile size to partition the matmul given the cache size and desired data layout.

Parameters:

  • ​a_type (DType): The dtype of the A tensor.
  • ​b_type (DType): The dtype of the B tensor.
  • ​c_type (DType): The dtype of the C tensor.
  • ​kernel_cols (Int): The umber of columns of the micro kernel.

Returns:

IndexList[2]: The calculated tile size to partition the matmul as (TileN, TileK).

def calculate_tile_n_k[a_type: DType, b_type: DType, c_type: DType, kernel_cols: Int](global_tile_shape: GemmShape) -> IndexList[2]

Returns:

IndexList[2]