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

router_gate_tf32_gemm

def router_gate_tf32_gemm[c_layout: TensorLayout, a_layout: TensorLayout, b_layout: TensorLayout, c_engine: TensorEngine, a_engine: TensorEngine, b_engine: TensorEngine, //, *, cta_group: Int = Int(2)](c: TileTensor[.float32, c_layout, MutAnyOrigin, Engine=c_engine], a: TileTensor[.bfloat16, a_layout, ImmutAnyOrigin, Engine=a_engine], b: TileTensor[.float32, b_layout, ImmutAnyOrigin, Engine=b_engine], m: Int, ctx: DeviceContext)

Computes c = a @ b^T for bf16 a and fp32 b with TF32-class numerics.

Every product is exact (a bf16 activation times a TF32-truncated weight fits in fp32), as in the fp32 matmul's TF32 tensor-core route; only the fp32 accumulation order differs.

Parameters:

  • ​c_layout (TensorLayout): Layout of the fp32 output.
  • ​a_layout (TensorLayout): Layout of the bf16 activation.
  • ​b_layout (TensorLayout): Layout of the fp32 weight.
  • ​c_engine (TensorEngine): Engine of the fp32 output.
  • ​a_engine (TensorEngine): Engine of the bf16 activation.
  • ​b_engine (TensorEngine): Engine of the fp32 weight.
  • ​cta_group (Int): MMA CTA group, 1 or 2.

Args:

Was this page helpful?