redbluegreen wiki

The box

The one machine this toolchain is written for, and the memory map the GPU sees.

system RAM, 125 GiB, one unified pool GTT window, 96 GiB the GPU may map this 29 GiB CPU only maps streams at 256 GB/s theoretical 225 GB/s measured CPU, 32 threads one virtual address rbg maps it once, at start GPU, gfx1151 writes reads VRAM carve-out, 512 MiB, drawn to a much larger scale held, 90 percent the desktop holds about 90 percent of it GPU page tables are allocated here amdgpu_vm_pt.c: only app APUs use system RAM driver and hardware our code kernel
The GPU maps 96 GiB of the 125 GiB unified pool at 225 GB/s, and its page tables live in the full 512 MiB carve-out.

The design of redbluegreen targets a machine where the CPU and the GPU share a single unified pool of memory. The two reach a buffer through the same virtual address. The pool is system RAM, so the machine is capacity-rich and bandwidth-poor. This lets the machine host large models in memory, but then run slowly, because each weight arrives at memory speed. This bottleneck is also true for training.

The machine is abundant in compute, but its pathway to the memory is narrow.

On boot, the driver gives the GPU a GTT window into the unified memory pool. The CPU owns the rest of the pool. Firmware carves out a small amount of VRAM. On this chip the kernel puts the GPU page tables in that carve-out, because amdgpu_vm_pt.c uses system memory for them only on app APUs, and this part is not one.

The desktop keeps the carve-out near full. A new mapping made while another process runs on the GPU can evict that process's buffer, and that ends in a reset. The reset page gives the full chain.

QuantityValue
System RAM, unified125 GiB
GTT window the GPU may map96 GiB
VRAM carve-out512 MiB
Carve-out held by the desktopabout 90 percent
Bandwidth, theoretical256 GB/s
Bandwidth, measured on a streaming load225 GB/s
CPU threads32
Compute units, wave32 40, with 80 SIMDs

So, our approach to training falls into three rules so far:

  1. Wide batches: one read of a weight feeds many samples.
  2. Training data in GPU memory: a disk read inside the loop costs more than it returns.
  3. The CPU pre-processes in parallel: threads prepare the next batch while the GPU processes the current one.

Sources