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 trait
InnerMatmulKernel
Trait for CPU matmul microkernels operating on pre-packed tiles.
Conforming types implement __inner_matmul__, which accumulates a
(kernel_rows Γ TileN Γ TileK) block of the output matrix using a
packed B tile in cache-friendly layout.
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDeletable,
Movable
Required methodsβ
__init__β
def __init__(out self, *, copy: Self)
Create a new instance of the value by copying an existing one.
Args:
- βcopy (
_Self): The value to copy.
Returns:
_Self
def __init__(out self, *, deinit move: Self)
Create a new instance of the value by moving the value of another.
Args:
- βmove (
_Self): The value to move.
Returns:
_Self
Provided methodsβ
__inner_matmul__β
def __inner_matmul__[kernel_rows: Int, kernel_cols: Int, simd_size: Int](self, c: TileTensor[Storage=c.Storage, address_space=c.address_space, linear_idx_type=c.linear_idx_type], a: TileTensor[Storage=a.Storage, address_space=a.address_space, linear_idx_type=a.linear_idx_type], b_packed: TileTensor[Storage=b_packed.Storage, address_space=b_packed.address_space, linear_idx_type=b_packed.linear_idx_type], global_offset: GemmShape, global_bound: GemmShape, tile_n_k: IndexList[Int(2)], skip_boundary_check: Bool)
Accumulates one packed B tile into the corresponding C tile.
Parameters:
- βkernel_rows (
Int): Number ofCrows the microkernel accumulates per tile. - βkernel_cols (
Int): Number ofCcolumns the microkernel accumulates per tile. - βsimd_size (
Int): SIMD vector width used by the inner accumulation.
Args:
- βc (
TileTensor[Storage=c.Storage, address_space=c.address_space, linear_idx_type=c.linear_idx_type]): Output tile to accumulate into. - βa (
TileTensor[Storage=a.Storage, address_space=a.address_space, linear_idx_type=a.linear_idx_type]): Non-transposed left operand tile. - βb_packed (
TileTensor[Storage=b_packed.Storage, address_space=b_packed.address_space, linear_idx_type=b_packed.linear_idx_type]): Pre-packed right operand panel (rank 3). - βglobal_offset (
GemmShape):(M, N, K)offset of this tile in the full problem. - βglobal_bound (
GemmShape):(M, N, K)bounds of the full problem. - βtile_n_k (
IndexList[Int(2)]): Dynamic(N, K)extent of the tile to process. - βskip_boundary_check (
Bool): Whether to skip partial-tile boundary handling.
copyβ
def copy(self) -> Self
Explicitly construct a copy of self, a convenience method for Self(copy=self) when the type is inconvenient to write out.
Overriding this method is not allowed.
Returns:
_Self: A copy of this value.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!