Mojo struct
TileLoaderTMAIm2col
struct TileLoaderTMAIm2col[tma_origin: ImmutOrigin, dtype: DType, tma_rank: Int, tile_shape: IndexList[tma_rank], desc_shape: IndexList[tma_rank], /, *, cta_group: Int]
TMA tile loader using hardware im2col for implicit GEMM convolution.
Uses a TMATensorTileIm2col descriptor (cuTensorMapEncodeIm2col) to perform coordinate transformation in TMA hardware. Coordinates are in GEMM space:
- k_coord: K dimension (C * R * S reduction)
- m_coord: M dimension (batch * H_out * W_out spatial)
Parametersβ
- βtma_origin (
ImmutOrigin): Origin of the TMA descriptor pointer. - βdtype (
DType): Element data type. - βtma_rank (
Int): Rank of the TMA tile/descriptor shapes. - βtile_shape (
IndexList[tma_rank]): TMA tile shape as IndexList. - βdesc_shape (
IndexList[tma_rank]): TMA descriptor shape as IndexList. - βcta_group (
Int): CTA group size (1 or 2 for SM100).
Fieldsβ
- βtma_op (
TileLoaderTMAIm2col[tma_origin, dtype, tma_rank, tile_shape, desc_shape, cta_group=cta_group].TmaOpPtr): - βmulticast_mask (
UInt16):
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDestructible,
Movable,
RegisterPassable,
TrivialRegisterPassable
comptime membersβ
TmaOpβ
comptime TmaOp = TMATensorTileIm2col[dtype, tma_rank, tile_shape, desc_shape]
TmaOpPtrβ
comptime TmaOpPtr = Pointer[TMATensorTileIm2col[dtype, tma_rank, tile_shape, desc_shape], tma_origin]
Methodsβ
__init__β
__init__(tma_op: Pointer[TMATensorTileIm2col[dtype, tma_rank, tile_shape, desc_shape], tma_origin], multicast_mask: UInt16) -> Self
loadβ
load[LayoutType: TensorLayout](self, dest: TileTensor[dtype, LayoutType, MutAnyOrigin, address_space=AddressSpace.SHARED], ref[AddressSpace._value] barrier: SharedMemBarrier, k_coord: Int, m_coord: Int)
Load a TileTensor tile using im2col TMA.
Args:
- βdest (
TileTensor[dtype, LayoutType, MutAnyOrigin, address_space=AddressSpace.SHARED]): Destination SMEM TileTensor tile. - βbarrier (
SharedMemBarrier): Memory barrier for TMA completion signaling. - βk_coord (
Int): K dimension coordinate (C * R * S indexing). - βm_coord (
Int): M dimension coordinate (batch * H_out * W_out indexing).
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!