bmb_report
one HTML page of charts from blas-microbenchmark results
SYNOPSIS
bmb_report [--peak-gflops x] [--peak-gbs y] {result.json|dir}... > report.html
DESCRIPTION
bmb_report turns the JSON results written by the benchmarks of blas-microbenchmark(1) (bmb_routine -o result.json) into one HTML page of charts, written to standard output. A directory stands for every *.json under it, at any depth, taken in name order, so that the same directory always gives the same page.
The page is self-contained: data, styles and script are all inside it and nothing is fetched, so it opens from disk on a machine with no network, and can be sent as a single file. Open it with a browser.
What the page shows
Each part appears only when the results can support it:
- a summary: the best figure for each routine, which leads to its section, and where each series came from (library and the kernels it chose, CPU, caches, OS, date, the CPU frequency governor and turbo where the machine exposed them, and how the files were run: samples and warm-up, batch size, alignment, compiler and CFLAGS, the CPUs allowed, the variables set, with the command lines in a tooltip) — and whether each series was checked against a reference before it was timed, once any was (the benchmarks do it unless run with -C);
- with more than one routine, the routines by level, each leading to its section;
- performance against size, and for levels 1 and 2 bandwidth against size, with the points where a sweep leaves L1, L2 and L3 marked. A matrix measured over a grid of shapes is drawn at its square ones, and a band (gbmv, tbsv) against N at one K: N itself without -M, otherwise the K measured at the most N; the other shapes are in the heatmap. For a series with repeated runs (see Repeated runs and noise), a band shows the spread from the fastest run to the slowest; otherwise, from the fastest sample to the third quartile of the samples, or, in files from before 1.8.0 measured with -s, to the mean;
- with a peak (see The peak), a line at it on the level 3 performance chart, and for levels 1 and 2 a roofline;
- each library compared with a reference, on a log scale centred on ×1, so that twice as slow and twice as fast sit at the same distance from it. The reference is OpenBLAS when there is one, and can be changed on the page. With repeated runs, a hollow point is a difference within run-to-run noise;
- the history of a library measured in three versions or more (see History of a library);
- thread scaling, at the largest size measured at every thread count, against ideal linear scaling;
- a heatmap of every shape, for two-dimension routines measured with both -m and -M;
- the raw data, every row of every file, sortable, with whether each point was checked when any was, and, for level 3, its percentage of the peak when there is one.
The charts come in a section per routine, level 1 first; within a level, operations come in alphabetical order, each one's precisions together in BLAS order: sasum, dasum, scasum, dzasum, then saxpy; sgemm, dgemm, cgemm, zgemm, then zhemm, zherk, dsymm. A GEMM run with -K gets a section per K, or, sweeping K alone at one M × N, one section charted against K. Hovering a chart gives the exact values; the arrow keys do the same from the keyboard.
Series
Results are grouped into series by backend, library version, CPU, label (-l) storage order (-L; a series measured column-major is named so, and results without one, from vector routines or from before 1.4, count as row-major), padding of the leading dimensions (-p; a padded series is named so, and results without one are unpadded) cache (-k; a series measured cold is named so, and results from before 1.8.0 count as hot), fill (--fill; a series of another fill than the pattern is named by it, and results from before 1.11.0 count as the pattern) and the routine's arguments (--trans, --uplo, --side, --diag, --batch-count, --batch-mode; a series with others than the defaults is named by them, and results from before 1.9.0 count as the defaults) and star mode (--star: a series of instances, one a core, is named so, beside the threads of one call at the same count). Files that share all ten make one curve: a sweep extended the next day, or thread counts measured in separate runs, merge on their own. A point measured in more than one file is drawn at the fastest measurement, and the page says so with the gap, so that a run which did not reproduce does not go unnoticed; the others are kept as its runs. To compare two conditions on one machine, give each run its own label.
History of a library
Series that differ only by the library's version — the same backend, CPU, label, storage order, padding, cache, fill and arguments — make a history once there are three of them; two are the comparison chart's. A label that names the version, as bmb_suite --blas openblas-0.3.26=... gives one, counts without it: openblas-0.3.26 and openblas-0.3.28 are one history. For each routine, at the thread count chosen on the page, it shows the largest size every version measured, version after version, ordered by the version number in the library's version string, oldest first. With repeated runs, each version is tested against the one before (see below), and one slower beyond the noise is marked slower. Measure every version on the same machine: a history across machines measures the machines.
Repeated runs and noise
Running the same command several times, each into its own file, gives each point several runs. The figure drawn stays the fastest run, as within a run it is the fastest sample. The band around a curve then shows how far the runs spread, the tooltip gives their number, median and slowest, and the comparison with the reference is tested against that spread: a Mann-Whitney U test on the times of both series' runs, two-sided, at p < 0.05. A point within the noise is drawn hollow, and its tooltip gives the p value.
It takes runs to tell a difference from noise: 4 of each series, or 3 against 5. With 3 against 3, no outcome can reach p < 0.05, so the page says there are too few runs rather than calling the difference noise.
The peak
A figure is judged by what the machine can do once its peak is known: --peak-gflops and --peak-gbs given to the benchmarks, which record them, or given to bmb_report, which overrides them for every result. It is never estimated. The FLOP rate is one core's: a run at t threads is judged by t cores' peak, a thread a core. The one given to the benchmarks is in the routine's own precision; the one given to bmb_report is in double precision, and taken as twice it for single, as vector units do twice the floats. A routine whose inputs are of another type than its output (sbgemm, bfloat16 into float) has no such ratio: only the peak its results were given counts. Each routine's section says the peak its charts use, and where it came from.
Level 3, which can approach the FLOP peak, shows a line at it on the performance chart, and each point's percentage of it in its tooltip and the raw data. Levels 1 and 2, which are bound by memory, show a roofline: each size a dot, at its arithmetic intensity, its GFLOP/s over its GB/s — the FLOPs a byte its counts give — under the memory roof, the bandwidth times the intensity, and the compute roof, the peak; both scales are logarithmic, and each dot's tooltip gives its percentage of the roof. Without the bandwidth there is no roofline, and the FLOP peak is not used. The routines that do no arithmetic (copy, swap, i?amax) have none: their bandwidth chart shows a line at the bandwidth instead. The memory roof is the bandwidth of memory: a size held in a cache goes above it.
What it accepts
Results of the same major version as bmb_report itself. Anything else is refused before a page is written, with the file name and the reason: results from before 0.6.0 measured a mean rather than the fastest sample, and those from 0.6.x do not record the machine. One refused file means no page at all, since a page missing a library would be read as complete.
OPTIONS
- --peak-gflops x
- One core's peak FLOP rate, in GFLOP/s, in double precision, for every result: see The peak. A plain decimal above 0 and up to 1000000. Default: the peak each result carries, if any.
- --peak-gbs y
- The machine's memory bandwidth, in GB/s, for every result: the roofline's memory roof. As --peak-gflops. Default: the bandwidth each result carries, if any.
- -h, --help
- Show a summary of the usage.
- -V, --version
- Show the version.
EXIT STATUS
0 when the page was written; 1 when a file was refused, and then nothing is written; 2 for a usage error, including standard output being a terminal — the page is HTML, to be redirected to a file.
EXAMPLES
OpenBLAS against BLIS, each build run with the same commands:
bmb_dgemm -m 128:2048 -t 1:8 -o results/dgemm-openblas.json bmb_dgemm -m 128:2048 -t 1:8 -o results/dgemm-blis.json # BLIS build bmb_report results/*.json > report.html firefox report.html
A directory a library, given as a whole:
bmb_report results/ > report.html # results/openblas/*.json, results/blis/*.json
With one build against FlexiBLAS, the library is chosen when it runs, and each comes out as its own series:
FLEXIBLAS=OPENBLAS-OPENMP bmb_dgemm -m 128:2048 -o results/dgemm-openblas.json FLEXIBLAS=BLIS-OPENMP bmb_dgemm -m 128:2048 -o results/dgemm-blis.json bmb_report results/*.json > report.html
Three versions of OpenBLAS, each installed in turn, five runs each, make a history (the version comes from the library itself):
for i in 1 2 3 4 5; do bmb_dgemm -m 1024 -o results/openblas-0.3.28-$i.json; done bmb_report results/*.json > report.html
The same, five runs of each, so that the comparison says which differences are beyond noise:
for i in 1 2 3 4 5; do bmb_dgemm -m 1024 -o results/openblas-$i.json; done bmb_report results/*.json > report.html
SEE ALSO
blas-microbenchmark(1), bmb_suite(1)
The guides — installing, comparing libraries, on an HPC cluster, ReFrame — and this manual online: https://mathieucaissa.github.io/blas-microbenchmark/
The source: https://github.com/MathieuCAISSA/blas-microbenchmark