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:
- c (
TileTensor[.float32, c_layout, MutAnyOrigin, Engine=c_engine]): Output[M, N]fp32 tensor. - a (
TileTensor[.bfloat16, a_layout, ImmutAnyOrigin, Engine=a_engine]): Activation[M, K]bf16 tensor. - b (
TileTensor[.float32, b_layout, ImmutAnyOrigin, Engine=b_engine]): Weight[N, K]fp32 tensor (transpose_b layout), static shape. - m (
Int): Runtime row count. - ctx (
DeviceContext): The device context.