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: DeviceContextBase, 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.
This overload accepts a TileTensor instead of LayoutTensor, enabling use with the new coordinate-based tensor abstraction.
Parameters:
- dtype (
DType): The data type of the tensor elements. - tile_shape (
Coord[tile_shape.element_types]): The shape of the tile to be transferred, as a flatCoord. - 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[__tile_shape.element_types]): Internal parameter for the tile shape. - __desc_shape (
Coord[__desc_shape.element_types]): Internal parameter for the descriptor shape. - unpack_fp4 (
Bool): When True,tensorholds nibble-packed E2M1 asuint8and the copy pads it into shared memory so a K extent spans one byte per element (the values themselves stay nibble-packed; seePACKED_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:
- ctx (
DeviceContextBase): The CUDA device context. - tensor (
TileTensor[dtype, Engine=tensor.Engine, address_space=tensor.address_space, linear_idx_type=tensor.linear_idx_type]): The source TileTensor.
Returns:
TMATensorTile[dtype, __tile_shape, __desc_shape, k_major_tma]: A TMATensorTile configured for the given tensor.
Raises:
If TMA descriptor creation fails.