Let's Build a Transformer!
5 parts. Read in order.
7 min read
Let's Build a Transformer! · Part 0
Prologue: Getting the cradle ready
Set up the tools, build the starting program, and check the dependencies we’ll use in the first lesson.
15 min read
Let's Build a Transformer! · Part 1The cradle
Find a GPU, run our first C# kernel, and check every result before building on it.
23 min read
Let's Build a Transformer! · Part 2Buffers and shapes
Give our data rows and columns, make ownership explicit, and add matrices on the GPU.
14 min read
Let's Build a Transformer! · Part 3Matrix multiplication
Build a GPU kernel that computes one matrix-product element per invocation, then use it to apply weights to a vector.
18 min read
Let's Build a Transformer! · Part 4Softmax
Turn raw model scores into a probability distribution, build softmax on the GPU, and fix the overflow that breaks its first implementation.