IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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_compute_fn

def gemm_mma_cpasync_kernel_compute_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, ComputeFnType: ElementwiseComputeFn, *, 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, compute_fn: ComputeFnType)

gemm_mma_cpasync_kernel that stores compute_fn applied to each output element.

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.
  • ​ComputeFnType (ElementwiseComputeFn): Type of compute_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:

Was this page helpful?