IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /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. /get-started.md).

Mojo struct

MatmulKernelConfig

struct MatmulKernelConfig

Block/warp/MMA shape configuration for 4-wave kernels.

Shared by AMD4WaveMatmul's matmul and conv2d entry points: both use the same 4-warp 2×2 quadrant layout and the same MFMA shape selection, so the per-call surface only needs the workgroup / warp / MMA tile shapes.

Fields

  • block_shape (IndexList[Int(3)]): Workgroup tile shape (BM, BN, BK).
  • warp_shape (IndexList[Int(3)]): Per-warp tile shape (WM, WN, WK).
  • mma_shape (IndexList[Int(3)]): Single-MMA instruction shape (MMA_M, MMA_N, MMA_K).

Implemented traits

AnyType, Copyable, Deinitable, ImplicitlyCopyable, Movable, Writable

Methods

__init__

def __init__(out self, *, block_shape: IndexList[Int(3)], warp_shape: IndexList[Int(3)], mma_shape: IndexList[Int(3)])

Constructs a MatmulKernelConfig from the three tile shapes.

Args:

num_threads

def num_threads(self) -> Int

Returns the total threads per workgroup (warps x WARP_SIZE).

Returns:

Int: The number of threads in one workgroup.

write_to

def write_to(self, mut writer: T)

Writes a human-readable shape tag to writer.

Args:

  • writer (T): Sink for the rendered config tag.

write_repr_to

def write_repr_to(self, mut writer: T)

Writes a debug representation of this config to writer.

Args:

  • writer (T): Sink for the rendered config tag.