02.01

Matmul and activations for inference engineers

skillmaxingInference EngineeringMatmul and activations for inference engineers
Visual lesson

Matmul and activations for inference engineers

Included with Pro · 5:21
Lessons · 1,255 words

Strip away the names and a language model is a list of big matrices and a fixed recipe for multiplying a vector through them. The matrices are the weights. The vectors that flow between them, one per token, are the activations. Almost every number an inference engineer cares about falls out of those two facts: how much memory the model needs, how many operations each token costs, and why reading weights, not doing arithmetic, is often the slow part.

You do not need linear algebra beyond one rule. Multiplying a vector of length d_in by a matrix of shape d_out × d_in produces a vector of length d_out, and it takes one multiply and one add for every entry in the matrix. Hold on to that and a whole model becomes countable.

Pro

Continue reading

Pro unlocks every video lesson, the full notes, worked sizing and cost calculations, and runnable configs across the Inference Engineering course, from GPUs and kernels to quantization, speculative decoding, disaggregation and production autoscaling.

Unlock full access to
Python with AIInference EngineeringAI researchComplete system design
30% off with LAUNCH30first payment
Buy now
View all plans ·Already Pro? Sign in