Expand description
Tile module.
Modules§
- allocate_
bounce_ tile - allocate_
unit_ tile - allocate_
whitebox_ fragment - cmma_
allocate_ acc - cmma_
allocate_ lhs - cmma_
allocate_ rhs - interleaved_
allocate_ acc - interleaved_
allocate_ lhs - interleaved_
allocate_ rhs - mask_
layout_ absolute_ pos - mask_
layout_ num_ units_ per_ row - matmul
- Per-flavor tile matmul compute:
*_execute,*_load_*,*_write_to_shared, plus the fragment readers/writers for each flavor. Tile data and matmul configs live alongside the corresponding data structures in [crate::tile::data]. - mma_
allocate_ acc - mma_
allocate_ lhs - mma_
allocate_ rhs - mma_
register_ vector_ sizes - planevec_
allocate_ acc - planevec_
allocate_ lhs - planevec_
allocate_ rhs - register_
allocate_ acc - register_
allocate_ lhs - register_
allocate_ rhs - rowwise
- Row-wise tile compute. The
Tile<E, Plane, ReadWrite>impl in [dispatch] routes per-variantrow_max,row_sum,exp_diff, androwwise_scaleto the right backend; [reducer] handles the cross-unit plane reduction used by theWhiteboxFragmentandBounceTilearms. - softmax_
init_ state - whitebox_
fragment_ absolute_ pos - whitebox_
fragment_ zero_ slice
Structs§
- Bounce
Config - Comptime configuration for
BounceTile. - Bounce
Tile - Bounce
Tile Expand - Cmma
Matmul - Cmma
Tile - Cmma
Tile Expand - Cube
- Filled
- Tile is a single value that gets filled in everywhere
- Filled
Expand - Interleaved
Matmul - Interleaved
Tile - Interleaved
Tile Expand - MmaIO
Config - MmaMatmul
- MmaTile
- Single MMA tile carrier. The role (Lhs / Rhs / Acc) lives inside
MmaFragmentbecause each role’s fragment uses a different inner vector size (NL/NR/NA); the outer carrier holds the shared comptime metadata. - MmaTile
Expand - Plane
- Plane
VecMat Inner Product - Plane
VecTile - Plane
VecTile Expand - Register
Matmul - Register
Tile - Register
Tile Expand - RowWise
- Contains one value per row of a fragment for which the unit contributes
- RowWise
Expand - Scope
Marker - Zero-sized comptime marker used to carry a Scope generic through [Tile].
- Scope
Marker Expand - Shared
Tile - V-erased view over a shared-memory tile. Wraps a
StridedTileand hides its vectorization from the type system. The underlying slice is downcast to a scalarSlice<E, IO>only at the Rust type level — the runtime vector_size on the cubecl slice is preserved, so projecting back viaview::<V>()is a pure retype with no metadata change.Vmust match the originalVthe tile was wrapped with. - Shared
Tile Expand - Strided
- Tile is a slice of memory with a stride
- Strided
Expand - Strided
Tile - Tile with a linear major dimension, and a strided minor dimension. Basic tile kind supported by all stage matmuls.
- Strided
Tile Expand - Unit
- Unit
Tile - Unit
Tile Expand - Unit
Tile Layout - Value
- Wrapper over val to make enum work
- Value
Expand - Whitebox
Fragment - Assumes:
- Whitebox
Fragment Expand - Whitebox
Fragment Layout - __NA
- __NL
- __
NPlane Vec - __NR
Enums§
- Inner
Layout - Load
Method - Mask
Layout - Layout of an attention-style mask fragment across the units of a plane. Purely comptime — all variants carry only comptime data.
- MmaFragment
- MmaFragment
Expand - Product
Type - Execution mode for the RegisterMatmul
- Scope
Kind - Softmax
Kind - Comptime descriptor for the row-shape used by online softmax. Determines how many rows per unit each running-state vector holds.
- Store
Method - Tile
- Tile
Expand
Constants§
- FULLY_
MASKED_ ROW_ THRESHOLD - Any value smaller than this is considered numerically zero (used for fully-masked rows or tiny contributions). Value chosen to be above f16 smallest normal (~6.1e-5).
- LOGIT_
MASKED - Logits below this are considered masked (effectively -inf). Value chosen to fit within f16 range (~-65,504 max).
Traits§
- Mask
- Minimal mask abstraction used by row-wise tile operations.
Returns
truewhen the element atlocal_posshould be treated as masked (i.e. driven to -inf byTile::scale_and_mask). - Mask
Expand - Minimal mask abstraction used by row-wise tile operations.
Returns
truewhen the element atlocal_posshould be treated as masked (i.e. driven to -inf byTile::scale_and_mask). - Tile
Kind - Kind (family) of the tiles returned by a stage and ingested by a tile matmul reader
- Tile
Scope - Identifies which compute primitive executes a tile matmul.
Functions§
- allocate_
bounce_ tile - Wraps a freshly built
CmmaTilein aTile::Bounce. Panics at expansion time unlessSc = Plane. - allocate_
unit_ tile - Allocates a
Tile::Unit. The variant is valid in any scope — each unit just holds its own row-major copy of the tile. - allocate_
whitebox_ fragment - Allocates a
Tile::WhiteboxFragmentfor the given scope. Panics at expansion time unlessSc = Plane. - assert_
plane_ scope - Comptime assertion that a tile-scope generic resolves to
Plane. - assert_
unit_ scope - Comptime assertion that a tile-scope generic resolves to
Unit. - cmma_
allocate_ acc - cmma_
allocate_ lhs - cmma_
allocate_ rhs - interleaved_
allocate_ acc - interleaved_
allocate_ lhs - interleaved_
allocate_ rhs - mask_
layout_ absolute_ pos - Maps a per-unit
(row, col)to its absolute position within the tile. - mask_
layout_ num_ units_ per_ row - Returns how many units in a plane participate in the same row.
- mma_
allocate_ acc - mma_
allocate_ lhs - mma_
allocate_ rhs - mma_
register_ vector_ sizes - planevec_
allocate_ acc - planevec_
allocate_ lhs - planevec_
allocate_ rhs - register_
allocate_ acc - register_
allocate_ lhs - register_
allocate_ rhs - softmax_
init_ state - Initial running state
(m, l)for the online softmax over a single tile row. - whitebox_
fragment_ absolute_ pos - Maps a per-unit
(row, col)to its absolute position within the tile described bylayout. - whitebox_
fragment_ zero_ slice - Zeroes a slice giving responsibility to units following
layout.