STREAM Memory Bandwidth Benchmark
STREAM measures sustainable memory bandwidth — the rate at which data can be transferred between CPU and memory. For most real HPC applications, memory bandwidth is the actual performance bottleneck, not peak FLOPS. Understanding your system's memory bandwidth is essential for predicting real-world application performance.
Four Kernels
STREAM measures four operations: Copy (read+write), Scale (read, multiply, write), Add (read two, write one), Triad (read two, multiply, write one). Triad is the most commonly cited result as it exercises all memory subsystem components.
Typical Results
DDR5 delivers ~90 GB/s per socket. AMD EPYC Genoa with 12-channel DDR5: ~460 GB/s. Intel Xeon with HBM: ~1,000 GB/s. NVIDIA H100 HBM3: 3,350 GB/s. These numbers directly predict performance for memory-bound scientific codes.
Why It Matters
Most HPC applications are memory-bandwidth bound — they fetch data from memory, perform a few operations, and write back. For these codes, STREAM is a far better performance predictor than HPL. If STREAM results are low, application performance will be low regardless of peak FLOPS.
NUMA Considerations
In multi-socket systems, STREAM must be run with proper NUMA awareness. Running without CPU pinning may cause cross-NUMA memory traffic, artificially reducing results. Always run with numactl or OMP_PROC_BIND=close to measure local memory bandwidth accurately.
Array Size Requirements
The STREAM array size must be large enough to exceed all CPU cache levels (L1, L2, L3). Default size is 10M elements — for modern systems with large L3 caches, increase to 100M+ elements to ensure accurate main memory bandwidth measurement.
GPU Memory Bandwidth
GPU variants of STREAM measure HBM bandwidth. H100 achieves 3,350 GB/s — 37× more than a DDR5 CPU socket. This bandwidth advantage explains why GPU clusters dominate AI training and bandwidth-bound simulation. Use BabelStream for GPU STREAM measurement.
Acceptance Testing
STREAM results should be part of every HPC acceptance test. Compare against vendor specifications and published results for identical hardware. A system delivering less than 90% of expected STREAM bandwidth indicates memory configuration issues (wrong speed, wrong channels populated).
Running STREAM
Compile with: gcc -O3 -fopenmp -DSTREAM_ARRAY_SIZE=100000000 stream.c -o stream. Run with all threads: OMP_NUM_THREADS=128 ./stream. Free download at cs.virginia.edu/stream — the most widely used memory benchmark in HPC.