AI engineering glossary · Linear algebra
What is batch matrix multiplication?
Batch matrix multiplication (also called Batched matmul): Multiplying many pairs of matrices at once, where a leading batch axis picks out each pair. Deep learning frameworks use it to run the same layer on a whole batch of inputs, or on many attention heads, in one efficient GPU call.
Batch matrix multiplication: an example
Multiplying tensors of shape (8, 64, 32) and (8, 32, 16) gives (8, 64, 16): eight independent matrix products.
Related terms
More Linear algebra terms
- Change of basis
- Characteristic polynomial
- Cholesky decomposition
- Column space
- Column vector
- Cosine similarity
- Covariance matrix
- Cross product
Where you learn it
Batch matrix multiplication is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.