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
select_config
def select_config[a_type: DType, b_type: DType, c_type: DType, transpose_b: Bool = False](M: Int, N: Int, K: Int, ctx: DeviceContext) -> MatmulConfig[a_type, b_type, c_type, transpose_b]
Selects a heuristic-optimal MatmulConfig for the given problem shape and device.
Evaluates candidate block tile shapes and split-K partition counts, then chooses the configuration that minimizes estimated work per streaming multiprocessor while keeping the wave count bounded.
Parameters:
- βa_type (
DType): TheDTypeof the left-hand operandA. - βb_type (
DType): TheDTypeof the right-hand operandB. - βc_type (
DType): TheDTypeof the outputC. - βtranspose_b (
Bool): WhetherBis supplied transposed (defaults toFalse).
Args:
- βM (
Int): The M dimension of the matmul. - βN (
Int): The N dimension of the matmul. - βK (
Int): The K dimension of the matmul. - βctx (
DeviceContext): The device context used to query GPU properties.
Returns:
MatmulConfig[a_type, b_type, c_type, transpose_b]: The selected MatmulConfig for the given problem.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!