Cradle
Under a brass lamp in a night workshop, a small electrical transformer sleeps in a wooden cradle, its red power cord unplugged.

Let’s Build a Transformer!

Cradle

A transformer, built one piece at a time in C#.

Explore the series

The series

0 of 18 lessons published

Start here · Prologue

Prologue: Getting the cradle ready

Set up the tools, build the starting program, and check the dependencies we’ll use in the first lesson.

Published ·

Latest: Prologue: Getting the cradle ready

  1. The cradle Planned

    Run our first kernel on the GPU.

  2. Buffers and shapes Planned

    Give the data a shape we can work with.

  3. Matrix multiplication Planned

    Build the operation at the heart of the model.

  4. Softmax Planned

    Turn scores into a stable distribution.

View the full series

The approach

One program. Room to grow.

We begin with a kernel running on the GPU. Each lesson adds an operation we can inspect and test, until the same C# program loads model weights and generates text.

About the project