tilelang.cuda.language.gemm_opΒΆ
CUDA dialect of T.gemm: the common GEMM plus CUDA-specific knobs.
FunctionsΒΆ
Module ContentsΒΆ
- tilelang.cuda.language.gemm_op.gemm(A, B, C, transpose_A=False, transpose_B=False, policy=GemmWarpPolicy.Square, clear_accum=False, mbar=None, annotations=None)ΒΆ
TileLang GEMM operator for CUDA.
Same semantics as the common
tilelang.language.gemm_op.gemm(): the default synchronous GEMM. On Hopper, if the compiler selects WGMMA lowering, TileLang inserts the corresponding wait implicitly. On Blackwell TCGEN5MMA, TileLang inserts the correspondingmbarrier_wait_parity(...)implicitly after issue.For manual asynchronous scheduling, use
T.wgmma_gemm(...)withT.wait_wgmma(...)on Hopper, orT.tcgen05_gemm(...)withT.mbarrier_wait_parity(...)on Blackwell.- Parameters:
A (BufferLikeType, i.e. Buffer | BufferLoad | BufferRegion, or Var) β Input buffer A.
B (BufferLikeType) β Input buffer B.
C (BufferLikeType) β Output buffer C.
transpose_A (bool) β Whether to transpose A. Defaults to False.
transpose_B (bool) β Whether to transpose B. Defaults to False.
policy (GemmWarpPolicy) β GEMM warp partition policy.
clear_accum (bool) β Whether to clear the accumulator.
mbar (BarrierType, i.e. Buffer | BufferLoad, or Var, optional) β Mbarrier in Blackwell. Required when this GEMM lowers to TCGEN5MMA. Defaults to None.
annotations (Optional[dict]) β Additional annotations.
- Returns:
A handle to the GEMM operation.
- Return type:
tirx.Call
- tilelang.cuda.language.gemm_op.gemm_sp(A_sparse, E, B, C, transpose_A=False, transpose_E=False, transpose_B=False, policy=GemmWarpPolicy.Square, clear_accum=False, wg_wait=0, annotations=None)ΒΆ
Sparse GEMM (2:4 structured sparsity) for CUDA.
Same semantics as the common
tilelang.language.experimental.gemm_sp_op.gemm_sp().wg_waitis the Hopper warpgroup wait count consumed when the WGMMA SP lowering is selected (-1defers the wait to an explicitT.wait_wgmma); it rides in the tile-op annotations.- Parameters:
A_sparse (tilelang._typing.BufferLikeType | tvm.tirx.Var) β Compressed sparse matrix containing only non-zero elements.
E (tilelang._typing.BufferLikeType | tvm.tirx.Var) β Metadata tensor encoding the sparsity pattern of A.
B (tilelang._typing.BufferLikeType | tvm.tirx.Var) β Dense input matrix.
C (tilelang._typing.BufferLikeType | tvm.tirx.Var) β Output accumulator matrix.
transpose_A (bool) β Whether to transpose A. Defaults to False.
transpose_E (bool) β Whether to transpose E. Defaults to False.
transpose_B (bool) β Whether to transpose B. Defaults to False.
policy (tilelang.language.gemm_op.GemmWarpPolicy) β Warp partition policy. Defaults to GemmWarpPolicy.Square.
clear_accum (bool) β Whether to zero the accumulator before computation. Defaults to False.
wg_wait (int) β Warp group wait count. Defaults to 0.
annotations (dict | None) β Additional annotations; values in it take precedence.
- Returns:
A handle to the sparse GEMM operation.
- Return type:
tirx.Call