Skip to main content

Mojo struct

TiledMatmul

struct TiledMatmul[config: KernelConfig, transpose_b: Bool, b_packed: Bool, elementwise_epilogue_enabled: Bool, kernel_id: InnerKernelID, a_type: DType, a_layout: TensorLayout, a_origin: ImmutOrigin, b_type: DType, b_layout: TensorLayout, b_origin: ImmutOrigin, c_type: DType, c_layout: TensorLayout, c_origin: MutOrigin, algorithm: InnerMatmulKernel, ElementwiseEpilogueFnType: ImplicitlyCopyable & def(GemmShape, GemmShape) -> None]

Tiled matmul implementation integrating packing, inner loop and tile partitions.

TODO: add tag based implementation dispatch. TODO: add fusion hooks.

Fields​

  • ​alg (algorithm):
  • ​c (TileTensor[c_type, c_layout, c_origin]):
  • ​a (TileTensor[a_type, a_layout, a_origin]):
  • ​b (TileTensor[b_type, b_layout, b_origin]):
  • ​tile_n_k (IndexList[2]):
  • ​global_tile_offset (GemmShape):
  • ​global_tile_shape (GemmShape):
  • ​b_tile_generator (BTileGenerator[config, a_type, b_type, c_type, b_layout, transpose_b, b_packed, b_origin]):
  • ​elementwise_epilogue_fn (ElementwiseEpilogueFnType):

Implemented traits​

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDestructible, Movable