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
- Modeling a Tensor in Mojo
- Building a Matmul Step by Step
- Optimizing the Inner Product
- Verifying Numeric Correctness