# Roofline microbenchmarks Model-free programs that measure the hardware ceilings used by `docs/roofline.md` and `docs/schedule-design.md`. They load no model and run no engine code. Build in WSL only (never on the server); run on the 5090 only through the holder queue. | program | measures | | --- | --- | | `mb_h2d` | H2D bandwidth by source kind (pinned, registered 4 KiB anon, registered read-only file mapping, pageable), copy size, 1-3 streams, sequential/random offsets; D2H; both directions; registration cost | | `mb_dram` | host DRAM read bandwidth (AVX-512 streaming, and random 2 MB blobs like the CPU expert kernels) by thread count and CCD placement | | `mb_dram_pcie` | the same readers running while 2 MB H2D copies flow: how PCIe and the CPU leg share DRAM | | `mb_gpu` | GPU memory bandwidth; cuBLAS bf16/fp16/int8 throughput for the model's real GEMM shapes, per-expert shapes, decode-sized batches | | `mb_lat` | kernel launch, graph launch, kernel-to-kernel gap (stream and graph), event record / `cuStreamWaitEvent` cost and GPU-side dependency gap, event wait latency, host-flag doorbell round trip, thread wake-up (spin / futex / yield) | | `roofline_model.py` | offline (Python is allowed offline) model: step tables, chunk and window ideals, split analysis | ``` tools/microbench/build.sh # WSL: fat binaries sm_86 + sm_120 in ~/roofline-bin tools/microbench/run_laptop.sh OUT [suite...] # laptop, takes ~/LAPTOP_GPU.lock; suites: lat gpu h2d dram mix tools/microbench/jobs/make_jobs.sh JOBSDIR # writes the five holder jobs 905-909-roofline-*.sh ``` All allocations check `MemAvailable` first and refuse to leave less than 15 GiB (`MB_RESERVE_GIB` overrides). Output lines start with `RESULT`.