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 function

create_tensor_tile

def create_tensor_tile[dtype: DType, //, tile_shape: Coord[*tile_shape.element_types], /, k_major_tma: Bool = True, swizzle_mode: TensorMapSwizzle = TensorMapSwizzle.SWIZZLE_NONE, *, __tile_shape: Coord[*__tile_shape.element_types] = tile_shape, __desc_shape: Coord[*__desc_shape.element_types] = _default_desc_shape[dtype, tile_shape, swizzle_mode](), unpack_fp4: Bool = False](ctx: DeviceContext, tensor: TileTensor[dtype, Engine=tensor.Engine, address_space=tensor.address_space, linear_idx_type=tensor.linear_idx_type]) -> TMATensorTile[dtype, __tile_shape, __desc_shape, k_major_tma]

Creates a TMATensorTile from a TileTensor.

Parameters:

  • ​dtype (DType): The data type of the tensor elements.
  • ​tile_shape (Coord[*element_types]): The shape of the tile to be transferred, as a flat Coord.
  • ​k_major_tma (Bool): Whether the TMA should use column-major pattern.
  • ​swizzle_mode (TensorMapSwizzle): The swizzling mode for memory access optimization.
  • ​__tile_shape (Coord[*element_types]): Internal parameter for the tile shape.
  • ​__desc_shape (Coord[*element_types]): Internal parameter for the descriptor shape.
  • ​unpack_fp4 (Bool): When True, tensor holds nibble-packed E2M1 as uint8 and the copy pads it into shared memory so a K extent spans one byte per element (the values themselves stay nibble-packed; see PACKED_FP4_ALIGN16B). The tile and descriptor shapes are then counted in FP4 elements, so they are twice the tensor's innermost extent per tile.

Args:

Returns:

TMATensorTile[dtype, __tile_shape, __desc_shape, k_major_tma]: A TMATensorTile configured for the given tensor.

Raises:

If TMA descriptor creation fails.

Was this page helpful?