Skip to main content

Mojo struct

MatmulConfig

@register_passable(trivial) struct MatmulConfig[a_type: DType, b_type: DType, c_type: DType, transpose_b: Bool = True]

Static configuration of GPU matmul.

Fields

  • cta_group (Int):
  • mma_shape (IndexList[3]):
  • cluster_shape (IndexList[3]):
  • AB_swapped (Bool):
  • block_swizzle_size (Int):
  • raster_order (RasterOrder):
  • block_tile_shape (IndexList[3]):
  • num_pipeline_stages (UInt):
  • num_clc_pipeline_stages (UInt):
  • num_accum_pipeline_stages (UInt):
  • num_output_stages (UInt):
  • output_tile_shape (IndexList[2]):
  • a_swizzle (TensorMapSwizzle):
  • b_swizzle (TensorMapSwizzle):
  • c_swizzle (TensorMapSwizzle):

Implemented traits

AnyType, Copyable, EqualityComparable, Hashable, ImplicitlyCopyable, Movable, Stringable, UnknownDestructibility, Writable

Aliases

__copyinit__is_trivial

alias __copyinit__is_trivial = True

__del__is_trivial

alias __del__is_trivial = True

__moveinit__is_trivial

alias __moveinit__is_trivial = True

accum_type

alias accum_type = get_accum_type[a_type]()

Methods

__init__

__init__(*, cta_group: Int = 2, mma_shape: IndexList[3] = get_mma_shape[a_type, get_accum_type[a_type]()](), cluster_shape: IndexList[3] = Index(2, 1, 1), AB_swapped: Bool = False, block_swizzle_size: Int = 0, raster_order: RasterOrder = RasterOrder(1), num_pipeline_stages: Optional[UInt] = None) -> Self

__eq__

__eq__(self, other: Self) -> Bool

Returns:

Bool

copy_field

copy_field(mut self, other: MatmulConfig[a_type, b_type, c_type, transpose_b])

swapAB

swapAB(self) -> MatmulConfig[b_type, a_type, c_type, transpose_b]

Returns:

MatmulConfig

__str__

__str__(self) -> String

Returns:

String

write_to

write_to(self, mut writer: T)

__repr__

__repr__(self) -> String

Returns:

String

__hash__

__hash__[H: Hasher](self, mut hasher: H)

Updates hasher with the underlying bytes.

Parameters:

  • H (Hasher): The hasher type.

Args:

  • hasher (H): The hasher instance.

Was this page helpful?