Pidoku
10ML Foundations
On this page

ML Foundations

Module 1012 lessons~15h 30m

Lessons, in order

10.a Vectors and MatricesThat is all the vocabulary this lesson needs. The rest is what you can do with these objects. 1h 10.b Matrix Multiplication by HandMatrix multiplication ("matmul") is 90–95% of the arithmetic in language-model inference. Modules 4–6, 13 and 14 are, in the end, about making this one operation faster. Do the exercises by … 1h 15m 10.c Tensors, Shapes, and BroadcastingA tensor is an n-dimensional array of numbers. Broadcasting is the rule that lets an operation between two tensors of different shapes work without explicitly copying data: 1h 10.d Neural Networks from ScratchA neural network is a stack of linear steps (matrix multiplications) alternating with non-linear steps (activation functions): 1h 30m 10.e Activation FunctionsAn activation function is a simple non-linear function applied to every number in a tensor separately. It usually has no parameters and never mixes numbers together. 45 min 10.f EmbeddingsAn embedding is a learned vector that stands for a discrete thing. The embedding table holds one row per vocabulary item: 1h 10.g Softmax and Numerical StabilityThe "online softmax" trick in section 5 is the mathematical core of FlashAttention. Understand it here and 13.l will be easy. 1h 15m 10.h Attention from First PrinciplesThis is the most important lesson in Module 10. Everything in Module 12 depends on understanding it mechanically, not just conceptually. 2h 10.i The TransformerA transformer is attention (10.h) and a feed-forward network (10.d), stacked with residual connections and normalisation, repeated L times: 2h 10.j Training vs Inference: The MathA precise accounting, in FLOPs and bytes, of what training does that inference does not. Lesson 1.b gave the operational differences; this lesson gives the arithmetic behind the two numbers … 45 min 10.k Number Formats: FP32, FP16, BF16, FP8, INT8, INT4, FP4How a number is encoded in bits. The choice determines memory footprint, memory bandwidth, arithmetic throughput, and how much precision you lose. 1h 30m 10.l Quantization FundamentalsThis lesson teaches the mechanism. Module 13 covers the production methods (GPTQ, AWQ, SmoothQuant, FP8, FP4), which one to choose, and the measured gains (13.b). 1h 30m

About this module

Just enough maths and machine learning to understand what the GPU is computing: vectors and matrices, matmul by hand, tensors and broadcasting, neural networks from scratch, activations, embeddings, softmax, attention from first principles, the transformer, number formats and the fundamentals of quantization.

Lessons#

#LessonTime
10.aVectors and Matrices60 min
10.bMatrix Multiplication by Hand75 min
10.cTensors, Shapes, and Broadcasting60 min
10.dNeural Networks from Scratch90 min
10.eActivation Functions45 min
10.fEmbeddings60 min
10.gSoftmax and Numerical Stability75 min
10.hAttention from First Principles120 min
10.iThe Transformer120 min
10.jTraining vs Inference: The Math45 min
10.kNumber Formats: FP32, FP16, BF16, FP8, INT8, INT4, FP490 min
10.lQuantization Fundamentals90 min

Previous: Networking · Next: Models as Computation

↑↓ navigate↵ openesc close

100% drag to pan · scroll or pinch to zoom · double-click to zoom in