Manuscript Offprint

arXiv:2611.02449

Turbo-GMM: FlashAttention-Inspired GPU-Accelerated Gaussian Mixture Model

Momin Abbas, Sadia Asif, Asad Ul Haq, Kaoutar El Maghraoui

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Expectation-maximization (EM) for Gaussian mixture models (GMMs) requires scoring NN data points against KK mixture components. Prior fused GPU implementations, notably Flash-GMM, eliminate materialization of the N×KN \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×2.15\times speedup over the evaluated Flash-GMM implementation and up to 5.3×5.3\times and 9.9×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.

1 INTRODUCTION

Gaussian mixture models (GMMs), commonly fitted using expectation-maximization (EM), are widely used for density estimation and soft clustering (Dempster et al., 1977). Each EM iteration evaluates the likelihood of NN data points under KK mixture components, normalizes these scores into responsibilities, and accumulates sufficient statistics for parameter updates. Efficient execution on GPUs requires managing both the computational cost of these operations and the movement of intermediate data.

Conventional implementations may materialize an N×KN \times K responsibility matrix, introducing substantial memory traffic and storage overhead. Flash-GMM (Bloch et al., 2026) addresses this limitation by fusing the expectation and maximization steps without materializing the responsibility matrix. Consequently, eliminating this intermediate and its associated memory overhead is an established benefit of fused GMM implementations rather than a contribution unique to Turbo-GMM.

An additional opportunity arises from the traversal of the mixture components within a fused EM iteration. The

released Flash-GMM implementation processes the component dimension twice: first to compute the normalization terms and then to recompute component scores and accumulate sufficient statistics. Although the Flash-GMM paper also proposes a schedule that retains input data across both traversals, its released diagonal-covariance implementation reloads the data during the second pass. Thus, reading the input data once is not itself a new conceptual contribution. The distinction we investigate is whether the second traversal of the component dimension can be eliminated altogether.

The challenge follows from a dependency between the two EM reductions. Responsibility normalization requires scores from all KK components for each data point, whereas sufficient-statistic accumulation reduces over the data-point dimension. A conventional component-tiled fused implementation completes the normalization before revisiting the component scores to compute the statistics. However, when the entire component dimension can be retained on chip alongside a tile of data points, both reductions can be completed during a single traversal. This eliminates the need to recompute component scores in a second sweep.

Motivated by this observation, we introduce Turbo-GMM, a single-sweep fused EM kernel for diagonal-covariance GMMs. Turbo-GMM retains the complete component dimension on chip, computes responsibilities, and accumulates sufficient statistics within the same tile visit. The kernel

¹IBM Research ²Rensselaer Polytechnic Institute. Correspondence to: Momin Abbas Momin.Abbas1@ibm.com.

Preprint.

therefore performs one component traversal and one read of the input tile. Relative to two-sweep fused implementations, its distinguishing improvement is the elimination of the second component traversal and its associated recomputation, rather than the elimination of the responsibility matrix itself. The single-sweep design requires on-chip state proportional to KdKd, making register pressure and occupancy limiting factors as KK or dd increases. On the evaluated A100, the dispatch rule selects this kernel when Kpad≤128K_{\mathrm{pad}} \leq 128 and Kpaddpad≤4096K_{\mathrm{pad}}d_{\mathrm{pad}} \leq 4096 (§5.2); these are implementation-specific thresholds, not universal hardware limits. Otherwise, Turbo-GMM uses a two-pass fused fallback.

We analyze the equivalence of the single-sweep and two-pass formulations to standard EM in real arithmetic, including arbitrary tilings and partial tiles (Theorem 1). We also characterize their data-access costs under an explicit memory-traffic model (Theorem 2). These analyses distinguish the existing benefit of avoiding materialized responsibilities from the additional savings in data traversal and score recomputation enabled by the single-sweep kernel.

We evaluate Turbo-GMM on sixteen configurations covering different dataset sizes, component counts, and feature dimensions using an NVIDIA A100 GPU. Under the reported experimental protocol, Turbo-GMM achieves a median 2.15×2.15\times speedup over the evaluated Flash-GMM implementation, with improvements depending on whether the component dimension can be retained efficiently on chip. The results also identify cases in which resource limitations make the two-pass fallback necessary or preferable. The performance comparisons are discussed in §5.3, with limitations in §7.

References (52)