For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo function
build_configs
def build_configs[a_type: DType, b_type: DType, c_type: DType, N: Int, K: Int, transpose_b: Bool = True, num_k_partitions: Int = Int(1), partitioned_multicast: Bool = False, pdl_level: PDLLevel = PDLLevel.OFF, k_groups: Optional[Int] = None, consumer_groups: Optional[Int] = None, swapAB: Bool = False]() -> Set[MatmulConfig[a_type, b_type, c_type, transpose_b]]
Builds the set of unique SM90 MatmulConfig instances for a fixed (N, K) and all M values.
Sweeps M from 8 to 8192 to enumerate the distinct configs the heuristic produces for the given (N, K). Duplicate configs (same tile/cluster shape) are deduplicated via set membership.
Parameters:
- βa_type (
DType): ElementDTypeof the A input matrix. - βb_type (
DType): ElementDTypeof the B input matrix. - βc_type (
DType): ElementDTypeof the output C matrix. - βN (
Int): The N dimension (columns) of the matmul, fixed across the M sweep. - βK (
Int): The K dimension (contraction axis) of the matmul. - βtranspose_b (
Bool): WhetherBis stored transposed (K-major layout) (defaults toTrue). - βnum_k_partitions (
Int): Number of partitions to split the K dimension into (defaults to 1). - βpartitioned_multicast (
Bool): Whether to use partitioned TMA multicast (defaults toFalse). - βpdl_level (
PDLLevel): Programmatic dependent launch level for grid controls (defaults toPDLLevel.OFF). - βk_groups (
Optional[Int]): Optional override for the K-grouping size;Nonelets the heuristic decide (defaults toNone). - βconsumer_groups (
Optional[Int]): Optional override for the number of consumer warp groups;Nonelets the heuristic decide (defaults toNone). - βswapAB (
Bool): Whether to swap the A and B roles, treatingNasM(defaults toFalse).
Returns:
Set[MatmulConfig[a_type, b_type, c_type, transpose_b]]: A set of unique MatmulConfig values covering the M sweep.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!