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

tiled_matmul_run

def tiled_matmul_run[config: KernelConfig, transpose_b: Bool, b_packed: Bool, simd_size: Int, elementwise_epilogue_enabled: Bool, kernel_id: InnerKernelID, algorithm: InnerMatmulKernel, ElementwiseEpilogueFnType: def(GemmShape, GemmShape, TileTensor[*?, *?, origin_of(origin), Storage=*?, linear_idx_type=*?]) -> None & ImplicitlyCopyable](alg: algorithm, c: TileTensor[Storage=c.Storage, linear_idx_type=c.linear_idx_type], a: TileTensor[Storage=a.Storage, linear_idx_type=a.linear_idx_type], b: TileTensor[Storage=b.Storage, linear_idx_type=b.linear_idx_type], elementwise_epilogue_fn: ElementwiseEpilogueFnType, global_tile_shape: GemmShape, global_tile_offset: GemmShape)

Interface function to run tiled matmul on a given sub-tile.

Parameters:

  • ​config (KernelConfig): Kernel configuration controlling tile dimensions and SIMD width.
  • ​transpose_b (Bool): Whether the B operand is transposed.
  • ​b_packed (Bool): Whether B was pre-packed offline in the cache-friendly layout.
  • ​simd_size (Int): SIMD vector width for the elementwise epilogue.
  • ​elementwise_epilogue_enabled (Bool): Whether to apply the elementwise epilogue on the last K tile.
  • ​kernel_id (InnerKernelID): Identifier of the inner microkernel to dispatch.
  • ​algorithm (InnerMatmulKernel): Microkernel implementing the inner accumulate loop.
  • ​ElementwiseEpilogueFnType (def(GemmShape, GemmShape, TileTensor[*?, *?, origin_of(origin), Storage=*?, linear_idx_type=*?]) -> None & ImplicitlyCopyable): Type of the elementwise epilogue function applied to each output tile.

Args:

Was this page helpful?