metal-linalg

Eigensolver routing on Apple M5 Pro (20 GPU cores)

What every section and number below means: reading-reports.md.

Cost model scaled to this device from one probe point: block x0.14, cpu x0.09, whole-matrix x1.00 (1.00 is an M1).

Machine state: load 2.9/18 at the start, load 2.7/18 at the end; power mains.

Probe point after the sweep relative to before it: block x1.00, cpu x0.99, tg x1.00 (stable).

Generated by tuning/tune_eigh.py from 205 (N, batch) points, N in [2, 4, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096], batch in [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096], four backends, two or more passes, min-of-repeats.

Answer

Row for kTuned[] in src/eigh.mm:

// device, GPU cores,   simd_max_n, block_min_n, block_min_n_batched, block_min_batch,   gpu_max_n, gpu_min_batch_times_n, gpu_min_batch,   values_gpu_max_n, values_gpu_min_batch_times_n, values_gpu_min_batch,   tridiag_min_n, values_tridiag_min_n, tridiag_max_batch, values_tridiag_max_batch,   ql_min_n, ql_max_n
{"Apple M5 Pro", 20,   0, 96, 0, 0,   48, 8192, 1,   0, 0, 1,   1536, 3072, 2, 1,   12, 64},

To try it without rebuilding:

EIGH_SIMD_MAX_N=0 EIGH_BLOCK_MIN_N=96 EIGH_BLOCK_MIN_N_BATCHED=0 EIGH_BLOCK_MIN_BATCH=0 EIGH_GPU_MAX_N=48 EIGH_GPU_MIN_BATCH_TIMES_N=8192 EIGH_GPU_MIN_BATCH=1 EIGH_TRIDIAG_MIN_N=1536 EIGH_VALUES_TRIDIAG_MIN_N=3072 EIGH_TRIDIAG_MAX_BATCH=2 EIGH_VALUES_TRIDIAG_MAX_BATCH=1 EIGH_QL_MIN_N=12 EIGH_QL_MAX_N=64 EIGH_VALUES_GPU_MAX_N=0 EIGH_VALUES_GPU_MIN_BATCH_TIMES_N=0 EIGH_VALUES_GPU_MIN_BATCH=1

The policy in effect on this device came from tuned:Apple M5 Pro. It differs from the fitted one; see the warnings.

Against the best measured backend at every point the whole rule scores 1.0027 geometric-mean regret, worst 1.28x, 1 of 205 points losing more than 10%, and 1.000x the oracle’s total time. The decision is fitted in two stages, below, because the CPU routing would otherwise hide the GPU backend crossover.

Warnings

Stage 1: which GPU backend

Scored against the best GPU backend at each of the 205 points, as if there were no CPU: this is the rule a forced-GPU call (EIGH_DEVICE=gpu) and the detail entry points follow, and it is what a GPU with more cores will lean on.

rule geomean regret worst >10% total time / oracle est. picks
policy in effect (‘0’, ‘96’, ‘none’, ‘none’) 1.0199 1.59x 11 1.003 0
fitted (‘0’, ‘96’, ‘none’, ‘none’) 1.0199 1.59x 11 1.003 0

4 of 128 (simd_max_n, block_min_n) pairs are within 0.5% of the best geomean: simd_max_n 0 .. 8, block_min_n 96 .. 96.

xychart-beta
    title "Regret by block_min_n"
    x-axis "block_min_n" [32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, none]
    y-axis "geometric-mean regret" 1.0 --> 2.54
    line [1.1939, 1.1010, 1.0374, 1.0199, 1.0447, 1.1156, 1.2420, 1.3837, 1.5542, 1.7276, 1.9401, 2.1245, 2.2628, 2.4091, 2.4671, 2.5272]
block_min_n 32 48 64 96 128 192 256 384 512 768 1024 1536 2048 3072 4096 none
geomean 1.1939 1.1010 1.0374 1.0199 1.0447 1.1156 1.2420 1.3837 1.5542 1.7276 1.9401 2.1245 2.2628 2.4091 2.4671 2.5272
worst 7.95x 4.43x 2.57x 1.59x 1.93x 2.34x 4.58x 5.77x 10.06x 15.84x 15.84x 15.84x 15.84x 15.84x 15.84x 15.84x
xychart-beta
    title "Regret by simd_max_n"
    x-axis "simd_max_n" [0, 2, 4, 8, 12, 16, 24, 32]
    y-axis "geometric-mean regret" 1.0 --> 1.16
    line [1.0199, 1.0198, 1.0201, 1.0210, 1.0287, 1.0445, 1.0845, 1.1495]
simd_max_n 0 2 4 8 12 16 24 32
geomean 1.0199 1.0198 1.0201 1.0210 1.0287 1.0445 1.0845 1.1495
worst 1.59x 1.59x 1.59x 1.59x 1.59x 1.59x 2.91x 4.99x

Held-out check of a batch-dependent crossover (block from a lower N once the batch is large enough). Fitted on 112 points, scored on the other 93; the verdict is a bootstrap over the test points.

rule fitted on train train geomean test geomean test worst verdict
two constants [2, 96, 1000000000, 1000000000] 1.0234 1.0154 1.55x baseline
batch-dependent block crossover {“block_lo”: 64, “batch_hi”: 128} 1.0036 1.0090 1.49x rejected (better in 79% of resamples, median gain 0.6%)

Best GPU backend per point (s simd, t threadgroup, B block, q ql), then what the split picks, the ql window of stage 1b included:

  N \ batch     1     2     4     8    16    32    64   128   256   512  1024  2048  4096
          2     q     t     t     s     s     s     t     q     s     t     q     q     q
          4     s     t     s     s     t     t     s     q     s     q     q     s     q
          8     s     t     t     q     t     t     t     s     t     q     t     t     s
         12     t     t     t     t     q     t     t     q     q     q     q     q     q
         16     t     t     t     t     t     t     t     t     q     q     q     q     q
         24     t     t     t     t     t     t     t     q     q     q     q     q     q
         32     t     t     t     t     t     t     q     q     q     q     q     q     q
         48     t     t     t     t     t     q     q     q     q     q     q     q     q
         64     t     t     t     t     t     q     q     q     q     q     q     q     q
         96     t     t     t     t     t     B     B     B     B     B     B     B     B
        128     B     B     B     B     B     B     B     B     B     B     B     B     B
        192     B     B     B     B     B     B     B     B     B     B     B     B     B
        256     B     B     B     B     B     B     B     B     B     B     B     .     .
        384     B     B     B     B     B     B     B     B     B     B     .     .     .
        512     B     B     B     B     B     B     B     B     .     .     .     .     .
        768     B     B     B     B     B     B     B     .     .     .     .     .     .
       1024     B     B     B     B     B     .     .     .     .     .     .     .     .
       1536     B     B     B     .     .     .     .     .     .     .     .     .     .
       2048     B     B     B     .     .     .     .     .     .     .     .     .     .
       3072     B     .     .     .     .     .     .     .     .     .     .     .     .
       4096     B     .     .     .     .     .     .     .     .     .     .     .     .
  N \ batch     1     2     4     8    16    32    64   128   256   512  1024  2048  4096
          2     t     t     t     t     t     t     t     t     t     t     t     t     t
          4     t     t     t     t     t     t     t     t     t     t     t     t     t
          8     t     t     t     t     t     t     t     t     t     t     t     t     t
         12     q     q     q     q     q     q     q     q     q     q     q     q     q
         16     q     q     q     q     q     q     q     q     q     q     q     q     q
         24     q     q     q     q     q     q     q     q     q     q     q     q     q
         32     q     q     q     q     q     q     q     q     q     q     q     q     q
         48     q     q     q     q     q     q     q     q     q     q     q     q     q
         64     q     q     q     q     q     q     q     q     q     q     q     q     q
         96     B     B     B     B     B     B     B     B     B     B     B     B     B
        128     B     B     B     B     B     B     B     B     B     B     B     B     B
        192     B     B     B     B     B     B     B     B     B     B     B     B     B
        256     B     B     B     B     B     B     B     B     B     B     B     .     .
        384     B     B     B     B     B     B     B     B     B     B     .     .     .
        512     B     B     B     B     B     B     B     B     .     .     .     .     .
        768     B     B     B     B     B     B     B     .     .     .     .     .     .
       1024     B     B     B     B     B     .     .     .     .     .     .     .     .
       1536     B     B     B     .     .     .     .     .     .     .     .     .     .
       2048     B     B     B     .     .     .     .     .     .     .     .     .     .
       3072     B     .     .     .     .     .     .     .     .     .     .     .     .
       4096     B     .     .     .     .     .     .     .     .     .     .     .     .

Stage 1b: the ql backend

Inside a window of N, ql (tridiagonalization and implicit QL, one threadgroup per matrix, N <= 87 on this device) instead of the Jacobi backend the split picks, fitted over the 205 points against the best GPU backend, ql included. Chosen: N = 12 .. 64.

rule geomean regret worst >10% total time / oracle est. picks
without ql (the split alone) 1.1537 3.48x 43 1.010 0
with ql for N in (12, 64) 1.0423 1.58x 28 1.000 0

5 windows are within 0.5% of the best geomean: ql_min_n 2 .. 16, ql_max_n 64 .. 64.

Held out: fitted on 112 points (window (24, 64)), scored on the other 93: geomean 1.0660x, worst 1.47x, against 1.1493x, worst 3.32x without ql.

ql over the best Jacobi backend, N x batch: 2x1 1.02x, 2x2 0.89x, 2x4 0.97x, 2x8 0.94x, 2x16 0.90x, 2x32 0.96x, 2x64 0.99x, 2x128 1.02x, 2x256 0.98x, 2x512 0.97x, 2x1024 1.06x, 2x2048 1.02x, 2x4096 1.01x, 4x1 0.95x, 4x2 0.97x, 4x4 0.90x, 4x8 0.94x, 4x16 0.88x, 4x32 0.97x, 4x64 0.92x, 4x128 1.07x, 4x256 0.96x, 4x512 1.02x, 4x1024 1.04x, 4x2048 1.00x, 4x4096 1.03x, 8x1 0.97x, 8x2 0.91x, 8x4 0.94x, 8x8 1.01x, 8x16 0.99x, 8x32 0.91x, 8x64 0.95x, 8x128 0.98x, 8x256 0.98x, 8x512 1.01x, 8x1024 0.97x, 8x2048 0.99x, 8x4096 0.95x, 12x1 0.83x, 12x2 0.82x, 12x4 0.95x, 12x8 0.96x, 12x16 1.05x, 12x32 0.98x, 12x64 0.98x, 12x128 1.02x, 12x256 1.25x, 12x512 1.20x, 12x1024 1.25x, 12x2048 1.33x, 12x4096 1.34x, 16x1 0.93x, 16x2 0.90x, 16x4 0.91x, 16x8 0.92x, 16x16 0.92x, 16x32 0.90x, 16x64 0.90x, 16x128 0.99x, 16x256 1.21x, 16x512 1.27x, 16x1024 1.43x, 16x2048 1.38x, 16x4096 1.47x, 24x1 0.75x, 24x2 0.76x, 24x4 0.74x, 24x8 0.77x, 24x16 0.73x, 24x32 0.75x, 24x64 0.92x, 24x128 1.18x, 24x256 1.82x, 24x512 1.93x, 24x1024 2.02x, 24x2048 2.24x, 24x4096 2.33x, 32x1 0.63x, 32x2 0.67x, 32x4 0.71x, 32x8 0.70x, 32x16 0.71x, 32x32 0.86x, 32x64 1.07x, 32x128 1.72x, 32x256 2.55x, 32x512 2.22x, 32x1024 2.73x, 32x2048 2.96x, 32x4096 3.11x, 48x1 0.86x, 48x2 0.88x, 48x4 0.84x, 48x8 0.83x, 48x16 0.86x, 48x32 1.09x, 48x64 1.74x, 48x128 2.64x, 48x256 2.53x, 48x512 3.14x, 48x1024 3.15x, 48x2048 3.41x, 48x4096 3.48x, 64x1 0.94x, 64x2 0.95x, 64x4 0.93x, 64x8 0.91x, 64x16 0.92x, 64x32 1.32x, 64x64 2.24x, 64x128 2.04x, 64x256 2.10x, 64x512 2.05x, 64x1024 2.15x, 64x2048 2.17x, 64x4096 2.16x

Stage 2: GPU or CPU

Given the split above, GPU iff N <= gpu_max_n, batch * N >= gpu_min_batch_times_n and batch >= gpu_min_batch, scored against the best of all four backends. worst is over the points where the chosen backend was timed; a pick the cost model had to guess is listed in the warnings instead.

rule geomean regret worst >10% total time / oracle est. picks
oracle (best per point) 1.0000 1.00x 0 1.000 0
policy in effect (‘1024’, ‘512’, ‘16’) 1.7126 13.98x 84 3.343 0
fitted (‘48’, ‘8192’, ‘1’) 1.0027 1.28x 1 1.000 0

18 of 1188 combinations are within 0.5% of the best geomean: gpu_max_n 32 .. 48, gpu_min_batch_times_n 8192 .. 16384, gpu_min_batch 1 .. 32.

xychart-beta
    title "Regret by gpu_min_batch_times_n"
    x-axis "gpu_min_batch_times_n" [0, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, none]
    y-axis "geometric-mean regret" 1.0 --> 1.83
    line [1.8100, 1.3185, 1.2108, 1.1319, 1.0846, 1.0506, 1.0256, 1.0096, 1.0027, 1.0048, 1.0357]
gpu_min_batch_times_n 0 64 128 256 512 1024 2048 4096 8192 16384 none
geomean 1.8100 1.3185 1.2108 1.1319 1.0846 1.0506 1.0256 1.0096 1.0027 1.0048 1.0357
worst 117.83x 11.54x 9.49x 5.65x 4.20x 2.97x 2.21x 1.41x 1.28x 1.28x 1.83x
xychart-beta
    title "Regret by gpu_min_batch"
    x-axis "gpu_min_batch" [1, 2, 4, 8, 16, 32]
    y-axis "geometric-mean regret" 1.0 --> 1.02
    line [1.0027, 1.0027, 1.0027, 1.0027, 1.0027, 1.0027]
gpu_min_batch 1 2 4 8 16 32
geomean 1.0027 1.0027 1.0027 1.0027 1.0027 1.0027
worst 1.28x 1.28x 1.28x 1.28x 1.28x 1.28x
xychart-beta
    title "Regret by gpu_max_n"
    x-axis "gpu_max_n" [16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, none]
    y-axis "geometric-mean regret" 1.0 --> 1.48
    line [1.0236, 1.0147, 1.0064, 1.0027, 1.0108, 1.0486, 1.1020, 1.1708, 1.2378, 1.3079, 1.3676, 1.4200, 1.4500, 1.4500, 1.4620, 1.4620, 1.4620, 1.4620]
gpu_max_n 16 24 32 48 64 96 128 192 256 384 512 768 1024 1536 2048 3072 4096 none
geomean 1.0236 1.0147 1.0064 1.0027 1.0108 1.0486 1.1020 1.1708 1.2378 1.3079 1.3676 1.4200 1.4500 1.4500 1.4620 1.4620 1.4620 1.4620
worst 1.83x 1.78x 1.32x 1.28x 1.94x 3.76x 4.56x 6.53x 7.48x 10.53x 11.20x 13.98x 13.98x 13.98x 13.98x 13.98x 13.98x 13.98x

Held-out check of a per-N boundary (a lookup table of the smallest batch at which the GPU wins, per N) against the product rule. Fitted on 112 points, scored on the other 93.

rule fitted on train train geomean test geomean test worst verdict
product rule [48, 8192, 1] 1.0010 1.0047 1.28x baseline
per-N table {“min_batch_by_n”: {“2”: 4096, “4”: 4096, “8”: null, “12”: 2048, “16”: 2048, “24”: 256, “32”: 512, “48”: 512, “64”: null, “96”: null, “128”: null, “192”: null, “256”: null, “384”: null, “512”: null, “768”: null, “1024”: null, “1536”: null, “2048”: null, “3072”: null, “4096”: null}} 1.0004 1.0137 1.39x rejected (better in 2% of resamples, median gain -0.9%)

Best backend per point (c CPU, s simd, t threadgroup, B block, q ql, . not measured), what the whole rule picks, and the speedup of the best GPU backend over the CPU:

  N \ batch     1     2     4     8    16    32    64   128   256   512  1024  2048  4096
          2     c     c     c     c     c     c     c     c     c     t     c     c     q
          4     c     c     c     c     c     c     c     c     c     q     c     c     q
          8     c     c     c     c     c     c     c     c     c     c     t     t     s
         12     c     c     c     c     c     c     c     c     c     c     q     q     q
         16     c     c     c     c     c     c     c     c     c     q     q     q     q
         24     c     c     c     c     c     c     c     c     q     q     q     q     q
         32     c     c     c     c     c     c     c     c     q     q     q     q     q
         48     c     c     c     c     c     c     c     c     c     q     q     q     q
         64     c     c     c     c     c     c     c     c     c     c     c     c     c
         96     c     c     c     c     c     c     c     c     c     c     c     c     c
        128     c     c     c     c     c     c     c     c     c     c     c     c     c
        192     c     c     c     c     c     c     c     c     c     c     c     c     c
        256     c     c     c     c     c     c     c     c     c     c     c     .     .
        384     c     c     c     c     c     c     c     c     c     c     .     .     .
        512     c     c     c     c     c     c     c     c     .     .     .     .     .
        768     c     c     c     c     c     c     c     .     .     .     .     .     .
       1024     c     c     c     c     c     .     .     .     .     .     .     .     .
       1536     c     c     c     .     .     .     .     .     .     .     .     .     .
       2048     c     c     c     .     .     .     .     .     .     .     .     .     .
       3072     c     .     .     .     .     .     .     .     .     .     .     .     .
       4096     c     .     .     .     .     .     .     .     .     .     .     .     .
  N \ batch     1     2     4     8    16    32    64   128   256   512  1024  2048  4096
          2     c     c     c     c     c     c     c     c     c     c     c     c     t
          4     c     c     c     c     c     c     c     c     c     c     c     t     t
          8     c     c     c     c     c     c     c     c     c     c     t     t     t
         12     c     c     c     c     c     c     c     c     c     c     q     q     q
         16     c     c     c     c     c     c     c     c     c     q     q     q     q
         24     c     c     c     c     c     c     c     c     c     q     q     q     q
         32     c     c     c     c     c     c     c     c     q     q     q     q     q
         48     c     c     c     c     c     c     c     c     q     q     q     q     q
         64     c     c     c     c     c     c     c     c     c     c     c     c     c
         96     c     c     c     c     c     c     c     c     c     c     c     c     c
        128     c     c     c     c     c     c     c     c     c     c     c     c     c
        192     c     c     c     c     c     c     c     c     c     c     c     c     c
        256     c     c     c     c     c     c     c     c     c     c     c     .     .
        384     c     c     c     c     c     c     c     c     c     c     .     .     .
        512     c     c     c     c     c     c     c     c     .     .     .     .     .
        768     c     c     c     c     c     c     c     .     .     .     .     .     .
       1024     c     c     c     c     c     .     .     .     .     .     .     .     .
       1536     c     c     c     .     .     .     .     .     .     .     .     .     .
       2048     c     c     c     .     .     .     .     .     .     .     .     .     .
       3072     c     .     .     .     .     .     .     .     .     .     .     .     .
       4096     c     .     .     .     .     .     .     .     .     .     .     .     .
  N \ batch     1     2     4     8    16    32    64   128   256   512  1024  2048  4096
          2  0.01  0.02  0.04  0.04  0.06  0.10  0.18  0.35  0.59  1.28  0.76  0.83  1.08
          4  0.01  0.03  0.06  0.13  0.12  0.21  0.38  0.71  0.59  1.02  0.78  0.98  1.22
          8  0.03  0.05  0.11  0.14  0.22  0.46  0.53  0.63  0.64  0.78  1.03  1.18  1.39
         12  0.03  0.07  0.10  0.14  0.31  0.52  0.85  0.60  0.93  0.96  1.13  1.28  1.40
         16  0.04  0.09  0.11  0.17  0.59  0.42  0.52  0.61  0.86  1.06  1.25  1.35  1.57
         24  0.08  0.13  0.15  0.25  0.35  0.47  0.54  0.70  1.07  1.26  1.42  1.82  1.83
         32  0.10  0.13  0.15  0.25  0.38  0.40  0.45  0.71  1.08  1.12  1.48  1.68  1.78
         48  0.11  0.13  0.14  0.26  0.28  0.34  0.50  0.84  0.91  1.15  1.19  1.30  1.32
         64  0.12  0.13  0.13  0.22  0.23  0.33  0.50  0.52  0.69  0.84  0.87  0.86  0.86
         96  0.08  0.08  0.09  0.11  0.14  0.16  0.21  0.27  0.30  0.30  0.29  0.28  0.28
        128  0.08  0.09  0.10  0.11  0.12  0.18  0.22  0.25  0.25  0.24  0.23  0.22  0.22
        192  0.14  0.13  0.14  0.15  0.16  0.19  0.21  0.19  0.17  0.16  0.16  0.15  0.15
        256  0.19  0.18  0.19  0.18  0.17  0.19  0.17  0.14  0.14  0.14  0.13     .     .
        384  0.23  0.23  0.20  0.19  0.14  0.13  0.11  0.10  0.10  0.09     .     .     .
        512  0.30  0.26  0.24  0.19  0.12  0.11  0.09  0.09     .     .     .     .     .
        768  0.30  0.28  0.20  0.12  0.08  0.08  0.07     .     .     .     .     .     .
       1024  0.40  0.34  0.19  0.12  0.11     .     .     .     .     .     .     .     .
       1536  0.40  0.24  0.12     .     .     .     .     .     .     .     .     .     .
       2048  0.39  0.26  0.18     .     .     .     .     .     .     .     .     .     .
       3072  0.32     .     .     .     .     .     .     .     .     .     .     .     .
       4096  0.49     .     .     .     .     .     .     .     .     .     .     .     .

Stage 3: GPU or CPU, eigenvalues alone

The same rule for eigvalsh, with its own thresholds (values_gpu_max_n, values_gpu_min_batch_times_n, values_gpu_min_batch), fitted on the _vals timings of 205 points given the split above. The CPU computes eigenvalues alone by LAPACK’s two-stage reduction from N = 128, so the boundary need not be eigh’s.

rule geomean regret worst >10% total time / oracle est. picks
policy in effect 1.5030 11.69x 72 3.403 0
eigh’s fitted boundary 1.0248 1.84x 19 1.002 0
fitted (‘16’, ‘none’, ‘1’) 1.0027 1.19x 3 1.000 0

120 combinations are within 0.5% of the best geomean: values_gpu_max_n 16 .. none, values_gpu_min_batch_times_n 16384 .. none, values_gpu_min_batch 1 .. 32.

Held out: fitted on 112 points (‘16’, ‘none’, ‘1’), scored on the other 93: geomean 1.0059x, worst 1.19x, against 1.0317x, worst 1.84x for eigh’s boundary on the same points.

Stage 4: the tridiag backend instead of the CPU

Where the rule above chooses the CPU, the tridiag backend from a threshold N on (0: never), for batches up to a cap (0: any; it solves a batch one matrix after another, the CPU path spreads one over every core), fitted over the measured N and batches against the best of all backends, tridiag included, on the points where tridiag was timed (N >= 128, within the cost cap): the region the threshold decides.

  threshold batch cap geomean regret worst without tridiag: geomean worst held out (fitted on half)
with eigenvectors 1536 2 1.0051 1.23x 1.0629 4.55x from 1536, batch <= 2: 1.0043 vs 1.0043
eigenvalues alone 3072 1 1.0000 1.00x 1.0050 1.22x from 3072, batch <= 1: 1.0000 vs 1.0000

tridiag over the CPU (with eigenvectors), N x batch: 128x1 0.21x, 128x2 0.11x, 128x4 0.06x, 128x8 0.03x, 128x16 0.02x, 128x32 0.02x, 128x64 0.02x, 128x128 0.02x, 128x256 0.02x, 128x512 0.02x, 192x1 0.31x, 192x2 0.15x, 192x4 0.08x, 192x8 0.05x, 192x16 0.03x, 192x32 0.03x, 192x64 0.03x, 192x128 0.02x, 192x256 0.02x, 256x1 0.42x, 256x2 0.20x, 256x4 0.11x, 256x8 0.06x, 256x16 0.04x, 256x32 0.04x, 256x64 0.04x, 256x128 0.03x, 256x256 0.03x, 384x1 0.52x, 384x2 0.27x, 384x4 0.14x, 384x8 0.09x, 384x16 0.05x, 384x32 0.05x, 384x64 0.05x, 384x128 0.04x, 512x1 0.67x, 512x2 0.35x, 512x4 0.19x, 512x8 0.12x, 512x16 0.08x, 512x32 0.07x, 512x64 0.07x, 512x128 0.07x, 768x1 0.82x, 768x2 0.46x, 768x4 0.24x, 768x8 0.16x, 768x16 0.11x, 768x32 0.11x, 768x64 0.10x, 1024x1 1.13x, 1024x2 0.65x, 1024x4 0.34x, 1024x8 0.25x, 1024x16 0.23x, 1536x1 1.45x, 1536x2 0.81x, 1536x4 0.45x, 2048x1 1.93x, 2048x2 1.28x, 2048x4 0.92x, 3072x1 2.71x, 4096x1 4.55x

tridiag over the CPU (eigenvalues alone), N x batch: 128x1 0.14x, 128x2 0.08x, 128x4 0.04x, 128x8 0.02x, 128x16 0.01x, 128x32 0.01x, 128x64 0.02x, 128x128 0.01x, 128x256 0.01x, 128x512 0.01x, 192x1 0.19x, 192x2 0.10x, 192x4 0.05x, 192x8 0.03x, 192x16 0.02x, 192x32 0.02x, 192x64 0.02x, 192x128 0.01x, 192x256 0.01x, 256x1 0.24x, 256x2 0.12x, 256x4 0.06x, 256x8 0.04x, 256x16 0.02x, 256x32 0.02x, 256x64 0.02x, 256x128 0.02x, 256x256 0.02x, 384x1 0.33x, 384x2 0.17x, 384x4 0.09x, 384x8 0.05x, 384x16 0.04x, 384x32 0.03x, 384x64 0.03x, 384x128 0.03x, 512x1 0.40x, 512x2 0.21x, 512x4 0.11x, 512x8 0.07x, 512x16 0.04x, 512x32 0.04x, 512x64 0.04x, 512x128 0.03x, 768x1 0.55x, 768x2 0.29x, 768x4 0.17x, 768x8 0.10x, 768x16 0.07x, 768x32 0.06x, 768x64 0.05x, 1024x1 0.68x, 1024x2 0.38x, 1024x4 0.22x, 1024x8 0.12x, 1024x16 0.08x, 1536x1 0.86x, 1536x2 0.53x, 1536x4 0.28x, 2048x1 0.94x, 2048x2 0.58x, 2048x4 0.32x, 3072x1 1.13x, 4096x1 1.22x

Noise floor

Pass-to-pass ratio (max/min of the same measurement across passes), 1538 measurements: median 1.011, p90 1.086, max 2.64. The held-out verdicts use a bootstrap rather than this figure, since a mean over many points is far less noisy than one measurement.

runtime n median p90 max
<1 ms 723 1.027 1.137 2.64
1-3 ms 154 1.006 1.035 1.40
3-10 ms 188 1.006 1.026 1.19
10-30 ms 136 1.006 1.023 1.10
30-100 ms 134 1.005 1.023 1.07
>100 ms 203 1.005 1.019 1.17