Overview
microbenchmarks for BLAS routines .\" END routines (man-name)
SYNOPSIS
bmb_routine [options]
DESCRIPTION
Each bmb_routine times one BLAS routine, called through CBLAS, over a sweep of sizes and thread counts, and prints one row per point: the time of a call and the rate it achieved. All of them take the same options, but for the arguments a routine does not have (--trans on ddot, the batch outside GEMM), which it refuses. They run against the BLAS library chosen when the package was built (OpenBLAS, BLIS, AMD AOCL-BLAS, Netlib reference BLAS, NVPL, ArmPL or Intel MKL), or, built against FlexiBLAS, the one FlexiBLAS loads when they start (FLEXIBLAS, see ENVIRONMENT); --version says which.
To compare libraries, build the package once against each and run the same command with each build, or build it once against FlexiBLAS and run the command under each library, or let bmb_suite(1) run them all; then turn the results into charts with bmb_report(1).
Routines
Level 1 routines work on vectors, level 2 on a matrix and a vector, level 3 on matrices:
| Level 1 | sasum dasum scasum dzasum saxpy daxpy caxpy zaxpy saxpby |
| daxpby caxpby zaxpby scopy dcopy ccopy zcopy sdot ddot | |
| cdotc zdotc cdotu zdotu snrm2 dnrm2 scnrm2 dznrm2 sscal | |
| dscal cscal zscal sswap dswap cswap zswap isamax idamax | |
| icamax izamax srot drot | |
| Level 2 | sgemv dgemv cgemv zgemv sgbmv dgbmv sger dger cgeru zgeru |
| cgerc zgerc ssymv dsymv chemv zhemv sspmv dspmv ssyr dsyr | |
| cher zher ssyr2 dsyr2 cher2 zher2 strmv dtrmv ctrmv ztrmv | |
| strsv dtrsv ctrsv ztrsv stpsv dtpsv stbsv dtbsv | |
| Level 3 | sgemm dgemm cgemm zgemm sgemmt dgemmt cgemmt zgemmt sbgemm |
| ssymm dsymm csymm zsymm chemm zhemm ssyrk dsyrk csyrk | |
| zsyrk cherk zherk ssyr2k dsyr2k csyr2k zsyr2k cher2k | |
| zher2k strmm dtrmm ctrmm ztrmm strsm dtrsm ctrsm ztrsm |
The first letter is the precision, as in BLAS: s single, d double, c single complex, z double complex. Every operation is measured in every precision BLAS has it in, but rot, gbmv, tbsv and tpsv, in real precision only: single precision moves half the bytes and fits twice as many numbers in a vector register, and a complex multiply-add does four times the arithmetic of a real one on twice the data. Two letters name a routine that returns a real from a complex vector: scasum and dzasum, the sum of the absolute values of the real and imaginary parts, scnrm2 and dznrm2, the norm. The one that returns an index has an i before the precision: isamax, idamax, icamax and izamax, the first element of largest absolute value, counted from 0 as in C. Some exist for complex numbers only: cdotc and zdotc, the dot product with the first vector conjugated, and cdotu and zdotu, without; cgeru, zgeru, cgerc and zgerc, the rank-1 updates, with y conjugated in gerc; and the Hermitian counterparts of symv, syr, syr2, symm, syrk and syr2k: chemv, zhemv, cher, zher, cher2, zher2, chemm, zhemm, cherk, zherk, cher2k and zher2k.
Two are extensions of the BLAS, which libraries add: axpby, y = alpha x + beta y (OpenBLAS, MKL, BLIS, AOCL-BLAS, NVPL, ArmPL), and gemmt, one triangle of a GEMM, C = alpha op(A) op(B) + beta C where --uplo gives it (MKL, NVPL, AOCL-BLAS, BLIS, ArmPL, OpenBLAS from 0.3.28), for a product known to be symmetric, of which half is enough. Their programs are installed whatever the library; where it lacks the call, they measure nothing and exit 77, saying which call is missing (see EXIT STATUS). gemmt takes --trans for A and B, as GEMM does, and calls cblas_?gemmtr where the library has it, the name the Reference BLAS gave it, under which MKL deprecates cblas_?gemmt.
sbgemm is a GEMM whose A and B are in bfloat16 (8 bits of significand) and C, and the accumulation, in float: OpenBLAS's cblas_sbgemm, where it was built with BUILD_BFLOAT16, ArmPL's, or MKL's cblas_gemm_bf16bf16f32. It is an extension too, skipped where the library has neither. Its operands are the fill every routine uses, rounded to bfloat16; --verify checks C against those bfloat16 values, whose products float holds exactly, with single precision's tolerance for K additions, which a library accumulating in bfloat16 is far outside. Its GFLOP/s count a bfloat16 multiply and a float add as two operations, as GEMM's do; --peak-gflops is then a core's bfloat16 peak, which bmb_report takes from the results only: its own is double precision's.
Level 1 routines are sized with -v. Level 2 and 3 routines are sized with -m and, for those with two dimensions, -M. Which dimension is which:
| sgemv dgemv cgemv zgemv | -m is M, -M is N |
| sger dger cgeru zgeru | -m is M, -M is N |
| cgerc zgerc ssymm dsymm | -m is M, -M is N |
| csymm zsymm chemm zhemm | -m is M, -M is N |
| strmm dtrmm ctrmm ztrmm | -m is M, -M is N |
| strsm dtrsm ctrsm ztrsm | -m is M, -M is N |
| sgemm dgemm cgemm zgemm | -m is M and K, -M is N; -K gives K apart |
| sbgemm | -m is M and K, -M is N; -K gives K apart |
| sgbmv dgbmv stbsv dtbsv | -m is N, -M is K |
| sgemmt dgemmt cgemmt | -m is N, -M is K |
| zgemmt ssyrk dsyrk csyrk | -m is N, -M is K |
| zsyrk cherk zherk ssyr2k | -m is N, -M is K |
| dsyr2k csyr2k zsyr2k | -m is N, -M is K |
| cher2k zher2k | -m is N, -M is K |
| ssymv dsymv chemv zhemv | -m is N (square; no -M) |
| sspmv dspmv ssyr dsyr | -m is N (square; no -M) |
| cher zher ssyr2 dsyr2 | -m is N (square; no -M) |
| cher2 zher2 strmv dtrmv | -m is N (square; no -M) |
| ctrmv ztrmv strsv dtrsv | -m is N (square; no -M) |
| ctrsv ztrsv stpsv dtpsv | -m is N (square; no -M) |
For the banded routines, sgbmv, dgbmv, stbsv and dtbsv, K is the band's half-width: the diagonals kept on each side of the main one in gbmv, measured square, and off it in tbsv's triangle. A K of N or more, as a sweep without -M gives, reaches past the matrix's corners, which BLAS takes: the whole matrix is computed on, and the rates count only what falls inside it.
SEE ALSO
bmb_report(1), bmb_suite(1), numactl(8), taskset(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