What I cannot create, I do not understand.

Richard Feynman
Animated Feynman diagram of an electron interacting with a photon. Loops of virtual particles are added one at a time, and the digits show how much of the electron's measured magnetic moment each order of quantum electrodynamics gets right.

g/2 =1.00115965218059

No loops Dirac's theory gives exactly 1, right to 3 digits.

Your pointer is the photon: bring it closer to the vertex to add loops.

Read in order

xGeMM

Writing single-precision matrix multiplication from scratch in CUDA, one optimisation at a time, until it gets close to cuBLAS.

7 parts, about 45 minutes in total

  1. 0Why matrix multiplication matters
  2. 1Getting started with CUDA
  3. 2Global memory coalescing
  4. 3Shared memory
  5. 41D thread coarsening
  6. 52D thread coarsening
  7. 6Vectorized memory access
Matrix C being computed tile by tile from rows of A and columns of B
C = A × B, 0 of 64 tiles computed

Read in any order

Miscellaneous

Standalone posts on whatever I was learning at the time, from caches and automatic differentiation to Julia and tooling. Each one stands on its own.

cudagputensor-coresjuliatoolingc

Start here

Hand-picked, if you only read a few.

All writing

14 posts, newest first

2024

2022

2021