For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo struct
BlockScaledTileStorage
struct BlockScaledTileStorage[a_type: DType, b_type: DType, c_type: DType, sfa_type: DType, sfb_type: DType, a_shape: IndexList[2], b_shape: IndexList[2], c_dim0: Int, c_dim1: Int, sfa_shape: IndexList[2], sfb_shape: IndexList[2], num_pipeline_stages: Int, num_output_stages: Int]
Storage for block-scaled matmul tiles (A, B, C, SFA, SFB).
Single source of truth for block-scaled tile arrays and storage.
All tiles use TileTensor natively. LayoutTensor conversion is kept for SMemEpilogueWriter compatibility.
IMPORTANT: Field order preserves SMEM layout compatibility: a, b, c, sfa, sfb.
Parametersβ
- βa_type (
DType): Data type for A matrix tiles. - βb_type (
DType): Data type for B matrix tiles. - βc_type (
DType): Data type for C matrix tiles. - βsfa_type (
DType): Data type for A scale factor tiles. - βsfb_type (
DType): Data type for B scale factor tiles. - βa_shape (
IndexList[2]): Tile shape for A tiles as (rows, cols). - βb_shape (
IndexList[2]): Tile shape for B tiles as (rows, cols). - βc_dim0 (
Int): First dimension for C tiles (OutputM). - βc_dim1 (
Int): Second dimension for C tiles (OutputN). - βsfa_shape (
IndexList[2]): Tile shape for SFA tiles. - βsfb_shape (
IndexList[2]): Tile shape for SFB tiles. - βnum_pipeline_stages (
Int): Number of input pipeline stages. - βnum_output_stages (
Int): Number of output pipeline stages.
Fieldsβ
- βa_tiles_storage (
BlockScaledTileStorage[a_type, b_type, c_type, sfa_type, sfb_type, a_shape, b_shape, c_dim0, c_dim1, sfa_shape, sfb_shape, num_pipeline_stages, num_output_stages].ATileArray.Storage): - βb_tiles_storage (
BlockScaledTileStorage[a_type, b_type, c_type, sfa_type, sfb_type, a_shape, b_shape, c_dim0, c_dim1, sfa_shape, sfb_shape, num_pipeline_stages, num_output_stages].BTileArray.Storage): - βc_tiles_storage (
BlockScaledTileStorage[a_type, b_type, c_type, sfa_type, sfb_type, a_shape, b_shape, c_dim0, c_dim1, sfa_shape, sfb_shape, num_pipeline_stages, num_output_stages].CTileArray.Storage): - βsfa_tiles_storage (
BlockScaledTileStorage[a_type, b_type, c_type, sfa_type, sfb_type, a_shape, b_shape, c_dim0, c_dim1, sfa_shape, sfb_shape, num_pipeline_stages, num_output_stages].SFATileArray.Storage): - βsfb_tiles_storage (
BlockScaledTileStorage[a_type, b_type, c_type, sfa_type, sfb_type, a_shape, b_shape, c_dim0, c_dim1, sfa_shape, sfb_shape, num_pipeline_stages, num_output_stages].SFBTileArray.Storage):
Implemented traitsβ
AnyType,
ImplicitlyDestructible
comptime membersβ
ATileArrayβ
comptime ATileArray = SMemTileArray2D[a_type, a_shape[0], a_shape[1], num_pipeline_stages]
BTileArrayβ
comptime BTileArray = SMemTileArray2D[b_type, b_shape[0], b_shape[1], num_pipeline_stages]
c_tile_layoutβ
comptime c_tile_layout = Layout.row_major(c_dim0, c_dim1)
CTileArrayβ
comptime CTileArray = SMemTileArray2DRowMajor[c_type, c_dim0, c_dim1, num_output_stages]
sfa_layoutβ
comptime sfa_layout = Layout(Coord(Coord(ComptimeInt(), ComptimeInt()), Coord(Coord(ComptimeInt(), ComptimeInt()), ComptimeInt())), Coord(Coord(ComptimeInt(), ComptimeInt()), Coord(Coord(ComptimeInt(), ComptimeInt()), ComptimeInt())))
SFATileArrayβ
comptime SFATileArray = SMemTileArrayWithLayout[sfa_type, BlockScaledTileStorage[a_type, b_type, c_type, sfa_type, sfb_type, a_shape, b_shape, c_dim0, c_dim1, sfa_shape, sfb_shape, num_pipeline_stages, num_output_stages].sfa_layout, num_pipeline_stages]
sfb_layoutβ
comptime sfb_layout = Layout(Coord(Coord(ComptimeInt(), ComptimeInt()), Coord(Coord(ComptimeInt(), ComptimeInt()), ComptimeInt())), Coord(Coord(ComptimeInt(), ComptimeInt()), Coord(Coord(ComptimeInt(), ComptimeInt()), ComptimeInt())))
SFBTileArrayβ
comptime SFBTileArray = SMemTileArrayWithLayout[sfb_type, BlockScaledTileStorage[a_type, b_type, c_type, sfa_type, sfb_type, a_shape, b_shape, c_dim0, c_dim1, sfa_shape, sfb_shape, num_pipeline_stages, num_output_stages].sfb_layout, num_pipeline_stages]
Methodsβ
a_tilesβ
a_tiles(ref[AddressSpace._value] self) -> BlockScaledTileStorage[a_type, b_type, c_type, sfa_type, sfb_type, a_shape, b_shape, c_dim0, c_dim1, sfa_shape, sfb_shape, num_pipeline_stages, num_output_stages].ATileArray
Get A tile array accessor.
Returns:
BlockScaledTileStorage[a_type, b_type, c_type, sfa_type, sfb_type, a_shape, b_shape, c_dim0, c_dim1, sfa_shape, sfb_shape, num_pipeline_stages, num_output_stages].ATileArray
b_tilesβ
b_tiles(ref[AddressSpace._value] self) -> BlockScaledTileStorage[a_type, b_type, c_type, sfa_type, sfb_type, a_shape, b_shape, c_dim0, c_dim1, sfa_shape, sfb_shape, num_pipeline_stages, num_output_stages].BTileArray
Get B tile array accessor.
Returns:
BlockScaledTileStorage[a_type, b_type, c_type, sfa_type, sfb_type, a_shape, b_shape, c_dim0, c_dim1, sfa_shape, sfb_shape, num_pipeline_stages, num_output_stages].BTileArray
c_tilesβ
c_tiles(ref[AddressSpace._value] self) -> BlockScaledTileStorage[a_type, b_type, c_type, sfa_type, sfb_type, a_shape, b_shape, c_dim0, c_dim1, sfa_shape, sfb_shape, num_pipeline_stages, num_output_stages].CTileArray
Get C tile array accessor.
Returns:
BlockScaledTileStorage[a_type, b_type, c_type, sfa_type, sfb_type, a_shape, b_shape, c_dim0, c_dim1, sfa_shape, sfb_shape, num_pipeline_stages, num_output_stages].CTileArray
sfa_tilesβ
sfa_tiles(ref[AddressSpace._value] self) -> BlockScaledTileStorage[a_type, b_type, c_type, sfa_type, sfb_type, a_shape, b_shape, c_dim0, c_dim1, sfa_shape, sfb_shape, num_pipeline_stages, num_output_stages].SFATileArray
Get SFA tile array accessor.
Returns:
BlockScaledTileStorage[a_type, b_type, c_type, sfa_type, sfb_type, a_shape, b_shape, c_dim0, c_dim1, sfa_shape, sfb_shape, num_pipeline_stages, num_output_stages].SFATileArray
sfb_tilesβ
sfb_tiles(ref[AddressSpace._value] self) -> BlockScaledTileStorage[a_type, b_type, c_type, sfa_type, sfb_type, a_shape, b_shape, c_dim0, c_dim1, sfa_shape, sfb_shape, num_pipeline_stages, num_output_stages].SFBTileArray
Get SFB tile array accessor.
Returns:
BlockScaledTileStorage[a_type, b_type, c_type, sfa_type, sfb_type, a_shape, b_shape, c_dim0, c_dim1, sfa_shape, sfb_shape, num_pipeline_stages, num_output_stages].SFBTileArray
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!