IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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_default_matmul_schedule

def build_default_matmul_schedule[num_k_tiles: Int, num_m_mmas: Int, num_n_mmas: Int, num_k_mmas: Int, MMA_M: Int, MMA_N: Int, a_loads_per_thread: Int, b_loads_per_thread: Int]() -> ScheduleCompiler

Build the complete software pipeline schedule for the default matmul.

Uses ScheduleCompiler with SingleBufferSchedule trait implementation. All phases derived from the logical body; no magic numbers in derivation.

Returns a ScheduleCompiler with all phases as Lists. Use as a comptime value; the kernel reads entries via comptime for.

Parameters:

  • ​num_k_tiles (Int): Number of K-tiles along the contraction dimension, each producing one fragment load and one MMA compute op.
  • ​num_m_mmas (Int): Number of MMA tiles along the M dimension of the output tile.
  • ​num_n_mmas (Int): Number of MMA tiles along the N dimension of the output tile.
  • ​num_k_mmas (Int): Number of MMA tiles along the K dimension per COMPUTE body op.
  • ​MMA_M (Int): M dimension of a single MMA instruction (for example 16 or 32).
  • ​MMA_N (Int): N dimension of a single MMA instruction (for example 16 or 32).
  • ​a_loads_per_thread (Int): Number of DS_WRITE ops per STORE_SMEM for the A operand tile.
  • ​b_loads_per_thread (Int): Number of DS_WRITE ops per STORE_SMEM for the B operand tile.

Returns:

ScheduleCompiler

Was this page helpful?