Browse documentation
aner.ml · Reference

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 APIs

The 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)MethodM2 Metal msV100 CUDA msL40 CUDA msMedian MSE
(2048,16,32)e-means86.82218.67218.8115.788248
(2048,16,32)o-means15.5614.8054.4488.412811
(2048,16,32)p-means18.2845.8144.8758.681518
(8192,32,64)e-means16.4994.5654.25916.331593
(8192,32,64)o-means19.4288.2439.21817.895855
(8192,32,64)p-means21.24710.0479.81116.105007
(16384,32,4096)e-means70.94433.94519.94417.492098
(16384,32,4096)o-means125.756128.538107.94016.944830
(16384,32,4096)p-means105.160128.390110.01817.785086
(65536,32,4096)e-means139.08269.64739.30414.584420
(65536,32,4096)o-means211.817200.991128.72914.468577
(65536,32,4096)p-means137.278148.183116.92514.009819
(8192,512,128)e-means28.9349.5186.891303.186332
(8192,512,128)o-means103.266112.65447.971299.329242
(8192,512,128)p-means71.78060.24742.169262.388272
(8192,1024,128)e-means40.68715.4099.044612.110170
(8192,1024,128)o-means180.966220.08883.669649.485679
(8192,1024,128)p-means119.905129.76570.581670.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

HostReported logical CPUsCPU modelMeasured e/o/p CPU budgets
M212Apple M2 Max1/4/8/12 on the four original shapes; 4 on wide shapes
V100 host24Intel Xeon Gold 6248 at 2.50 GHz1/4/8/12/24 on every shape
L40 host32Intel Xeon E5-2630 v3 at 2.40 GHz1/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:

MethodM2 CPU msV100 host CPU msL40 host CPU ms
e-means735.4962,312.9073,133.352
o-means765.8641,578.6702,352.731
p-means378.403934.5511,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 workersM2 CPU msV100 host CPU msL40 host CPU ms
128.86487.464103.354
48.02823.52929.276
85.76912.54117.171
124.9979.88313.798
24Not measured9.149Not 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.

ArtifactIdentity
Runtime0.0.10-dev.6
Shared compiled source SHA256648fe42e52ea5c6f62857fcb10aa416a832147e374bf3af03b156b383e601db3
M2 benchmark SHA25678ad933df0fb3f3ac3dff0cdf9a332e6899a87387522391d5d976ce1dd1ea127
Shared V100/L40 benchmark SHA2569fa07bb8e94f9eaf16a6f679adebad2de252f2f05053444afe92fb3198812104
L40 package manifest SHA25680f28e6ae1dc67b82547a0bc4660d21628e49b71ffbf10a197d9f621a9f5bb27
Collected L40 receipt SHA256db61598baee2d8c66c338464b101b397afeb4b5fdc831003b4e4dcbe4812c11e

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.

Matched input, measured execution

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

Apple M2 Max · e-means · Metal + CPU budget: 4 workers · Float3288.399 ms
Apple M2 Max · o-means · Metal + CPU budget: 4 workers · Float3215.588 ms
Apple M2 Max · p-means · Metal + CPU budget: 4 workers · Float3218.284 ms
Tesla V100-PCIE-32GB · e-means · CUDA + CPU budget: 4 workers · Float3218.84 ms
Tesla V100-PCIE-32GB · o-means · CUDA + CPU budget: 4 workers · Float324.805 ms
Tesla V100-PCIE-32GB · p-means · CUDA + CPU budget: 4 workers · Float325.834 ms
NVIDIA L40 · e-means · CUDA + CPU budget: 4 workers · Float3218.811 ms
NVIDIA L40 · o-means · CUDA + CPU budget: 4 workers · Float324.463 ms
NVIDIA L40 · p-means · CUDA + CPU budget: 4 workers · Float324.875 ms
Warm resident fit including initialization, index maintenance, training, closing, exhaustive final assignment, output construction and backend/scratch destruction; excludes data generation, input hashing/upload and returned model destruction. One warm up fit per process; cases run serially. Lower elapsed time is faster. Equal budgets do not imply equal clustering quality.
Quality from the same measured configurations
ConfigurationMSEMedian msInertiaTiming runs
Apple M2 Max · e-means · Metal + CPU budget: 4 workers · Float326.7213088.39913765.25
Apple M2 Max · o-means · Metal + CPU budget: 4 workers · Float3211.127515.58822789.05
Apple M2 Max · p-means · Metal + CPU budget: 4 workers · Float3211.140618.28422816.05
Tesla V100-PCIE-32GB · e-means · CUDA + CPU budget: 4 workers · Float326.7213018.8413765.25
Tesla V100-PCIE-32GB · o-means · CUDA + CPU budget: 4 workers · Float3211.12754.80522789.05
Tesla V100-PCIE-32GB · p-means · CUDA + CPU budget: 4 workers · Float3211.14065.83422816.05
NVIDIA L40 · e-means · CUDA + CPU budget: 4 workers · Float326.7213018.81113765.25
NVIDIA L40 · o-means · CUDA + CPU budget: 4 workers · Float3211.12754.46322789.05
NVIDIA L40 · p-means · CUDA + CPU budget: 4 workers · Float3211.14064.87522816.05

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.

Inspect the comparison manifest
Separate strict Float64 study

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: 1 worker29.690 ms
CPU budget: 4 workers8.005 ms
CPU budget: 8 workers6.248 ms
CPU budget: 12 workers5.477 ms
Warm CPU fit including input host materialization if needed, initialization, up to three Lloyd updates and final evaluation; excludes generation/hashing and returned model destruction. Each bar is the median of five timed fits after one warm up. A budget does not guarantee every worker remains active.
Final timed fit at the selected seed
CPU budgetMSEMedian msInertia
1 worker10.9831629.69022493.51
4 workers10.983168.00522493.51
8 workers10.983166.24822493.51
12 workers10.983165.47722493.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
Aner documentation · Reference and guides