gpu-microbench / README.md
shubhamk1729's picture
Upload README.md with huggingface_hub
365a153 verified
|
Raw History Blame Contribute Delete
3 kB
metadata
license: apache-2.0
pretty_name: Measured GPU microbenchmarks for transformer training
tags:
  - benchmark
  - gpu
  - performance
  - roofline
  - transformers
  - training
configs:
  - config_name: summary
    data_files: summary.csv
  - config_name: matmul
    data_files: data/*/matmul.csv
  - config_name: bandwidth
    data_files: data/*/bandwidth.csv
  - config_name: train_step
    data_files: data/*/train_step.csv

Measured GPU microbenchmarks for transformer training

Measured numbers for the GPUs most people can actually get on Colab and Kaggle: matmul throughput across sizes, memory bandwidth, kernel launch overhead, and GPT-2-small (124M) training-step time, each recorded with the GPU clock, power and temperature during the run.

Summary

GPU Platform fp16 burst TFLOP/s fp16 model-shape TFLOP/s fp32 TFLOP/s Copy GB/s Launch µs Step ms Tokens/s Noise % Clock MHz (step) Power W (step)
Tesla T4 colab 40.18 23.09 4.16 232.9 8.15 516.55 15866 3.98 788 66.7
NVIDIA L4 colab 75.1 49.06 15.9 229.9 8.67 283.11 28938 1.44 991 72.0
NVIDIA RTX PRO 6000 Blackwell Server Edition colab 427.06 276.96 77.1 1459.1 3.32 45.0 182054 0.04 2338 504.2

Baseline step: GPT-2-small (124M), context 1024, batch 8, fp16 autocast, AdamW. "fp16 model shapes" is the median throughput over the four matmul shapes that step actually runs.

Method

  • Device time from CUDA events; median of 20–50 iterations after warm-up.
  • Before each training-step measurement, 10 s of matmuls bring the GPU to its steady-state clock.
  • Clock, power and temperature are sampled every 0.5 s during the timed run (reading them afterwards is wrong: an idle GPU boosts instantly).
  • fp32 means real fp32: TF32 is disabled. bf16 is excluded on GPUs without native bf16.
  • FLOPs for the training step use 6 × params × tokens plus attention, a rule of thumb.

Files

data/<gpu>_<platform>/: matmul.csv, bandwidth.csv, train_step.csv, hardware.json (the fact sheet), and per-GPU figures. summary.csv has one row per GPU. figures/ has cross-GPU charts.

Caveats

  • One chip per GPU type and one session each. Chips of the same model can differ (two T4s here ran ~10% apart in clock at the same power).
  • Power-capped GPUs (T4, L4) vary 3–4% run to run with temperature; compare runs measured back to back, as ratios.
  • Small buffers in the bandwidth sweep can fit in L2 cache and read far above DRAM bandwidth.
  • Launch overhead is timed from Python, so it depends on the host CPU as well as the GPU.
  • A second T4 session measured 34.7 µs launch overhead, likely host-CPU contention; the table uses the first session's 8.15 µs (Kaggle T4: 7.85 µs).

Contribute a GPU

Run the notebook from the accompanying repository on any NVIDIA GPU and open a pull request on this dataset with your results folder.