redbluegreen wiki

redbluegreen wiki

A GPU training toolchain for one machine, written down so the reasoning survives.

redbluegreen is a GPU training toolchain for the AMD Strix Halo APU. We build it from the kernel interface up with no GPU userspace under it.

uses 7. data resident in GPU memory not yet 6. loop not yet 5. optimizer not yet 4. autograd not yet 3. kernels store42 vadd two kernels 2. memory unit 2 1. kfd and queue units 1, 3, 5b no GPU userspace between kfd driver, AMD Strix Halo APU driver, hardware built not yet kernel, GPU ISA driver and hardware
The seven layers in dependency order. Units 1 to 5b built layers 1 and 2 and the first two kernels; layers 3 to 7 do not exist yet.

The seven layers, in dependency order:

  1. kfd and queue
  2. memory
  3. kernels
  4. autograd
  5. optimizer
  6. loop
  7. data resident in GPU memory

Each layer uses only the layer below it. Nothing above layer 3 exists yet.

The units so far:

  1. Talk to the driver: GET_VERSION and ACQUIRE_VM.
  2. Own memory: ALLOC, MAP and a host view.
  3. Own the queue: Drop types, an AQL queue and an event.
  4. Dispatch one kernel that writes 42.
  5. Add two vectors at 225 GB/s.

The toolchain has zero external dependencies at run time. The build needs llvm-mc and llvm-objcopy to assemble kernels, and rustc. There are no crates.

Contents

  1. 01The box
  2. 02The floor
  3. 03Memory
  4. 04The queue
  5. 05Ownership
  6. 06Dispatch
  7. 07 Completion
  8. 08Bandwidth
  9. 09The bisect
  10. 10 The reset chain
  11. 11Method