Mojo module
tile_tensor
TileTensor type for structured memory access with compile-time layout information.
comptime values
LTToTTLayout
comptime LTToTTLayout[lt_layout: Layout] = Layout[#kgen.variadic.reduce(#kgen.variadic.tabulate(len[IntTuple](lt_layout.shape), [idx: __mlir_type.index] _int_to_dim(lt_layout.shape[idx].value())), base=, reducer=[PrevV: Variadic[CoordLike], VA: Variadic[Dim], idx: __mlir_type.index] #kgen.variadic.concat(PrevV, ComptimeInt[VA[idx]._value_or_missing] if (VA[idx] != -31337) else RuntimeInt[DType.int64])), #kgen.variadic.reduce(#kgen.variadic.tabulate(len[IntTuple](lt_layout.stride), [idx: __mlir_type.index] _int_to_dim(lt_layout.stride[idx].value())), base=, reducer=[PrevV: Variadic[CoordLike], VA: Variadic[Dim], idx: __mlir_type.index] #kgen.variadic.concat(PrevV, ComptimeInt[VA[idx]._value_or_missing] if (VA[idx] != -31337) else RuntimeInt[DType.int64]))]
Derive a TileTensor Layout from a legacy Layout.
Known dimensions become ComptimeInt, UNKNOWN_VALUE dimensions become RuntimeInt. Works for flat layouts of rank 1 through 6.
Parameters
- lt_layout (
Layout): The legacy Layout to convert.
Structs
-
TileTensor: A tensor type with trait-based layouts supporting nested and hierarchical indexing.
Functions
-
flatten_leading: Merge the first two dimensions of a rank-3 TileTensor: (A, B, C) -> (A*B, C). -
lt_to_tt: Convert a LayoutTensor to a TileTensor. -
stack_allocation: Allocate a TileTensor on the stack with the given layout.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!