Benchmarks

Measured against the specialists.

Fit-time scaling results for full-covariance Gaussian mixtures, Gaussian-emission HMMs, GPU fits, and profiling runs. Every comparison uses shared data, shared initialization, fixed iteration counts, and final log-likelihood checks.

HMM 15-25x vs hmmlearn
GMM 1.41x vs sklearn at 200k
GPU 500k full-cov points
Method correctness-gated fits

Methodology

The timing is only reported when the answer matches.

The harness measures comparable work: the same input arrays, the same initial parameters, and the same number of EM or Baum-Welch iterations.

Same data One workload array is handed to each package.
Same initialization Means, covariances, weights, and transitions are computed once and reused.
Same iteration count Early stopping is disabled so no package wins by doing fewer steps.
Same answer GMM likelihoods match to about 1e-7; HMM mean likelihoods match to about 1e-5.

Gaussian HMM

mixle is 15-25x faster than hmmlearn.

Many sequences from a latent regime process, Gaussian emissions, shared initialization, and fixed Baum-Welch iterations.

Data scaling

length 60, 8 states, 12 iterations
sequencesobservationshmmlearnmixlespeedup
25015,000352 ms23 ms15.5x
1,00060,0001,405 ms79 ms17.8x
4,000240,0005,695 ms316 ms18.0x

State scaling

1,000 sequences, length 60, 12 iterations
stateshmmlearnmixlespeedup
4876 ms45 ms19.4x
81,403 ms78 ms17.9x
163,448 ms158 ms21.8x
3210,886 ms435 ms25.0x

Full-covariance GMM

mixle matches the optimum and crosses over at scale.

scikit-learn and pomegranate are faster on small fits. mixle carries more fixed overhead, but its covariance accumulation scales better and crosses over near N=140k.

Data scaling

dim 32, 16 components, 15 iterations
Nsklearnpomegranatemixlevs sklearn
5,000101 ms125 ms144 ms0.70x
20,000399 ms316 ms615 ms0.65x
80,0002,227 ms2,318 ms2,870 ms0.78x
200,0005,522 ms5,812 ms3,919 ms1.41x

Dimension scaling

N 20,000, 8 components, 12 iterations
dimsklearnpomegranatemixle
885 ms57 ms89 ms
16105 ms71 ms122 ms
32170 ms152 ms241 ms
64384 ms362 ms540 ms
128835 ms881 ms1,206 ms

The stable crossover check measured mixle at 0.78x at N=80k, then 1.42x / 1.42x / 1.41x at 140k / 200k / 350k, with the same final likelihood.

GPU engine

The same full-covariance model runs on CUDA.

This is a capability panel, not a cross-machine speedup claim. The data-scaling run used an RTX 2080 Ti at dim 64 with 16 components.

GPU data scaling

full-covariance GMM, 12 iterations
Nfit timepeak GPU memory
50,0003.3 s1.7 GB
200,0008.9 s6.8 GB
500,00020.2 s16.9 GB

The dim-128 memory fix reduced a failing 21 GB intermediate to a 2.7 GB peak on an RTX 3060, with CPU parity at 2.5e-13. N=1M at dim 64 still needs chunking over N.

Scaling profile

The current bottlenecks are visible.

A separate A4000 + 16-core profiling run measured empirical slopes and cProfile hotspots across model families.

Data scaling

  • GMM: slope 0.95, about 0.9M rows/s.
  • MVN mixture: slope 1.03, about 0.14M rows/s.
  • HMM: slope 1.07, about 0.01M rows/s.

Hotspots

  • MVN: covariance second moment dominated by einsum.
  • GMM: mixture responsibility accumulation.
  • HMM: forward-backward plus NumPy reductions.

Open limits

  • Torch CPU is 11-31x slower than NumPy for these MVN fits.
  • Single-node model parallelism was 0.89x at N=200k.
  • Large high-dimensional GPU batches still need N chunking.