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
gemm_mma_cpasync_kernel_epilogue_fn
def gemm_mma_cpasync_kernel_epilogue_fn[c_type: DType, a_type: DType, b_type: DType, c_layout: TensorLayout, a_layout: TensorLayout, b_layout: TensorLayout, c_engine: TensorEngine, a_engine: TensorEngine, b_engine: TensorEngine, EpilogueFnType: ElementwiseEpilogueFn, *, tile_m: Int = Int(16), tile_n: Int = Int(8), tile_k: Int = Int(128), stage_cnt: Int = Int(2), accum_type: DType = .float32, pdl_level: PDLLevel = PDLLevel(), swapAB: Bool = False](output: TileTensor[c_type, c_layout, MutAnyOrigin, Engine=c_engine], act: TileTensor[a_type, a_layout, ImmutAnyOrigin, Engine=a_engine], weight: TileTensor[b_type, b_layout, ImmutAnyOrigin, Engine=b_engine], gemm_m: Int32, gemm_k: Int32, gemm_n: Int32, batch_size: Int32, epilogue_fn: EpilogueFnType)
gemm_mma_cpasync_kernel that writes its output through epilogue_fn.
Parameters:
- c_type (
DType): Output element type. - a_type (
DType): Activation element type. - b_type (
DType): Weight element type. - c_layout (
TensorLayout): Layout of the output tensor. - a_layout (
TensorLayout): Layout of the activation tensor. - b_layout (
TensorLayout): Layout of the weight tensor. - c_engine (
TensorEngine): Engine of the output tensor. - a_engine (
TensorEngine): Engine of the activation tensor. - b_engine (
TensorEngine): Engine of the weight tensor. - EpilogueFnType (
ElementwiseEpilogueFn): Type ofepilogue_fn. - tile_m (
Int): CTA tile rows; must be 16 for the m16n8k16 MMA. - tile_n (
Int): CTA tile columns; must be 8 for the m16n8k16 MMA. - tile_k (
Int): K-dimension tile size. - stage_cnt (
Int): Number of shared-memory pipeline stages. - accum_type (
DType): Accumulation precision type. - pdl_level (
PDLLevel): Programmatic dependent launch level. - swapAB (
Bool): Whether the launcher fed the weight to the A operand slot.
Args:
- output (
TileTensor[c_type, c_layout, MutAnyOrigin, Engine=c_engine]): Row-major[batch, M, N]output tensor. Only its shape is read;epilogue_fnstores the result. - act (
TileTensor[a_type, a_layout, ImmutAnyOrigin, Engine=a_engine]): Activation tensor, the A operand. - weight (
TileTensor[b_type, b_layout, ImmutAnyOrigin, Engine=b_engine]): Weight tensor, the B operand. - gemm_m (
Int32): Rows of the A operand. - gemm_k (
Int32): Reduction dimension. - gemm_n (
Int32): Rows of the B operand. - batch_size (
Int32): Batch size. - epilogue_fn (
EpilogueFnType): Stores each output element.