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:
- βalg (
algorithm): InnerMatmulKernel algorithm for microkernel. - βc (
TileTensor[Storage=c.Storage, linear_idx_type=c.linear_idx_type]): Pre-allocated buffer space for result. - βa (
TileTensor[Storage=a.Storage, linear_idx_type=a.linear_idx_type]): Operand A of the matmul. - βb (
TileTensor[Storage=b.Storage, linear_idx_type=b.linear_idx_type]): Operand B of the mamtul. - βelementwise_epilogue_fn (
ElementwiseEpilogueFnType): The elementwise epilogue function. - βglobal_tile_shape (
GemmShape): Tile shape this call will process. - βglobal_tile_offset (
GemmShape): Tile offset on the original buffer.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!