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 struct
StandardOutputWriter
struct StandardOutputWriter
Default OutputWriter policy: local TMA store via TileWriter.
One peer, no cross-GPU synchronization. This is the writer policy
BlackwellMatmulSM100Kernel uses unless a reduce-scatter policy is
injected. Target hardware: SM100 (B200).
Implemented traits
AnyType,
Deinitable,
Movable,
OutputWriter
comptime members
needs_sync
comptime needs_sync = False
num_peers
comptime num_peers = 1
Methods
write_batched
static def write_batched[EpilogueFnType: ElementwiseEpilogueFn, ComputeFnType: ElementwiseComputeFn, //, tma_origin: ImmOrigin, c_type: DType, c_tile_shape: Coord[*c_tile_shape.element_types], c_desc_shape: Coord[*c_desc_shape.element_types], a_type: DType, accum_type: DType, block_tile_shape: Tuple[Int, Int, Int], mma_shape: Tuple[Int, Int, Int], opc: OutputPipelineConfig, c_swizzle: TensorMapSwizzle, transpose_c: Bool, c_smem_dim0: Int, c_smem_dim1: Int, num_output_stages: Int, num_output_warps: Int, has_epilogue_fn: Bool, has_compute_fn: Bool, register_based_epilogue: Bool](c_tma_ops: Pointer[Array[TMATensorTile[c_type, c_tile_shape, c_desc_shape], Int(1)], tma_origin], c_tiles: SMemTileArray2DRowMajor[c_type, c_smem_dim0, c_smem_dim1, num_output_stages], stage: OutputStage[opc], tile_coord: Tuple[UInt32, UInt32, UInt32], shape: Tuple[UInt32, UInt32], epilogue_fn: EpilogueFnType, compute_fn: ComputeFnType, alpha: Float32 = 1)
Local TMA store of one batched output tile (uses descriptor [0]).
Parameters:
- EpilogueFnType (
ElementwiseEpilogueFn): Type of the elementwise epilogue closure. - ComputeFnType (
ElementwiseComputeFn): Type of the compute epilogue closure. - tma_origin (
ImmOrigin): Memory origin of the TMA descriptor pointer (inferred). - c_type (
DType): Element dtype of the C output tensor (inferred). - c_tile_shape (
Coord[*element_types]): Per-tile shape of the C output (inferred). - c_desc_shape (
Coord[*element_types]): TMA descriptor shape for C (inferred). - a_type (
DType): Element dtype of the A input matrix. - accum_type (
DType): Accumulator dtype stored in TMEM. - block_tile_shape (
Tuple[Int, Int, Int]): Block tile shape as (BM, BN, BK). - mma_shape (
Tuple[Int, Int, Int]): MMA instruction shape as (MMA_M, MMA_N, MMA_K). - opc (
OutputPipelineConfig): Output pipeline config bundling accumulator stages, stage stride, and CTA group. - c_swizzle (
TensorMapSwizzle): TMA swizzle pattern for the C SMEM layout. - transpose_c (
Bool): Whether C is stored transposed. - c_smem_dim0 (
Int): Row dimension of the C SMEM tile. - c_smem_dim1 (
Int): Column dimension of the C SMEM tile. - num_output_stages (
Int): Number of C SMEM pipeline stages. - num_output_warps (
Int): Number of warps driving the output pipeline. - has_epilogue_fn (
Bool): Whetherepilogue_fnstores the output instead of the TMA store. - has_compute_fn (
Bool): Whethercompute_fnis applied before the store. - register_based_epilogue (
Bool): Whether the compute epilogue runs in registers (true) or SMEM (false).
Args:
- c_tma_ops (
Pointer[Array[TMATensorTile[c_type, c_tile_shape, c_desc_shape], Int(1)], tma_origin]): Pointer to the array of TMA store descriptors for C. - c_tiles (
SMemTileArray2DRowMajor[c_type, c_smem_dim0, c_smem_dim1, num_output_stages]): SMEM tile array for the C output. - stage (
OutputStage[opc]): OutputStage with pipeline, index, and TMEM handle. - tile_coord (
Tuple[UInt32, UInt32, UInt32]): (m_tile, n_tile, batch) tile coordinates. - shape (
Tuple[UInt32, UInt32]): (M, N) problem dimensions. - epilogue_fn (
EpilogueFnType): Stores each output value; ignored unlesshas_epilogue_fnis True. - compute_fn (
ComputeFnType): Element-wise epilogue applied to each output value; ignored unlesshas_compute_fnis True. - alpha (
Float32): Scalar applied to fragments before the store (defaults to 1.0).