Skip to main content

Mojo struct

KernelConfig

struct KernelConfig

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

Fields​

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

Implemented traits​

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDestructible, Movable, Writable

Methods​

__init__​

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

Constructs a KernelConfig from the three tile shapes.

Args:

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

num_threads​

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​

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​

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.