Explore SME matrix operations with interactive visualizations
Introduction
Explore the ZA tile layout
Transpose a 32-bit matrix in place with ZA
Transpose a matrix with an incomplete edge
Multiply matrices with vector outer products
Transpose and pack matrix A
Pad matrix B to the ZA tile width
Trace packed GEMM through ZA
Compare a GEMM with gather loads
Interleave matrix A
Trace GEMM with interleaved matrix A
Next Steps
Explore SME matrix operations with interactive visualizations
Introduction
Explore the ZA tile layout
Transpose a 32-bit matrix in place with ZA
Transpose a matrix with an incomplete edge
Multiply matrices with vector outer products
Transpose and pack matrix A
Pad matrix B to the ZA tile width
Trace packed GEMM through ZA
Compare a GEMM with gather loads
Interleave matrix A
Trace GEMM with interleaved matrix A
Next Steps
Handle real-world matrix sizes
Real matrices don’t always divide evenly into vector-sized blocks. The following visualization adds a two-element edge beyond the complete 32-bit blocks. It separates Input Matrix Data from Output Matrix Data. That way, you can follow the remaining values without losing sight of the original input.
To keep this Learning Path open while exploring, open the incomplete-edge transpose visualization in a separate browser tab. Move the tab to a separate window to view the visualization and Learning Path side by side.
Follow the edge values
Select the play button or advance manually to follow the algorithm. The table shows how each group of Input Matrix Data columns moves through ZA0–ZA2:
| Stage | Number of steps | Operation |
|---|---|---|
| Load the first block | 10 | Load rows from the first four columns of Input Matrix Data into rows of ZA0–ZA2. |
| Store the first block | 12 | Store data sequentially in Output Matrix Data from columns of ZA0–ZA2. |
| Load the second block | 10 | Load rows from the next four columns of Input Matrix Data into rows of ZA0–ZA2. |
| Store the second block | 12 | Store data sequentially in Output Matrix Data from columns of ZA0–ZA2. |
| Load the edge block | 10 | Load partial rows from the last two columns of Input Matrix Data into rows of ZA0–ZA2. Only two data values per row are loaded into ZA tiles. This is achieved by using a predicate mask that marks only two columns as active. |
| Store the edge block | 6 | Store data sequentially in Output Matrix Data from columns of ZA0–ZA2. Only two columns are active during the final store, so it takes six steps instead of 12. |
What you’ve learned and what’s next
You’ve learned that the final block can contain fewer valid elements than a full tile. Predicate masks constrain which rows or columns the Scalable Matrix Extension (SME) operations act on. You therefore don’t need any special handling of the final loop.
Next, you’ll learn how to vectorize matrix multiplication.