0Pricing
Mojo Academy · Lesson

Building a Matmul Step by Step

From naive loops to a real kernel.

What Matmul Computes

Matrix multiply, or matmul, combines an M by K matrix with a K by N matrix to produce an M by N result. It is the heart of AI math.

The Dot Product Rule

Each output cell is a dot product: walk across one row of A and down one column of B, multiplying and summing as you go.

All lessons in this course

  1. Modeling a Tensor in Mojo
  2. Building a Matmul Step by Step
  3. Optimizing the Inner Product
  4. Verifying Numeric Correctness
← Back to Mojo Academy