Turbo-GMM: FlashAttention-Inspired GPU-Accelerated Gaussian Mixture Model
cs.LG, cs.AI, cs.AR, cs.DC
Submitted: 2026-11-02
Updated: 2026-11-02
Code: https://github.com/mominabbass/turbo-gmm
License: http://creativecommons.org/licenses/by/4.0/
The gist: Expectation-maximization (EM) for Gaussian mixture models (GMMs) requires scoring N data points against K mixture components.
Terminology
Abstract
Expectation-maximization (EM) for Gaussian mixture models (GMMs) requires scoring N data points against K mixture components. Prior fused GPU implementations, notably Flash-GMM, eliminate materialization of the N times K responsibility matrix but traverse the component dimension twice to compute normalization terms and accumulate sufficient statistics. We introduce Turbo-GMM, a single-sweep fused EM kernel that completes responsibility normalization and sufficient-statistic accumulation within one traversal of the component dimension. By retaining the complete component axis on chip, Turbo-GMM avoids the second score computation required by the released two-sweep Flash-GMM implementation. Its applicability is limited by register pressure, occupancy, and the component and feature dimensions, making it particularly suitable for large datasets with relatively small numbers of components. For larger configurations, Turbo-GMM employs a two-pass fallback following the established fused design. We establish algebraic equivalence to standard EM in real arithmetic and evaluate sixteen configurations on an NVIDIA A100. Under the reported benchmarking protocol, Turbo-GMM achieves a median 2.15 times speedup over the evaluated Flash-GMM implementation and up to 5.3 times and 9.9 times over PyTorch and scikit-learn, respectively. The results demonstrate the potential of single-sweep component traversal while identifying on-chip resource constraints as the principal limitation of this approach.
Sources
- Flash-GMM: A Memory-Efficient Kernel for Scalable Soft Clustering
- FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Liger Kernel: Efficient Triton Kernels for LLM Training
- Online normalizer calculation for softmax
- Self-attention Does Not Need $O(n^2)$ Memory
- FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision
- Cut Your Losses in Large-Vocabulary Language Models
- Flash-KMeans: Fast and Memory-Efficient Exact K-Means
Related papers
- FlexMoE: Learning One-for-All Multi-Budget Expert Pruning for Flexible MoE Deployment
- OptiMind: Improving Small Language Models for Optimization Modeling through Formulation Guidance and Multi-Turn Learning
- Staying in the Sweet Spot: Boost Reasoning Evolution via Responsive Rollout Difficulty Manipulation
- Examining the Impact of Data and Training Methods on Emergent and Subliminal Misalignment
- Rethinking Black-Box On-Policy Distillation: A Rubric-based Analysis
- (Mis)generalization of Helpful-Only Fine-tuning