metal-linalg

LU routing: Apple M5 Pro, 20 GPU cores

From 1 run(s): 20261010-22fef9.

Answer

Row for kTuned[] (src/tuned/lu.inc, generated):

// device, GPU cores,   gpu_min_n, gpu_max_batch,   gpu_solve_min_rhs
{"Apple M5 Pro", 20,   1536, 0,   256},

GPU or CPU

lu_factor, solve and inv on the GPU from N = 1536. Against the faster path at every lu_factor and inv point:

rule geomean worst points over 10%
fitted 1.0001x 1.01x at [‘inv’, 1, 1024] 0 of 66
CPU always 1.2104x 3.44x at [‘inv’, 1, 4096] 17 of 66
GPU always 3.7450x 90.03x at [‘lu’, 64, 128] 45 of 66
held out: fitted on half 1.0000x 1.00x at [‘lu’, 1, 256] 0 of 32
held out: CPU always 1.2034x 3.39x at [‘inv’, 2, 4096] 8 of 32

The GPU path’s solve

Its triangular solves on the GPU from 256 right-hand sides, LAPACK’s sgetrs below: 1.0218x (always the GPU’s 1.1258x, always sgetrs 1.0288x).

Noise

Pass-to-pass ratio: median 1.009, p90 1.083, max 1.68 over 211 timings.

Probe point after the sweep over before: blocked 0.979x, cpu 0.975x.

Every point

Median ms, min over passes.

N batch K cpu blocked inv_cpu inv_blocked solve_cpu solve_trsm solve_getrs
32 1 1 0.002 — 0.004 — — — —
32 2 1 0.005 — 0.012 — — — —
32 4 1 0.011 — 0.012 — — — —
32 16 1 0.024 — 0.064 — — — —
32 64 1 0.094 — 0.152 — — — —
32 256 1 0.101 — 0.149 — — — —
32 1024 1 0.203 — 0.402 — — — —
64 1 1 0.007 — 0.018 — — — —
64 2 1 0.017 — 0.029 — — — —
64 4 1 0.019 — 0.031 — — — —
64 16 1 0.075 — 0.085 — — — —
64 64 1 0.164 — 0.180 — — — —
64 256 1 0.494 — 0.538 — — — —
64 1024 1 1.749 — 1.974 — — — —
128 1 1 0.023 0.382 0.052 0.390 — — —
128 2 1 0.035 0.680 0.064 0.728 — — —
128 4 1 0.037 1.266 0.071 1.375 — — —
128 16 1 0.102 4.847 0.181 5.588 — — —
128 64 1 0.215 19.385 0.505 22.433 — — —
128 256 1 0.651 — 1.728 — — — —
128 1024 1 2.303 — 6.901 — — — —
256 1 1 0.087 0.461 0.173 0.630 — — —
256 2 1 0.099 0.858 0.196 1.208 — — —
256 4 1 0.117 1.633 0.229 2.347 — — —
256 16 1 0.263 6.248 0.500 9.500 — — —
256 64 1 0.722 24.965 1.552 38.323 — — —
256 256 1 2.658 — 5.773 — — — —
512 1 1 0.308 0.882 0.644 1.143 — — —
512 2 1 0.360 1.627 0.740 2.357 — — —
512 4 1 0.504 3.284 1.065 4.818 — — —
512 16 1 1.278 13.030 2.526 18.975 — — —
512 64 1 4.084 51.972 8.497 76.517 — — —
768 1 1 0.713 1.288 1.520 1.955 — — —
768 2 1 0.870 2.513 1.870 3.781 — — —
768 4 1 1.220 5.346 2.774 8.262 — — —
768 16 1 3.773 19.993 8.200 30.371 — — —
1024 1 1 1.334 1.801 2.882 2.860 1.300 2.321 1.777
1024 2 1 1.786 3.655 4.058 5.643 — — —
1024 4 1 2.496 7.460 5.719 11.842 — — —
1024 16 1 8.354 28.053 20.178 45.116 — — —
1536 1 1 3.225 3.134 7.507 5.197 — — —
1536 2 1 6.466 6.277 15.384 10.620 — — —
1536 4 1 12.892 12.727 30.609 20.931 — — —
2048 1 1 6.728 4.927 16.910 8.601 7.086 6.261 7.322
2048 2 1 13.693 9.888 34.682 17.088 — — —
2048 4 1 26.935 19.725 68.579 34.042 — — —
3072 1 1 21.154 10.303 59.473 20.297 — — —
3072 2 1 42.571 18.181 118.775 39.822 — — —
4096 1 1 47.873 16.041 137.380 39.953 50.354 17.835 18.456
4096 2 1 95.256 32.134 274.265 80.851 — — —
1024 1 4 — — — — 1.316 2.469 1.821
2048 1 4 — — — — 7.165 6.007 5.381
4096 1 4 — — — — 50.073 18.444 18.475
1024 1 16 — — — — 1.232 2.357 1.632
2048 1 16 — — — — 6.625 6.154 5.761
4096 1 16 — — — — 48.333 18.386 16.141
1024 1 64 — — — — 1.317 2.373 1.719
2048 1 64 — — — — 7.402 6.226 6.090
4096 1 64 — — — — 49.750 18.641 17.622
1024 1 256 — — — — 1.715 2.537 2.226
2048 1 256 — — — — 8.609 6.327 7.530
4096 1 256 — — — — 52.270 19.541 20.739