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
matmul_sm100_fallback
def matmul_sm100_fallback[ComputeFnType: ElementwiseComputeFn = inflated$def[comptime[dtype: DType, width: SIMDLength, *, alignment: Int] #kgen.func.symbol<@linalg::@utils::@"identity_compute_fn[::DType,::SIMDLength,::SIMD[DType.int, 1],KGENParamList[::Intable & ::Defaultable & ::RegisterPassable & ::TrivialRegisterPassable & ::Writable & ::AnyType & ::Copyable & ::ImplicitlyCopyable & ::Deinitable & ::Movable & ::CoordLike],::TypeList[::Intable & ::Defaultable & ::RegisterPassable & ::TrivialRegisterPassable & ::Writable & ::AnyType & ::Copyable & ::ImplicitlyCopyable & ::Deinitable & ::Movable & ::CoordLike, $3]](::Coord[$3, $4],::SIMD[$0, $1])"<:!lit.struct<@std::@builtin::@dtype::@DType> dtype, :!lit.struct<@std::@builtin::@simd_length::@SIMDLength> width, :!lit.struct<@std::@simd::@SIMD<:!lit.struct<@std::@builtin::@dtype::@DType> {:dtype index}, :!lit.struct<@std::@builtin::@simd_length::@SIMDLength> {1}>> alignment, :param_list<trait<@std::@builtin::@int::@Intable, @std::@builtin::@value::@Defaultable, @std::@builtin::@value::@RegisterPassable, @std::@builtin::@value::@TrivialRegisterPassable, @std::@format::@__init__::@Writable, @std::@traits::@anytype::@AnyType, @std::@traits::@copyable::@Copyable, @std::@traits::@copyable::@ImplicitlyCopyable, @std::@traits::@deinitable::@Deinitable, @std::@traits::@movable::@Movable, @std::@utils::@coord::@CoordLike>> *?, :!lit.struct<@std::@builtin::@variadics::@TypeList<:meta<!lit.trait<@std::@traits::@anytype::@AnyType>> trait<@std::@builtin::@int::@Intable, @std::@builtin::@value::@Defaultable, @std::@builtin::@value::@RegisterPassable, @std::@builtin::@value::@TrivialRegisterPassable, @std::@format::@__init__::@Writable, @std::@traits::@anytype::@AnyType, @std::@traits::@copyable::@Copyable, @std::@traits::@copyable::@ImplicitlyCopyable, @std::@traits::@deinitable::@Deinitable, @std::@traits::@movable::@Movable, @std::@utils::@coord::@CoordLike>, :param_list<trait<@std::@builtin::@int::@Intable, @std::@builtin::@value::@Defaultable, @std::@builtin::@value::@RegisterPassable, @std::@builtin::@value::@TrivialRegisterPassable, @std::@format::@__init__::@Writable, @std::@traits::@anytype::@AnyType, @std::@traits::@copyable::@Copyable, @std::@traits::@copyable::@ImplicitlyCopyable, @std::@traits::@deinitable::@Deinitable, @std::@traits::@movable::@Movable, @std::@utils::@coord::@CoordLike>> *?>> *?>>], //, c_type: DType, a_type: DType, b_type: DType, *, transpose_b: Bool, umma_shape: Tuple[Int, Int, Int], block_tile_shape: Tuple[Int, Int, Int], a_swizzle: TensorMapSwizzle = TensorMapSwizzle.SWIZZLE_128B, b_swizzle: TensorMapSwizzle = TensorMapSwizzle.SWIZZLE_128B, has_compute_fn: Bool = False](c: TileTensor[Engine=c.Engine, address_space=c.address_space, linear_idx_type=c.linear_idx_type], a: TileTensor[Engine=a.Engine, address_space=a.address_space, linear_idx_type=a.linear_idx_type], b: TileTensor[Engine=b.Engine, address_space=b.address_space, linear_idx_type=b.linear_idx_type], ctx: DeviceContext, compute_fn: ComputeFnType = no_compute_fn)
Launches the SM100 fallback matmul kernel for unsupported shapes or dtypes.
Uses a simple non-pipelined kernel without CLC/TMEM overhead, computing shared memory from the actual tile sizes rather than the hardware maximum. Only transposed-B, bfloat16, and float8_e4m3fn inputs are supported.
Parameters:
- ComputeFnType (
ElementwiseComputeFn): Type ofcompute_fn(inferred). - c_type (
DType): Output element dtype of the result matrix. - a_type (
DType): Input element dtype of the LHS matrix; must bebfloat16orfloat8_e4m3fn. - b_type (
DType): Input element dtype of the RHS matrix; must equala_type. - transpose_b (
Bool): Whether B is stored transposed as (N, K). Must be True. - umma_shape (
Tuple[Int, Int, Int]): Tensor core MMA instruction shape as a 3-elementIndexListof (M, N, K). - block_tile_shape (
Tuple[Int, Int, Int]): CTA block tile shape as a 3-elementIndexListof (BM, BN, BK) giving the tile dimensions along M, N, and K. - a_swizzle (
TensorMapSwizzle): TMA swizzle mode for A tensor loads (defaults toSWIZZLE_128B). - b_swizzle (
TensorMapSwizzle): TMA swizzle mode for B tensor loads (defaults toSWIZZLE_128B). - has_compute_fn (
Bool): Whether to applycompute_fnto each output value before it is stored (defaults to False).
Args:
- c (
TileTensor[Engine=c.Engine, address_space=c.address_space, linear_idx_type=c.linear_idx_type]): Output TileTensor of shape (M, N). - a (
TileTensor[Engine=a.Engine, address_space=a.address_space, linear_idx_type=a.linear_idx_type]): LHS TileTensor of shape (M, K). - b (
TileTensor[Engine=b.Engine, address_space=b.address_space, linear_idx_type=b.linear_idx_type]): RHS TileTensor of shape (N, K) (transposed). - ctx (
DeviceContext): Device context used to create TMA descriptors and enqueue the kernel. - compute_fn (
ComputeFnType): Element-wise epilogue applied to each output value; ignored unlesshas_compute_fnis True.