Benchmarks

NextLA's mixed-precision routines against the vendor libraries on one GPU, an NVIDIA GB10 (DGX Spark). How it was measured is at the end.

Mixed precision: Cholesky, SYRK and TRSM

The routines of paper [3] (Citing NextLA) on recursively split matrices whose blocks are stored in different precisions (Mixed precision), as NextLA's speed over the vendor library at the leaf precision. A configuration lists the off-diagonal precision at each level, then the leaf: [F16, F16, F32] has two levels of Float16 off-diagonal blocks and Float32 leaves. The table gives the configurations paper [3] reports, at $n = 65536$ wherever it fits in the GB10's memory.

ConfigurationnNextLA (× vendor)Error (n)
Cholesky [F16, F32, F64]64K2.69×2.7e-08 (32K)
Cholesky [F16, F16, F16, F32]64K2.29×9.6e-08 (32K)
Cholesky [F16×6, F32]64K2.43×9.7e-08 (32K)
Cholesky Pure F1664K4.41×6.0e-04 (32K)
SYRK [F16, F16, F32]64K1.19×1.0e-04 (16K)
SYRK [F16×4, F32]64K1.20×1.2e-04 (16K)
SYRK Pure F1664K4.89×2.2e-04 (16K)
TRSM [F16×4, F32]64K2.52×6.7e-04 (16K)
TRSM Pure F1664K3.12×7.0e-04 (16K)

Two choices trade speed for accuracy. Float16 products are summed in Float32, and every update is checked for overflow, raising the block's scale instead of storing Inf. A Float64 leaf updated from Float16 or Float32 rows sums that update in Float32 (see Mixed precision): on the matrices these errors are measured on, which add $10nI$, that changes the error by at most 3%; on less diagonally dominant matrices it grows, about 9× with [F32, F64] on $AA^T + nI$.

Cholesky: potrf_recursive! on SymmMixedPrec

NextLA's speed over cuSOLVER potrf at the leaf precision, one panel per configuration (log scale; above 1× is faster than the vendor library, timed in the same run).

Cholesky: NextLA's speed over cuSOLVER potrf

The numbers behind the Cholesky chart
ConfigurationnNextLAcuSOLVER potrf× vendorBuildError
Pure F3216K0.14 s0.137 s0.98×–2.3e-08
Pure F3232K0.859 s1.02 s1.18×–5.6e-08
Pure F3264K6.99 s7.75 s1.11×––
Pure F1616K0.0585 s0.137 s2.34×–6.0e-04
Pure F1632K0.286 s1.02 s3.55×–6.0e-04
Pure F1664K1.76 s7.75 s4.41×––
Pure F6416K3.8 s3.64 s0.96×–3.3e-16
Pure F6432K29.6 s29.2 s0.99×–3.4e-16
[F16, F32]16K0.146 s0.139 s0.95×0.0444 s6.4e-08
[F16, F32]32K0.827 s1.02 s1.23×0.152 s9.2e-08
[F16, F32]64K5.14 s7.73 s1.50×0.601 s–
[F16, F16, F32]16K0.136 s0.139 s1.02×0.0382 s7.1e-08
[F16, F16, F32]32K0.646 s1.02 s1.58×0.127 s9.4e-08
[F16, F16, F32]64K4.05 s7.73 s1.91×0.493 s–
[F16, F16, F16, F32]16K0.137 s0.139 s1.02×0.0324 s7.6e-08
[F16, F16, F16, F32]32K0.587 s1.02 s1.73×0.118 s9.6e-08
[F16, F16, F16, F32]64K3.38 s7.73 s2.29×0.432 s–
[F16×5, F32]16K0.163 s0.138 s0.85×0.0304 s8.0e-08
[F16×5, F32]32K0.629 s1.01 s1.61×0.106 s9.7e-08
[F16×5, F32]64K3.09 s7.84 s2.53×0.408 s–
[F16×6, F32]16K0.196 s0.139 s0.71×0.0303 s8.0e-08
[F16×6, F32]32K0.691 s1.02 s1.47×0.104 s9.7e-08
[F16×6, F32]64K3.18 s7.73 s2.43×0.37 s–
[F16×7, F32]16K0.229 s0.138 s0.60×0.0413 s8.0e-08
[F16×7, F32]32K0.712 s1.01 s1.42×0.115 s9.7e-08
[F16×7, F32]64K3.28 s7.84 s2.39×0.379 s–
[F32, F32, F32, F64]16K0.997 s3.64 s3.65×0.05 s6.6e-12
[F32, F32, F32, F64]32K6.69 s29.2 s4.37×0.17 s3.5e-12
[F32, F32, F32, F64]64K51.2 s233 s4.54×1.01 s–
[F16, F32, F64]16K1.53 s3.64 s2.38×0.0499 s4.4e-08
[F16, F32, F64]32K11.2 s29.2 s2.61×0.182 s2.7e-08
[F16, F32, F64]64K86.5 s233 s2.69×1.38 s–

Error: $\|A - LL^T\|_F / \|A\|_F$ in Float64, on $(R/\sqrt{n})(R/\sqrt{n})^T + 10nI$ with $R$ uniform random. Build is the container build alone; it is also inside every timed call.

SYRK: recsyrk! into SymmMixedPrec

NextLA's speed over cuBLAS syrk at the leaf precision, one panel per configuration (log scale; above 1× is faster than the vendor library, timed in the same run).

SYRK: NextLA's speed over cuBLAS syrk

The numbers behind the SYRK chart
ConfigurationnNextLAcuBLAS syrk× vendorBuildError
Pure F3216K0.241 s0.31 s1.28×–1.0e-06
Pure F3232K1.91 s2.51 s1.31×––
Pure F3264K21.3 s27.1 s1.27×––
Pure F1616K0.0884 s0.317 s3.59×–2.2e-04
Pure F1632K0.413 s3.04 s7.37×––
Pure F1664K5.57 s27.2 s4.89×––
[F16, F16, F32]16K0.323 s0.309 s0.96×0.0807 s1.0e-04
[F16, F16, F32]32K2.26 s2.49 s1.10×0.281 s–
[F16, F16, F32]64K22.6 s27 s1.19×1.1 s–
[F16×4, F32]16K0.324 s0.309 s0.95×0.0698 s1.2e-04
[F16×4, F32]32K2.28 s2.49 s1.09×0.264 s–
[F16×4, F32]64K22.5 s27 s1.20×1.01 s–

Error: Frobenius error of the lower triangle against a Float64 reference. Build is the container build alone; it is also inside every timed call.

TRSM: unified_rectrxm! with TriMixedPrec

NextLA's speed over cuBLAS trsm at the leaf precision, one panel per configuration (log scale; above 1× is faster than the vendor library, timed in the same run).

TRSM: NextLA's speed over cuBLAS trsm

The numbers behind the TRSM chart
ConfigurationnNextLAcuBLAS trsm× vendorBuildError
Pure F3216K0.32 s0.316 s0.99×–2.2e-07
Pure F3232K2.51 s2.49 s0.99×––
Pure F3264K18.3 s19.8 s1.09×––
Pure F1616K0.122 s0.313 s2.57×–7.0e-04
Pure F1632K0.67 s2.44 s3.63×––
Pure F1664K5.87 s18.3 s3.12×––
[F16, F16, F32]16K0.224 s0.308 s1.37×0.0366 s6.4e-04
[F16, F16, F32]32K1.26 s2.46 s1.96×0.125 s–
[F16, F16, F32]64K10.2 s18.2 s1.79×0.471 s–
[F16×4, F32]16K0.172 s0.308 s1.79×0.032 s6.7e-04
[F16×4, F32]32K0.927 s2.46 s2.65×0.117 s–
[F16×4, F32]64K7.23 s18.2 s2.52×0.409 s–

Error: Frobenius error of $X$ against a Float64 reference solve. Left side, upper triangle, no transpose. Build is the container build alone; it is also inside every timed call.

Mixed precision: GEMM and LU

GEMM: recgemm! into FullMixedPrec

NextLA's speed over cuBLAS gemm at the leaf precision, one panel per configuration (log scale; above 1× is faster than the vendor library, timed in the same run).

GEMM: NextLA's speed over cuBLAS gemm

The numbers behind the GEMM chart
ConfigurationnNextLAcuBLAS gemm× vendorBuildError
[F16, F32]8K0.0421 s0.061 s1.45×0.0168 s1.5e-04
[F16, F32]16K0.161 s0.553 s3.44×0.0598 s1.5e-04
[F16, F32]32K1.01 s4.95 s4.90×0.223 s–
[F16, F16, F32]8K0.0431 s0.061 s1.41×0.0178 s1.8e-04
[F16, F16, F32]16K0.175 s0.553 s3.16×0.054 s1.8e-04
[F16, F16, F32]32K1.04 s4.95 s4.74×0.203 s–
[F16×4, F32]8K0.0475 s0.061 s1.28×0.0191 s2.0e-04
[F16×4, F32]16K0.184 s0.553 s3.01×0.0584 s2.0e-04
[F16×4, F32]32K1.15 s4.95 s4.31×0.202 s–
[F16, F32, F64]8K0.76 s2.72 s3.57×0.0227 s1.5e-04
[F16, F32, F64]16K5.68 s21.7 s3.82×0.0734 s1.5e-04

Error: $\|C - C_{64}\|_F / \|C_{64}\|_F$ against Float64 cuBLAS. NextLA sums the Float16 blocks in Float32.

LU: lu_recursive! on FullMixedPrec

NextLA's speed over cuSOLVER getrf at the leaf precision, one panel per configuration (log scale; above 1× is faster than the vendor library, timed in the same run).

LU: NextLA's speed over cuSOLVER getrf

The numbers behind the LU chart
ConfigurationnNextLAcuSOLVER getrf× vendorBuildError
Pure F328K0.0368 s0.0579 s1.57×–7.8e-08
Pure F3216K0.218 s0.288 s1.32×–7.4e-08
Pure F3232K1.61 s1.91 s1.18×––
Pure F168K0.0231 s0.0579 s2.51×–3.2e-05
Pure F1616K0.101 s0.288 s2.85×–1.6e-05
Pure F1632K0.503 s1.91 s3.79×––
[F16, F32]8K0.0547 s0.0579 s1.06×0.0178 s9.3e-07
[F16, F32]16K0.211 s0.288 s1.37×0.0593 s1.2e-06
[F16, F32]32K1.11 s1.91 s1.73×0.214 s–
[F16, F16, F32]8K0.0771 s0.0579 s0.75×0.0209 s1.2e-06
[F16, F16, F32]16K0.222 s0.288 s1.30×0.059 s1.4e-06
[F16, F16, F32]32K1.02 s1.91 s1.88×0.202 s–
[F16, F16, F16, F32]8K0.122 s0.0579 s0.47×0.0154 s1.3e-06
[F16, F16, F16, F32]16K0.281 s0.288 s1.03×0.0628 s1.5e-06
[F16, F16, F16, F32]32K1.03 s1.91 s1.85×0.195 s–
[F16×4, F32]8K0.156 s0.0579 s0.37×0.0189 s1.3e-06
[F16×4, F32]16K0.312 s0.288 s0.93×0.0568 s1.6e-06
[F16×4, F32]32K1.06 s1.91 s1.80×0.209 s–
[F32, F64]8K1 s0.979 s0.98×0.026 s7.1e-11
[F32, F64]16K7.52 s7.5 s1.00×0.09 s5.0e-11
[F16, F64]8K0.998 s0.979 s0.98×0.0219 s9.3e-07
[F16, F64]16K7.51 s7.5 s1.00×0.0781 s1.2e-06
[F16, F16, F32, F64]8K0.471 s0.979 s2.08×0.024 s1.2e-06
[F16, F16, F32, F64]16K2.93 s7.5 s2.56×0.0723 s1.4e-06
[F16, F16, F16, F32, F64]8K0.42 s0.979 s2.33×0.0189 s1.3e-06
[F16, F16, F16, F32, F64]16K1.83 s7.5 s4.10×0.0626 s1.5e-06

Error: $\|LU - A\|_F / \|A\|_F$.

How it was measured

  • Machine: an NVIDIA DGX Spark: a GB10 GPU (compute capability 12.1) with 121 GB of memory shared with the CPU.
  • Code: NextLA as in this release, on Julia 1.10.14 and CUDA.jl 6.4.2. Each point is divided by the vendor routine timed in the same run.
  • Timing: one untimed warm-up call, then up to 5 timed calls (2 when a call takes over 10 s, 1 when it takes over 60 s); the fastest is kept. Each call ends with CUDA.device_synchronize(), so work started in @async tasks is inside the time. The mixed-precision container is built inside the timed call; its build is also timed on its own. The GPU is idle before each call.
  • Inputs (those of paper [3]'s experiments): Cholesky, uniform random plus $nI$ (Pure Float16: scaled to the Float16 range, plus $100I$); SYRK, $0.1\,\mathrm{randn}$ in the leaf type, $C = 0$, $\alpha = -1$, $\beta = 1$; TRSM, left side, upper triangle, no transpose, $\alpha = 1$; GEMM, $C \leftarrow C - AB$ into a FullMixedPrec with $A$ and $B$ in the off-diagonal precision; LU, uniform random plus $2nI$, unpivoted. Standard flop counts.
  • Sizes: 16K, 32K and 64K; GEMM and LU 8K, 16K and 32K. Float64 SYRK and TRSM at 64K are not measured: they need 120–137 GB. Errors are measured outside the timing, up to 16K (32K for Cholesky).
  • Not measured: mixed-precision TRMM, adaptive precision and real-world matrices.

Run it on your machine

benchmark/run.jl in the repository times NextLA's routines, dense and mixed precision, against the vendor libraries on your machine, synchronized the same way (CUDA.device_synchronize()) and keeping the fastest of several calls. From the NextLA folder, set up the benchmark environment once (add CUDA.jl for an NVIDIA GPU):

julia --project=benchmark -e 'using Pkg; Pkg.develop(path="."); Pkg.instantiate()'
julia --project=benchmark -e 'using Pkg; Pkg.add("CUDA")'

Then run every routine, or name some:

julia --project=benchmark benchmark/run.jl                                 # every routine, on one device: the GPU if CUDA works, else the CPU
julia --project=benchmark benchmark/run.jl potrf trsm --mixed=F16/F32      # some routines, one mixed configuration

It prints a GFLOP/s table per routine and writes every point to a results file. The options and the timing rule are in Running the benchmarks (benchmark/README.md).