Clustering on M2, V100 and L40
Compare matched native e-means, o-means and p-means across three measured systems, with separate strict Lloyd CPU worker curves.
Development APIsThe Aner 0.0.10-dev.6 comparison now includes actual NVIDIA L40 execution. Its completed campaign adds 270 e/o/p-means configurations and 1,350 timed fits, plus a separate 12 configuration, 60 fit CPU Lloyd supplement. The M2 and V100 observations retain their original bytes. Across the three hosts, the e/o/p study contains 810 configurations and 4,050 timed fits; the distinct Lloyd study contains 39 configurations and 195 timed fits. Every configuration also has one untimed warm up.
The three host manifest links the complete M2, V100 and L40 observations. The earlier M2/V100 study and its two host manifest remain the record of that earlier comparison. These are fixed budget synthetic measurements of Aner's native implementations, separate from upstream H100 claims and downstream model accuracy.
Matched GPU time and distortion
Every method uses three epochs, seeds 42/43/44 and its own automatic recipe. Inputs, source fingerprint, precision and resolved controls are paired across hosts. Both CUDA hosts use the same portable executable; M2 has its own native executable. GPU fits use a four worker host CPU budget.
Each table entry is the median of three per seed medians, each based on five timed fits. MSE is the median final per seed inertia divided by the number of rows. All 54 matched GPU configurations recorded identical final losses on M2, V100 and L40, including every repeated loss. This observed agreement is not a general bitwise guarantee for other inputs or hardware. The website preserves individual seeds instead of displaying an averaged model.
Shape (N,D,k) | Method | M2 Metal ms | V100 CUDA ms | L40 CUDA ms | Median MSE |
|---|---|---|---|---|---|
(2048,16,32) | e-means | 86.822 | 18.672 | 18.811 | 5.788248 |
(2048,16,32) | o-means | 15.561 | 4.805 | 4.448 | 8.412811 |
(2048,16,32) | p-means | 18.284 | 5.814 | 4.875 | 8.681518 |
(8192,32,64) | e-means | 16.499 | 4.565 | 4.259 | 16.331593 |
(8192,32,64) | o-means | 19.428 | 8.243 | 9.218 | 17.895855 |
(8192,32,64) | p-means | 21.247 | 10.047 | 9.811 | 16.105007 |
(16384,32,4096) | e-means | 70.944 | 33.945 | 19.944 | 17.492098 |
(16384,32,4096) | o-means | 125.756 | 128.538 | 107.940 | 16.944830 |
(16384,32,4096) | p-means | 105.160 | 128.390 | 110.018 | 17.785086 |
(65536,32,4096) | e-means | 139.082 | 69.647 | 39.304 | 14.584420 |
(65536,32,4096) | o-means | 211.817 | 200.991 | 128.729 | 14.468577 |
(65536,32,4096) | p-means | 137.278 | 148.183 | 116.925 | 14.009819 |
(8192,512,128) | e-means | 28.934 | 9.518 | 6.891 | 303.186332 |
(8192,512,128) | o-means | 103.266 | 112.654 | 47.971 | 299.329242 |
(8192,512,128) | p-means | 71.780 | 60.247 | 42.169 | 262.388272 |
(8192,1024,128) | e-means | 40.687 | 15.409 | 9.044 | 612.110170 |
(8192,1024,128) | o-means | 180.966 | 220.088 | 83.669 | 649.485679 |
(8192,1024,128) | p-means | 119.905 | 129.765 | 70.581 | 670.013864 |
On the large L40 case, p-means is about 1.10× faster than o-means and has lower median distortion. E-means is faster than both, with higher distortion. At 16,384 rows and 4,096 centers, p-means is slightly slower than o-means on L40 and has higher distortion. At 512 features p-means improves median distortion but costs more time than e-means; at 1,024 features e-means is faster and has lower distortion. There is no universal winning method.
L40's large case e-means fit is about 1.77× faster than V100's in this experiment. However, the small e-means fit is slightly slower on L40, and medium o-means is also slower. Timing includes CPU coordination, initialization, index maintenance, training, closing, final exhaustive labels/inertia, output construction and scratch destruction. These are complete system measurements, not isolated GPU kernel or silicon rankings. Data generation, input hashing/upload and returned model destruction are outside timing.
CPU worker budgets
| Host | Reported logical CPUs | CPU model | Measured e/o/p CPU budgets |
|---|---|---|---|
| M2 | 12 | Apple M2 Max | 1/4/8/12 on the four original shapes; 4 on wide shapes |
| V100 host | 24 | Intel Xeon Gold 6248 at 2.50 GHz | 1/4/8/12/24 on every shape |
| L40 host | 32 | Intel Xeon E5-2630 v3 at 2.40 GHz | 1/4/8/12 on every shape |
The L40 campaign deliberately retains the package's common worker budgets; it does not measure 24 or 32 workers. Reported logical CPUs and requested worker budgets do not establish physical cores, affinity or exclusive use of the host. Smaller phases can use fewer workers. CUDA placement selects GPU computation; parallel.local(...) supplies a host CPU budget.
For the large (65536,32,4096) case at a common 12 worker CPU budget, the median complete fit times are:
| Method | M2 CPU ms | V100 host CPU ms | L40 host CPU ms |
|---|---|---|---|
e-means | 735.496 | 2,312.907 | 3,133.352 |
o-means | 765.864 | 1,578.670 | 2,352.731 |
p-means | 378.403 | 934.551 | 1,333.309 |
The Linux executable uses a generic x86-64 CPU baseline. These results do not measure a host tuned AVX2/AVX512 build or maximum Xeon throughput. Keep the full worker curves: a larger worker request adds coordination overhead and does not guarantee a faster fit. The execution guide explains the native Tensor/parallel boundary and shared CPU/GPU kernels.
Separate strict Lloyd CPU measurements
The M2, V100 host and L40 host Lloyd supplements use the same small input (2048,16,32), seeds 42/43/44, one warm up and five timed fits. Their three iteration cap is separate from the e/o/p epoch budget. Lloyd widens the generated Float32 input to Float64, uses coordinate ordered hypot distances, exact centroid accumulation and exact accumulation of squared computed distances. Tolerance is zero and the configured workspace cap is 64 MiB.
| Requested workers | M2 CPU ms | V100 host CPU ms | L40 host CPU ms |
|---|---|---|---|
| 1 | 28.864 | 87.464 | 103.354 |
| 4 | 8.028 | 23.529 | 29.276 |
| 8 | 5.769 | 12.541 | 17.171 |
| 12 | 4.997 | 9.883 | 13.798 |
| 24 | Not measured | 9.149 | Not measured |
These are medians of per seed fit medians. Median final MSE is 10.983158 at every displayed host/worker setting. This is CPU execution on the GPU hosts, not GPU Lloyd. Different initialization, arithmetic and stopping semantics prevent treating these times as an equal quality fourth series alongside e/o/p.
The frozen harness does not capture completed Lloyd iterations or charged workspace. Raw updates=0 and workspace_bytes=0 are unreported placeholders; max_workspace_bytes echoes unused stochastic options. Each supplement retains the raw records and their explicit corrections. Larger shared shapes exceed Lloyd's existing admission limits, so no rejected case is presented as a timing result.
Actual qualification and provenance
The L40 qualification receipt records nine successful phases: native CPU correctness, native CUDA correctness, six serial e/o/p benchmark cases and the separate Lloyd CPU supplement. The CPU oracle passed 13,941 checks; the CUDA oracle and 152 additional p-means checks passed. All 270 e/o/p configurations and all 12 Lloyd configurations retained five identical repeated losses within each configuration. The completed receipt was independently checked against the frozen package manifest, source inventory, binary identity, commands, logs, report hashes, coverage, recipes and numerical aggregates before public projection.
The actual GPU was NVIDIA L40, compute capability 8.9, with 46,068 MiB reported memory and driver 620.70.06. Its host reported Linux 5.15.0-203, glibc 2.35 and 32 visible/affinity logical CPUs. GPU identity was stable and the postflight observation was idle. These observations do not establish exclusive host occupancy throughout timing.
The L40 campaign did not rerun the language suite or Compute Sanitizer. The same portable executable previously passed those checks on V100; its V100 qualification receipt remains separate. L40 correctness and timing are now actual observations, while sanitizer evidence remains scoped to V100.
| Artifact | Identity |
|---|---|
| Runtime | 0.0.10-dev.6 |
| Shared compiled source SHA256 | 648fe42e52ea5c6f62857fcb10aa416a832147e374bf3af03b156b383e601db3 |
| M2 benchmark SHA256 | 78ad933df0fb3f3ac3dff0cdf9a332e6899a87387522391d5d976ce1dd1ea127 |
| Shared V100/L40 benchmark SHA256 | 9fa07bb8e94f9eaf16a6f679adebad2de252f2f05053444afe92fb3198812104 |
| L40 package manifest SHA256 | 80f28e6ae1dc67b82547a0bc4660d21628e49b71ffbf10a197d9f621a9f5bb27 |
| Collected L40 receipt SHA256 | db61598baee2d8c66c338464b101b397afeb4b5fdc831003b4e4dcbe4812c11e |
The portable Linux build used GCC 13.4, CUDA 12.9.86, sm70/sm89 code, Release, no LTO and the generic x86-64 baseline. Compiler attribution comes from the retained build of the identical executable, not whatever compiler is installed on the L40 host. Public projections preserve numeric observations and fingerprints while removing hostnames, UUIDs, user paths and discovery output.
Reproduce and interpret
Keep the input hashes, three seeds, five timed repetitions, default resolved recipes and compiled identity fixed. Use the retained native benchmark and tools/run_clustering_comparison.py; wide cases are explicit wide-512 and wide-1024 selections. The L40 package uses CPU budgets 1/4/8/12 and CUDA with four host workers, a 3,600 second per case bound and a 14,400 second overall bound. These are limits, not predicted timings. Lloyd is a separate optional final CPU phase.
Never overwrite a completed package or result directory when repeating a study. The existing dev.3/dev.4 evidence and earlier two host dev.6 artifacts retain their original identities. This update adds measured L40 results without changing runtime code, algorithm defaults or admission limits. Paper scale workloads and out of core training remain outside the qualified protocol.
See the Machine learning module reference for the shared API.
Compare time and distortion across hardware
These retained runs use matching input hashes, dimensions, seeds and algorithm controls from the same compiled source. Each report retains its native executable identity and arithmetic.
2,048 rows · 16 dimensions · 32 clusters · 3 epochs · seed 42 · Float32 input
| Configuration | MSE | Median ms | Inertia | Timing runs |
|---|---|---|---|---|
| Apple M2 Max · e-means · Metal + CPU budget: 4 workers · Float32 | 6.72130 | 88.399 | 13765.2 | 5 |
| Apple M2 Max · o-means · Metal + CPU budget: 4 workers · Float32 | 11.1275 | 15.588 | 22789.0 | 5 |
| Apple M2 Max · p-means · Metal + CPU budget: 4 workers · Float32 | 11.1406 | 18.284 | 22816.0 | 5 |
| Tesla V100-PCIE-32GB · e-means · CUDA + CPU budget: 4 workers · Float32 | 6.72130 | 18.84 | 13765.2 | 5 |
| Tesla V100-PCIE-32GB · o-means · CUDA + CPU budget: 4 workers · Float32 | 11.1275 | 4.805 | 22789.0 | 5 |
| Tesla V100-PCIE-32GB · p-means · CUDA + CPU budget: 4 workers · Float32 | 11.1406 | 5.834 | 22816.0 | 5 |
| NVIDIA L40 · e-means · CUDA + CPU budget: 4 workers · Float32 | 6.72130 | 18.811 | 13765.2 | 5 |
| NVIDIA L40 · o-means · CUDA + CPU budget: 4 workers · Float32 | 11.1275 | 4.463 | 22789.0 | 5 |
| NVIDIA L40 · p-means · CUDA + CPU budget: 4 workers · Float32 | 11.1406 | 4.875 | 22816.0 | 5 |
MSE is inertia divided by the number of observations. Read it alongside elapsed time: these runs do not establish a speedup at equal quality or a general ranking of hardware. The default α calculation may differ by a few units in the last place across system math libraries; the pairing audit allows a tolerance of 10⁻¹² and preserves both recorded values.
This comparison retains Aner 0.0.10-dev.6 and shows each seed separately. CPU counts are worker budgets. Quality is from the final timed fit; each report retains every repeated loss. Methods use different complete recipes, while each method's controls and closing policy are paired across platforms.
Input and build provenance
Input SHA256: 698db4434ad2cfda96964d58e26b3a07e7c8f4899a5ba1eefd621dfeab0ba538
Compiled source SHA256: 648fe42e52ea5c6f62857fcb10aa416a832147e374bf3af03b156b383e601db3
CPU worker counts may differ across machines. Each GPU configuration uses four host workers. Exact recipes, resolved controls, raw timing runs and executable hashes are retained in each report.
K-means across CPU worker budgets
CPU execution on the Apple M2 Max machine with Aner 0.0.10-dev.6. This Lloyd engine uses exact accumulation and an iteration cap; it is a separate numerical experiment from the Float32 e/o/p series.
2,048 rows · 16 features · 32 centers · at most 3 Lloyd iterations · seed 42
| CPU budget | MSE | Median ms | Inertia |
|---|---|---|---|
| 1 worker | 10.98316 | 29.690 | 22493.51 |
| 4 workers | 10.98316 | 8.005 | 22493.51 |
| 8 workers | 10.98316 | 6.248 | 22493.51 |
| 12 workers | 10.98316 | 5.477 | 22493.51 |
Float32 input is widened for Float64 computation. The configured workspace cap is 64 MiB. Completed iterations and actual charged workspace were not captured by this frozen harness; its zero placeholders do not mean zero work or memory. A three iteration cap is not three e/o/p epochs or an equal quality target.
Inspect the Lloyd evidence and field corrections