Manuscript Offprint
arXiv:2611.02449Turbo-GMM: FlashAttention-Inspired GPU-Accelerated Gaussian Mixture Model
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 data points against mixture components. Prior fused GPU implementations, notably Flash-GMM, eliminate materialization of the 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 speedup over the evaluated Flash-GMM implementation and up to and 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 data points under 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 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 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 , making register pressure and occupancy limiting factors as or increases. On the evaluated A100, the dispatch rule selects this kernel when and (§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 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.
-
We characterize the resource constraints and operating regime of single-sweep execution, including the effects of component count, feature dimension, register pressure, and occupancy. An empirically determined dispatch rule selects the single-sweep implementation where effective and a two-pass fallback otherwise (§5.2).
-
We establish algebraic correctness in real arithmetic and analyze the data-access costs of both implementations, explicitly distinguishing inherited fusion benefits from the additional reductions associated with single-sweep execution (§4).
-
We experimentally evaluate Turbo-GMM against fused GPU implementations and established GMM libraries, identifying the workloads in which single-sweep traversal
improves latency and the configurations in which on-chip resource limitations restrict its benefits (§5.3).
2 BACKGROUND AND THE STANDARD IMPLEMENTATION
In this section we establish the baseline that the rest of the paper measures against: the EM iteration and our notation (§2.1), the expanded score that libraries evaluate in practice and the standard dataflow it yields (§2.2, Algorithm 1), and the two properties of that dataflow which decide whether the iteration can be fused at all (§2.3)—the second of which §3 exploits.
2.1 The EM Iteration
Data and notation. Throughout, holds data points as its rows , where is the dimension of each point. We denote by the elementwise product and by elementwise division, and let shapes broadcast in the usual way.
The mixture model. We follow the standard parameterization of a Gaussian mixture (Bishop, 2006). A mixture of diagonal Gaussians is described by three parameters: mixture weights , strictly positive and summing to one, which say how much of the data each component accounts for; means with rows , one centre per component; and variances with rows , one width per component and per dimension. Positivity is what makes and well defined, and the algorithm uses both. EM fits these parameters by ascending the log-likelihood
in two alternating stages.
The E-step. The first stage asks how strongly each component explains each point. It forms a score matrix of log joint densities, then normalizes it along the component axis:
We call the row normalizers and the responsibilities: is the posterior probability that point was generated by component , so every row of sums to one. This is the matrix the paper is about.
The M-step. The second stage refits each component to the points it now owns, weighting every point by its responsibility. It reduces into three sufficient statistics, then renormalizes them into parameters:
(4)
Here is the soft number of points assigned to component , while and are the responsibility-weighted first and second moments of the data; on the right of (5) is the updated mean, and we assume . The additive covariance regularizer (scikit-learn's reg_covar) ensures strictly positive variances when in real arithmetic. For , (5) is the standard maximum-likelihood M-step, and EM does not decrease (1) when the updates remain well defined (Wu, 1983). For , the variance update is regularized and is not the exact maximum-likelihood M-step; we make no monotonicity claim for (1) or for an unspecified penalized objective. Since equals (1) at the incoming parameters, the E-step also provides the log-likelihood used for convergence monitoring.
2.2 The Score as a Single Bilinear Product
Evaluated as written, (2) sums elementwise terms for each of the pairs, which leaves idle the matrix-multiply units that supply most of a GPU's throughput. No library evaluates it that way. Instead they expand the quadratic form and assemble the score from matrix products, exactly as -means expands to reuse norms and reach the same units (Johnson et al., 2021). We state the form we use below, since the fused kernels of §3 inherit it.
Lemma 1 (Lift). Let be the precisions, and define
(6)
Then the score matrix of (2) satisfies exactly, with the all-ones column,
Algorithm 1 Standard GMM-EM implementation (one iteration)
Require: Data and parameters resident in HBM
Ensure: Updated , log-likelihood
1: Precompute the lift , , b by (6)-(7)
2: // Stage 1: E-step
3: Kernel 1 (Score): Load blocks of X and of from HBM
4: Compute by (8), as two products against X and
5: Write to HBM // NK floats committed to HBM
6: Kernel 2 (Normalize):
7: for all row do
8: Load from HBM, compute and
9: end for
10: Write responsibilities to HBM // Second round trip
11: Write normalizers to HBM
12: // Stage 2: M-step
13: Kernel 3 (Square): Read X from HBM
14: Write to HBM // Recomputable from X in registers
15: Kernel 4 (Accumulate): Initialize , to 0 in HBM
16: Read , gemv: // 1st read of
17: Read , X, gemm: // 2nd read of
18: Read , , gemm: // 3rd read of
19: Kernel 5 (Normalization): Read n, s, u from HBM
20: Apply the parameter updates (5)
21: Write to HBM, and set
The proof, by expanding the squared distance, is given in Appendix C.1.
In words, (8) says that the entire score matrix is one matrix product plus a per-component offset. This is what libraries already compute: scikit-learn evaluates the same form for diagonal covariances, as two matrix products against X and plus a per-component constant (Pedregosa et al., 2011), and Lemma 1 merely writes the two products as one of width 2d. Two consequences matter for a fused kernel. First, the score is bilinear in , so a tile of rows and the parameters determine a tile of S, which lets a kernel build S on chip. Second, the block depends on alone, so the kernel forms it in registers and never stores it. Building and b costs once per iteration, after which both stay resident. Algorithm 1 writes (2)-(5) in these terms: five kernels handing S and through HBM.
Algorithm 1 is an archetype, not a transcription of one library: every count in §2.3, the four reads of S and included, prices Algorithm 1 as written and measures no library. Its dataflow resembles the array-API path of scikit-learn (Pedregosa et al., 2011), which keeps score and log-responsibilities as two concurrent arrays, forms as an temporary, and traverses once per statistic. cuVS (RAPIDS Development Team, 2026) instead tiles the row axis and normalizes in place, bounding the live responsibility block; §7 treats that stronger baseline.
2.3 What Governs Whether the Iteration Can Be Fused
Two properties of Algorithm 1 govern what a fused kernel can achieve. The first says that removing the intermediate is worth doing at all; the second says how many times a kernel that removes it must still read the data.
A traffic ledger for Algorithm 1. What follows counts elements moved by each kernel's own definition, not a profiled DRAM-counter measurement (§4 makes this explicit for the fused forms as well). Two arrays dominate its HBM traffic: Kernel 1 writes , Kernel 2 reads it and writes , and Kernel 4 reads once per statistic. The subtotal is elements written and read, none of it output. On the input side is read three times, by Kernels 1, 3 and 4, and the temporary adds a round trip for a quantity Lemma 1 recovers in one instruction, so the input side costs against for the parameters and the statistics. Once passes (Theorem 2), an array no consumer inspects prices the iteration, and Kernel 1 already runs at full throughput. Yang et al. (2026) argue this for the -means distance matrix, and Bloch et al. (2026) for the responsibilities.
The two reductions run along opposite axes. An EM iteration contains two reductions, and they are not alike. The statistics (4) sum over the point index , so they decompose over any partition of the rows and combine by ordinary addition: a kernel may accumulate them from row blocks in any order. The normalizer (3) sums over the component index instead, and admits no such partial commitment, because cannot be formed until the whole row is known. The consequence is the one the next section exploits. Since Lemma 1 already lets a kernel build a tile of on chip, one pass over the data suffices exactly when the component axis is resident there too, for then the normalizer completes within a single tile visit and leaves the statistics nothing further to read. That condition is what separates Algorithm 2 from Algorithm 3.
3 METHOD
In this section we introduce Turbo-GMM, a fused EM iteration that keeps the responsibility matrix on chip and never gives it an address in memory. Which of two forms runs is decided by one property of the problem shape: whether a whole component axis fits on chip beside a block of rows. When it does, a single traversal of that axis suffices and the kernel reads the data exactly once (§3.1); when it does not, a second traversal becomes unavoidable, and we fall back to the design point of prior fused work (§B). §5.2 states the rule that chooses between the two, and §4 proves that both compute the iteration of §2.1 exactly.
Algorithm 2 Turbo-GMM, one-pass form (fused E-step and M-step, nothing materialized)
Require: , parameters , tiles (points) and (components), so the component axis is resident; padded lanes predicated out
Ensure: , log-likelihood
1: Precompute the lift , by (6)–(7)
2: Initialize in HBM
3: for all point tile of size in parallel do
4: Load into registers; initialize on-chip
5: Load from HBM on chip // read exactly once
6: Form in registers // never materialized
7: Compute on chip, // never in HBM
8: Per row of the tile: ,
9: Accumulate (4): ,
10: atomic.add into // additive: atomics legal
11: end for
12: Compute by (5)
3.1 Turbo-GMM: Single-Sweep Component Traversal
Our goal is an iteration that reads once. The obstacle is the one §2.3 identified: a responsibility cannot be used until its whole row of scores is known. Our way around it is to arrange that the row is completed inside a single tile visit. Let denote the number of rows a kernel instance holds on chip and the number of components it holds alongside them. When the component axis is resident, so one visit sees an entire row of , the normalization of (3) finishes there, and the E-step and the M-step collapse into a single kernel. We describe it formally in Algorithm 2.
The kernel computes the score of Kernel 1 of Algorithm 1 arithmetically unchanged—only its address differs—reads once, forms in registers, and writes out nothing but the statistics.
Masking partial tiles. When does not fill a tile, the padding columns must be masked with a large finite sentinel ( in our kernel, just inside the float 32 range) rather than with , since propagates into the reduction. The price is that in real arithmetic still contributes to , vanishing only by float 32 underflow. Theorem 1 predicates padded lanes out exactly, so the kernel realizes it only up to that underflow.
Reusing the exponentials. Form as , which reuses the exponentials already computed for , rather than as a second . Only the one-pass form offers this reuse, because only there are those exponentials still on chip.
The ledger after fusion. Algorithm 2 gives neither nor an address, so both round trips counted in §2.3 vanish, as does the temporary; all that remains proportional to is the single read of . Theorem 2 states the three ledgers exactly, and the saving over Algorithm 1 grows with . Measured latency follows that prediction in the direction but not in the direction, where our margin falls below parity from upward—the width at which the component axis stops fitting on chip, so that Algorithm 3 carries the comparison instead (§5.3).
3.2 The General Case: Two Passes When the Component Axis Does Not Fit
When is too large for the component axis to stay resident, no single tile visit can complete a row's normalizer, so Turbo-GMM falls back to a two-pass design at the point Bloch et al. (2026) occupy: pass 1 sweeps the component axis once to accumulate only the row normalizers, state rather than ; pass 2 then re-reads the data once per component tile, recomputes the score from the stored normalizer, and accumulates the sufficient statistics. This trades one extra read of the data for covering every , at the cost of the score recomputation that Algorithm 2 avoids. Algorithm 3, including the online-softmax merge rule it uses to combine partial normalizers exactly, is given in full in Appendix B.
4 EXACTNESS AND COST
We establish that both fused kernels compute the standard EM updates (Theorem 1) and characterize their HBM traffic (Theorem 2). Proofs are provided in Appendix C.
Theorem 1 (Exactness). Fix , data with , weights and variances ; take in Algorithm 2, so that its single component tile is the whole axis, and assume padded lanes are predicated out on both axes, the statistic accumulators seeded at 0 and the fold of (10) seeded with any pair whose second coordinate is 0. Partition the rows into nonempty tiles, and for Algorithm 3 partition the components likewise, each of its two passes choosing its partitions independently and pass 2 running after pass 1 has written ; tile sizes need divide neither nor . Then, in real arithmetic, Algorithms 2 and 3 return the statistics of (4) and the log-likelihood of (1) at the incoming , for every such partition and every order in which the tiles are visited. Moreover for every , so the updates (5) are defined and also agree.
Its content is that the two reductions of an iteration reassociate independently: the statistics (4) fold over addition on the row axis, and the normalizer of (3) folds over the of (10) on the component axis. We state exactness against (1)–(4) rather than against Algorithm 1, which is an archetype (§2.2) and so a weaker reference. The theorem also chains across the iterations of a run: each row of sums to one, so
and the updated weights again lie in the open simplex, while is a weighted variance and hence nonnegative, so and the output of one iteration satisfies the hypotheses of the next whenever (Appendix C).
Theorem 2 (HBM traffic). Count elements moved between HBM and the chip, charging one for a read, one for a write, and two for an atomic update, with no cache between the two; on-chip state is free. Let and be the tile counts. In Algorithm 2 the row tiles are distributed over programs, each loading the lift once and committing its partial statistics once; this is the launch our kernel uses and the only place the mapping enters a ledger. Then one iteration moves
elements, the parameter terms and being upper bounds, since the lift is only elements and may in practice stay resident in a last-level cache across row tiles. Whenever , Algorithm 2 moves , which is optimal up to constants among exact algorithms that receive and return in HBM, while Algorithm 1 moves whenever , in particular whenever .
The full term-by-term accounting of each ledger, including why the two-pass form's refetched lift term dominates its reads of , is in Appendix C.
Our verification is stronger than the theorem needs: it compares against the centered (2), which also covers Lemma 1. That lemma is an exact algebraic identity, true by direct expansion for every (Appendix C). We check both tiled forms against a 60-decimal-digit mpmath extended-precision reference (mpmath development team, 2026) on a battery of small cases, including and , at both of our numeric paths (ieee and tf32x3, three tensor-core passes at reduced input precision with an fp32 accumulator, against one pass for bf16), and against scikit-learn's and PyTorch's own E- and M-step primitives; separately, we sweep a double-precision materializing oracle over multiple larger shapes and tile sizes. Across both checks the tiled algorithms agree with the untiled computation to within ordinary floating-point roundoff, not a difference in the underlying mathematics. In float64 the summation order differs, so agreement there is a relative bound rather than a bitwise one.
What the theorem does not cover. Theorem 1 and the checks above concern real arithmetic, and the float32 kernel departs from its hypotheses twice. It masks padded columns with the finite sentinel of §3.1 rather than predicating them away, so it realizes the theorem only inside the single-precision exponent range; and where a well-separated component underflows , and with it, it divides by plus ten float64 machine epsilon, returning (5) of a perturbed argument. We check it by measurement instead (§5.3, §5.4).
A numerical precondition inherited from the expansion. The lifted score subtracts terms of magnitude , losing relative accuracy as the data moves away from the origin, so implementations must center the data (§7); Appendix C quantifies the loss and traces it to the same cancellation that destabilizes a naive sum-of-squares variance formula (Chan et al., 1983).
5 EXPERIMENTS
Theorem 1 says the fused iteration computes the right thing and Theorem 2 that it moves less data. Neither says it runs faster: fusion buys the traffic it saves with on-chip state, and in the two-pass form with a recomputed score. What the experiments locate is the boundary of that trade over . We evaluate three claims.
-
Latency. Against the closest fused kernel, Turbo-GMM is faster on eleven of the fifteen shapes both complete, by a median ; against the libraries a practitioner would reach for, by up to over PyTorch and over scikit-learn. The advantage is conditional, and we identify the three conditions that remove it.
-
Memory. Peak memory is flat in the number of components—128 to 139 MB from to 4096, against 3.2 to 47 GB for implementations that materialize the responsibilities. This claim carries no condition, and at the widest setting it decides feasibility rather than speed.
-
Where the gain comes from. An ablation separates the single sweep of the component axis, the one change without precedent, from the two fusions that precede it. The single sweep is worth up to over our own two-pass fallback (not a margin over Flash-GMM; the comparable Flash-GMM control point is , Appendix F), and at it is the only one of the three that keeps fusion profitable at all.
Latency is always reported at fixed quality: we re-score every arm's returned parameters in double precision and admit only valid fits. For the full protocol, the dispatch measurements, the ablation ladder and the cells that failed, see Appendix D, whose Table 1 gives every arm's latency, memory and gate outcome at all sixteen shapes; the comparison against prior fused work has its own Appendix F.
5.1 Setup
Baselines. Figure 1 compares Turbo-GMM against seven baselines. Flash-GMM (Bloch et al., 2026) is the closest prior work: it fuses the same iteration but traverses the component axis twice, isolating the contribution of our single sweep (§B). cuVS (RAPIDS Development Team, 2026) is the strongest library baseline and the only other row-titled implementation. The remaining libraries are PyTorch (Paszke et al., 2019), scikit-learn (Pedregosa et al., 2011), gmmx (Donath, 2024), torchgmm (Varrone, 2023), and pomegranate (Schreiber, 2018); versions are listed in Appendix E.
Protocol. Every arm is diagonal-covariance and starts from one seeded dataset and one shared initialization, on one NVIDIA A100-SXM4-80GB. The sweep covers sixteen shapes in four regimes—large , large , a sweep, and small —one of which belongs to two, so Figure 1 shows seventeen bar groups. Both fused kernels run at tf32x3, which makes the comparison between them one of dataflow rather than of number format; the libraries run at fp32—for PyTorch specifically this means explicitly disabling its allow_tf32 matmul setting, an exposed control we turn off rather than a default the library lacks. Two choices run against us, and we flag them here rather than in an appendix: the latency estimator is not identical across arms, mildly favouring cuVS, and we widened Flash-GMM's published autotune list so that it could select the small blocks fp32 needs, cutting our largest margin from to (Appendix D).
What counts as a result. A latency means nothing without the objective the arm reached, and some libraries return an unusable model without saying so. We therefore re-score every arm's returned parameters in double precision and accept a fit only if its log-likelihood is finite and, for arms that return mixture weights, . Runs that fail the gate sit at the axis floor of Figure 1 and drop out of every memory and aggregate-count comparison below, with one disclosed exception: §5.3 and Appendix F keep and explicitly flag Flash-GMM's latency point even though it fails this gate, since a single E-step there is itself exact (Appendix G) and we would rather disclose a borderline inclusion than silently drop a data point that completed.
5.2 Which algorithm runs where
Algorithm 2 runs wherever the component axis fits on chip and Algorithm 3 only where it does not, so before reading any latency we have to fix which of the two produced it. Two limits bound the fit. The first is capacity: the loop-carried state spans the whole component axis, , and past the compiler cannot place it in the NVIDIA A100's shared memory at all. The

Figure 1. Latency per EM iteration against seven baselines on one NVIDIA A100-SXM4-80GB, four regimes, logarithmic axis, lower is better. A star marks the three configurations that fall back to Algorithm 3 because Algorithm 2 does not fit on chip; Algorithm 2 runs elsewhere. Axis-floor markers returned no valid fit, keyed in the legend; one such point, Flash-GMM at , is nonetheless discussed by latency in §5.3 and Appendix F as a disclosed exception to this criterion, so it is absent from this figure but present in those aggregate numbers. Protocol and validity criterion: §5.1; dispatch: §5.2.
second is occupancy, and it binds first: the accumulator spills registers well inside the capacity bound, and the cliff does not follow . Dispatching on capacity alone would therefore be wrong, and measurably so: holding the footprint fixed and trading against swings the ratio between the two algorithms by , and one configuration that capacity admits costs the one-pass form . We consequently dispatch on two measured conditions rather than one derived one, taking Algorithm 2 when and . For the capacity arithmetic and the probes behind the rule, see Appendix D.
Under that rule three of the sixteen shapes, at , fall to Algorithm 3 and carry a star in Figure 1. On the other thirteen, where both of our algorithms run, the one-pass form wins every shape—median over our own two-pass fallback, and over it at , one measured point rather than a curve in —because it sweeps the component axis once and never recomputes the score. (This is a margin over our own fallback, not over Flash-GMM; §5.3 and Appendix F give the margins over Flash-GMM.)
5.3 Latency and memory
All arms reach the same optimum. Where two or more arms produced a valid fit, they agree to relative on the final log-likelihood and to on the adjusted Rand index of the induced clustering, and the two fused kernels agree to . What follows compares cost at fixed quality.
Peak memory is flat in , and at the widest setting it decides feasibility. Turbo-GMM never writes the responsibilities, so its inputs govern its peak: from to at that peak grows only from 128 to 139 MB, a factor of 1.1, against 3.2 to 47 GB for the largest baseline peak with a valid fit— to ours, over the four library arms that report peak memory at all. The consequence is not a constant factor. At , scikit-learn exhausts the 80 GB device and pomegranate fails outright, while Turbo-GMM completes in 139 MB.
Against libraries, the advantage is ordered in d and disappears at small N. Measured against the fastest library with a valid fit at each shape, Turbo-GMM is 2.7–4.2× faster at large and 2.5–2.6× at large ; taken one library at a time the maxima are 5.3× over PyTorch and 9.9× over scikit-learn. Across the sweep the range is wider, 0.99–5.3×, and it falls in at every fixed we measure, reaching parity at , : this is the shape at which the intermediate we remove drops below the input traffic that no implementation avoids, so a traffic argument no longer separates us (Theorem 2). At we are slower still, 0.45–0.73× the best baseline, because the responsibility matrix is too small there for its removal to pay against launch and reduction overheads. Fit a small mixture with a library.
Against the closest fused kernel, the comparison splits at the on-chip boundary. Flash-GMM times fifteen of the sixteen shapes, failing to launch at on its published list. Turbo-GMM, dispatched by §5.2, wins eleven of the fifteen by 1.06× to 4.28×—median 2.15× over all fifteen and 3.02× over the wins. The four exceptions are placed rather than scattered. One is the small- tie (0.99×). The other three are exactly the shapes at which Algorithm 2 has left the chip and our two-pass fallback meets their kernel at its own design point, and we lose all three: 0.93×, 0.78× and 0.73× at and 4096. The margin is thus ordered in only through the dispatch boundary: at it falls monotonically as rises and reverses exactly where the fallback takes over (Appendix F). We have not identified the mechanism of that reversal, and Theorem 2 does not supply one, since it separates the two designs on no term (§7). One caveat at : their kernel completes in 65.2 ms but returns mixture weights off the simplex (), traced in Appendix G to a collapsed component variance, so its latency counts against a fit our own gate rejects. Appendix F places the two designs side by side.
Three libraries fail silently. The gate rejected six otherwise-successful runs, spread over gmmx, torchgmm and pomegranate, which completed, reported success, and returned a non-finite log-likelihood. Four of the six sit at , the regime this paper is about, so a harness that trusted exit status rather than re-scoring the returned parameters would enter all six in its table (Appendix D). Turbo-GMM returned a valid fit at all sixteen shapes.
5.4 Where the gain comes from
Figure 1 says where the fused iteration is faster; it does not say which change is responsible, and the changes are not equally novel. Three separate Algorithm 1 from Algorithm 2: fusing the score into one kernel, which any library could adopt; fusing the E- and M-steps to remove the intermediate, which Bloch et al. (2026) also do; and the single sweep of the component axis, which has no precedent. If the first two carried the margin, the advice this paper gives
would stop at a fused two-pass kernel. We therefore build a cumulative ladder, each rung adding one change to the ones below it so that the factors compose, and run all four rungs on six configurations from Figure 1. Every rung agrees with the baseline to relative on all four returned quantities, so the ladder varies dataflow and not arithmetic. For the rungs, the protocol and two caveats, see Appendix D.
The three factors are unequal, and which of them dominates depends on the shape. The score kernel returns 1.25–1.44×; the E/M fusion 1.24–3.18× where it helps at all; the single sweep 1.21–2.32× at . Where all four rungs run—five configurations—the product ranges from 1.46× to 5.14×. What licenses reading the rest is that the first rung is also the most tightly bounded: the one rung that confounds dataflow with implementation language never exceeds 1.44×, so it cannot account for a product of 5.14×.
At the single sweep is not an optimization but the reason fusion pays at all. The middle rung is not monotone, and this is the central result of the ablation. At , , , our two-pass Algorithm 3 runs 17.4× slower than leaving the steps apart and 13.3× slower than the materializing baseline; the single sweep then recovers 19.4× relative to our own two-pass form (not a margin over Flash-GMM), a net 1.46× over the standard dataflow, re-measuring the 19.5× of §5.2 (also vs. our own two-pass form) to within 1%. The mechanism is the score recomputation that a second sweep forces. Two limits bound how far this generalizes. A control at the same shape charges most of the 17.4× to our implementation rather than to two-sweep fusion as such—at this shape, Flash-GMM (an independently written two-sweep kernel) regresses by only 2.07× against the materializing baseline, not by an order of magnitude (Appendix F): this is Flash-GMM's own number at , the one to use for competing published work, not the internal 19.4× above. And is the widest configuration we measure and the only one at which the inversion appears, so this is an existence result rather than a curve in .
Latency and footprint come from different rungs. The ladder also localizes the memory result of §5.3: at every shape but the widest we measure, the score rung leaves peak memory unchanged, the E/M rung cuts it 87-fold—12.4 GB to 142 MB at , —and the single sweep barely moves it further. At the score rung alone already sheds 27.7% (6.4 GB to 4.6 GB), because that is where Algorithm 1's squared-data temporary is largest; the E/M and single-sweep rungs account for the remaining reduction there. No saving is counted twice either way, and at the net margin over the standard dataflow is 1.46×; Figure 2 supports no more.

Figure 2. Cumulative mechanism ablation. Each bar adds one dataflow change to the ones below it; height is speedup over the Algorithm 1 dataflow, so the bars multiply and the dashed line is parity. The middle rung is not monotone: at our two-pass Algorithm 3 runs slower than not fusing, and only the one-pass Algorithm 2 recovers it—opposite in direction to the of §5.2, a loss of Algorithm 2 at , . A red marks a rung that exceeds SRAM. Every rung agrees with the reference to ; see §5.4.
6 RELATED WORK
Online normalizers and IO-aware kernels. The mergeable summary we fold over component blocks originates with Milakov & Gimelshein (2018): one pass for the softmax maximum and normalizer, merged by a binary operator on . Rabe & Staats (2021) apply the recurrence to attention without materializing the logit matrix; Dao et al. (2022) make it IO-aware, with an explicit HBM bound—an arithmetic-intensity argument in the sense of Williams et al. (2009): once an array's bytes moved exceed what its FLOPs can hide, removing the array outright is what changes which resource binds, the crossover §2.3 locates at . Ivanov et al. (2021) make the identical traffic-dominates-compute case for transformer training, by relaying out and fusing kernels rather than removing an intermediate outright. Dao (2023) contribute the storage our two-pass variant reuses: the single quantity , from which a second pass recovers the responsibilities out of state. Their un-scaled output accumulator does not transfer to a mixture M-step (§2.3). Shah et al. (2024) push the same two-sweep design to Hopper's asynchronous tensor cores and fp8, a hardware-scheduling gain orthogonal to the pass count we remove. Wijmans et al. (2025) and the Liger kernel library (Hsu et al., 2024) apply the identical refusal to cross-entropy's logit matrix, evaluating the loss chunk by chunk rather than materializing it; ours is the same shape of intermediate for a different reduction. Blanchard et al. (2021) analyze batched log-sum-exp accuracy, complementary to our exactness question. That change of variables is standard in online-softmax derivations; what Theorem 1 adds is that the mixture sufficient statistics reassociate over any partition, with tile sizes that need not divide or .
Fused clustering and mixtures. Yang et al. (2026) fuse the assignment step of Lloyd's algorithm (Lloyd, 1982), streaming centroid tiles past a resident point tile with a running (min, arg min) in registers, at traffic. Theirs is the hard-assignment limit of ours—-means is a mixture with vanishing variances—and the easier one, since a minimum admits no normalizer, hence no rescaling of weighted statistics. Bloch et al. (2026) are the closest prior work and our main baseline: they fuse the EM iteration in Triton at the same traffic, for the isotropic case, of which our diagonal case is the generalization, and with a pointwise score rather than the single matrix product of §2.2. Their kernel sweeps the component axis twice, recomputing the score—the design of Algorithm 3 rather than Algorithm 2—and their released code splits the two sweeps across two launches, so the row normalizer round-trips HBM. That is the design point Algorithm 3 occupies, and where their kernel wins (§7). Appendices F and G set the two constructions side by side and give the protocol by which we benchmark theirs.
Online and incremental EM. A different sense of pass runs through the classical EM literature. Neal & Hinton (1998) recast EM as coordinate ascent on a free-energy functional, which justifies updating sufficient statistics after each point or block rather than waiting for a full sweep; Cappé & Moulines (2009) give a stochastic-approximation EM for data arriving as a stream, with a decreasing step size standing in for the M-step. Both shrink how many times the outer loop over the dataset must repeat to converge—a statistical question. Ours is orthogonal: is already resident and fixed, and the pass we remove is the inner one, the second sweep of the component axis a single EM iteration would otherwise make; incremental and online EM still call that iteration once per update, and so inherit whatever traffic it costs.
GPU implementations of mixture fitting. Earlier work GPU-accelerates only the scoring half of an iteration: Vaněk et al. (2011) evaluate Gaussian-mixture likelihoods on GPU for speech-recognition acoustic models, without the M-step or the exactness question we address. Several GPU implementations of complete mixture fitting predate ours: cuVS (RAPIDS Development Team, 2026); scikit-learn (Pedregosa et al., 2011), dispatching through the Array API to GPU libraries; torchgmm (Varrone, 2023) and gmmx (Donath, 2024) in PyTorch and JAX; and pomegranate, whose version-1 series is a PyTorch rewrite of Schreiber (2018). All materialize a responsibility block; a well-implemented library tiles the row axis, so the live block stays bounded, not (§7). §5 measures every implementation named here; the fastest beats Turbo-GMM at . We write our kernels in Triton (Tillet et al., 2019) on PyTorch (Paszke et al., 2019).
7 DISCUSSION
What the results establish. Two findings survive the sweep, and they point in different directions. Removing the intermediate changes what fits on a device: peak memory is flat in the number of components, so a 4096-component mixture at a million points becomes a single-device job at 139 MB where scikit-learn exhausts 80 GB. That holds at every shape and asks nothing of the hardware. Latency is the conditional half, and its condition is a hardware quantity rather than a property of the data: one pass pays wherever the component axis fits on chip—on an NVIDIA A100, at —and pays a median over the closest fused kernel there. Because the binding resource is on-chip capacity rather than bandwidth, this predicts that the envelope widens with each generation of hardware rather than with a better kernel: capacity itself has grown 128 KB to 192 KB to 256 KB over three successive architectures (NVIDIA Corporation, 2026), a vendor-documented hardware fact rather than something we measured ourselves—every latency and memory number in this paper comes from one NVIDIA A100, and we make no claim about how the dispatch boundary moves on any other device.
The single sweep is the change worth making. The ablation carries a recommendation for anyone building one of these kernels. Fusing the E- and M-steps, the change prior fused work already makes, is not where the margin lives: at our two-pass form runs slower than not fusing at all, and only the single sweep recovers it (§5.4). A kernel that sweeps the component axis twice is the easier artifact to build and the wrong place to stop.
Scope. Algorithms 2 and 3 cover diagonal covariances, of which spherical is the broadcast special case. Tied and full
covariances need lifts of width and —the tied case needs the extra column because its quadratic term cancels in but not in —and both widths change the register budget. We do not treat them.
Our cost model bounds the eager baseline, not a tiled one. Theorem 2 counts Algorithm 1, the archetype of the un-tiled implementations, and fusion improves on it by the largest margin. A library that tiles the row axis instead keeps only a bounded block live, and that block may stay cache-resident—at in single precision it is 16 MiB, inside the last-level cache of a current datacenter GPU—so its round trips need not reach HBM at all; it may also evaluate (2) in centered form, better conditioned than the lift by the factors of §4. cuVS is such an implementation, and Turbo-GMM beats it at all sixteen shapes, by rising to ; but the two differ in language, autotuning and initialization as well as in tiling, so none of that margin is attributable to fusion.
One measurement we cannot explain. Where the one-pass form leaves the chip, our two-pass fallback loses to Flash-GMM at and , and we have not identified the mechanism. Theorem 2 does not supply one: both kernels read once per component tile, and traffic is not the binding resource at those shapes—Algorithm 3 moves 3.4 GB at (, 512, 32) in 11.9 ms, a seventh of this device's bandwidth. Every latency and memory number here comes from one NVIDIA A100, one seeded dataset and one shared initialization, and our margins over Flash-GMM rest on the autotune list of §5.1.
8 CONCLUSION
We introduced Turbo-GMM, an IO-aware Gaussian-mixture EM implementation that eliminates materialization of the responsibility matrix and, when the component axis fits on chip, completes the E-step and M-step in a single traversal. By exploiting the opposing reduction axes of responsibility normalization and sufficient-statistic accumulation, Turbo-GMM avoids redundant reads without changing the EM updates. We establish exactness in real arithmetic under arbitrary tilings (Theorem 1) and show that the one-pass form reduces HBM traffic to under the stated execution conditions (Theorem 2). Across sixteen configurations on an NVIDIA A100, Turbo-GMM achieves a median speedup over the closest fused baseline and up to and over PyTorch and scikit-learn, respectively, while reducing peak memory by up to relative to materializing implementations. Latency gains depend on component residency and problem shape, while eliminating the responsibility workspace benefits even configurations requiring the two-pass fallback. These results demonstrate how reduction-aware kernel design improves the efficiency and scalability of probabilistic learning.
REFERENCES
Bishop, C. M. Pattern Recognition and Machine Learning. Information Science and Statistics. Springer, 2006. doi:10.1007/978-0-387-45528-0.
Blanchard, P., Higham, D. J., and Higham, N. J. Accurately computing the log-sum-exp and softmax functions. IMA Journal of Numerical Analysis, 41(4):2311–2330, 2021. doi: 10.1093/imanum/draa038.
Bloch, G., Gera, A., Orbach, M., Eytan, O., and Toledo, A. Flash-GMM: A memory-efficient kernel for scalable soft clustering. arXiv preprint arXiv:2606.10896, 2026.
Cappé, O. and Moulines, E. On-line expectation-maximization algorithm for latent data models. Journal of the Royal Statistical Society, Series B, 71(3):593–613, 2009. doi: 10.1111/j.1467-9868.2009.00698.x.
Chan, T. F., Golub, G. H., and LeVeque, R. J. Algorithms for computing the sample variance: Analysis and recommendations. The American Statistician, 37(3):242–247, 1983. doi: 10.1080/00031305.1983.10483115.
Dao, T. FlashAttention-2: Faster attention with better parallelism and work partitioning. arXiv preprint arXiv:2307.08691, 2023.
Dao, T., Fu, D. Y., Ermon, S., Rudra, A., and Ré, C. FlashAttention: Fast and memory-efficient exact attention with IO-awareness. In Advances in Neural Information Processing Systems, 2022.
Dempster, A. P., Laird, N. M., and Rubin, D. B. Maximum likelihood from incomplete data via the EM algorithm. Journal of the Royal Statistical Society, Series B, 39(1): 1–22, 1977. doi: 10.1111/j.2517-6161.1977.tb01600.x.
Donath, A. GMMX: Gaussian mixture models in Jax. github.com/adonath/gmmx, 2024. Software library; Zenodo DOI 10.5281/zenodo.14515326.
Hoefler, T. and Belli, R. Scientific benchmarking of parallel computing systems: Twelve ways to tell the masses when reporting performance results. In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis (SC15), 2015. doi:10.1145/2807591.2807644.
Hsu, P.-L., Dai, Y., Kothapalli, V., Song, Q., Tang, S., Zhu, S., Shimizu, S., Sahni, S., Ning, H., and Chen, Y. Liger kernel: Efficient triton kernels for LLM training. arXiv preprint arXiv:2410.10989, 2024.
Ivanov, A., Dryden, N., Ben-Nun, T., Li, S., and Hoefler, T. Data movement is all you need: A case study on optimizing transformers. In Proceedings of Machine Learning and Systems (MLSys), 2021.
Johnson, J., Douze, M., and Jégou, H. Billion-scale similarity search with GPUs. IEEE Transactions on Big Data, 7(3): 535–547, 2021. doi: 10.1109/tbdata.2019.2921572.
Lloyd, S. Least squares quantization in PCM. IEEE Transactions on Information Theory, 28(2):129–137, 1982. doi:10.1109/TIT.1982.1056489.
Milakov, M. and Gimelshein, N. Online normalizer calculation for softmax. arXiv preprint arXiv:1805.02867, 2018.
mpmath development team, T. mpmath: a Python library for arbitrary-precision floating-point arithmetic (version 1.4.0), 2026. http://mpmath.org/.
Neal, R. M. and Hinton, G. E. A view of the EM algorithm that justifies incremental, sparse, and other variants. In Learning in Graphical Models. Springer Netherlands, 1998. doi: 10.1007/978-94-011-5014-9_12.
NVIDIA Corporation. CUDA C++ Programming Guide. https://docs.nvidia.com/cuda/cuda-c-programming-guide/, 2026. Release 13.4.
Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., Desmaison, A., Kopf, A., Yang, E., DeVito, Z., Raison, M., Tejani, A., Chilamkurthy, S., Steiner, B., Fang, L., Bai, J., and Chintala, S. PyTorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019.
Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., and Duchesnay, É. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12(85):2825–2830, 2011.
Rabe, M. N. and Staats, C. Self-attention does not need memory. arXiv preprint arXiv:2112.05682, 2021.
RAPIDS Development Team. cuVS: Vector search and clustering on the GPU. github.com/rapidsai/cuvs, 2026. Software library.
Schreiber, J. pomegranate: Fast and flexible probabilistic modeling in Python. Journal of Machine Learning Research, 18(164):1–6, 2018.
Shah, J., Bikshandi, G., Zhang, Y., Thakkar, V., Ramani, P., and Dao, T. FlashAttention-3: Fast and accurate attention with asynchrony and low-precision. arXiv preprint arXiv:2407.08608, 2024.
Tillet, P., Kung, H. T., and Cox, D. Triton: an intermediate language and compiler for tiled neural network computations. In Proceedings of the 3rd ACM SIGPLAN International Workshop on Machine Learning and Programming Languages, pp. 10–19. Association for Computing Machinery, 2019. doi: 10.1145/3315508.3329973.
Vaněk, J., Trmal, J., Psutka, J. V., and Psutka, J. Optimization of the Gaussian mixture model evaluation on GPU. In Proceedings of Interspeech 2011, pp. 1737–1740, 2011. doi: 10.21437/Interspeech.2011-195.
Varrone, M. TorchGMM: Gaussian mixture models in PyTorch. github.com/CSOgroup/torchgmm, 2023. Software library; a fork of PyCave and LightKit by Oliver Borchert.
Wijmans, E., Huval, B., Hertzberg, A., Koltun, V., and Krähenbühl, P. Cut your losses in large-vocabulary language models. In International Conference on Learning Representations (ICLR), 2025. Oral; arXiv:2411.09009.
Williams, S., Waterman, A., and Patterson, D. Roofline: An insightful visual performance model for multicore architectures. Communications of the ACM, 52(4):65–76, 2009. doi: 10.1145/1498765.1498785.
Wu, C. F. J. On the convergence properties of the EM algorithm. The Annals of Statistics, 11(1):95–103, 1983. doi: 10.1214/aos/1176346060.
Yang, S., Xi, H., Zhao, Y., Li, M., Fan, X., Zhang, J., Cai, H., Lin, Y., Li, X., Keutzer, K., Han, S., Xu, C., and Stoica, I. Flash-KMeans: Fast and memory-efficient exact K-means. arXiv preprint arXiv:2603.09229, 2026.
A AI USAGE DISCLOSURE
Claude Opus 4.8 (Anthropic) and GPT-5.6 Sol (OpenAI) were used for editing, proofreading, resolving LATEX formatting issues, and to assist with code development for the implementation of the proposed methods. All AI-assisted text and code were reviewed, verified, and, where necessary, modified by the authors.
B THE GENERAL CASE: TWO PASSES WHEN THE COMPONENT AXIS DOES NOT FIT
Suppose now that exceeds . A row of then spans several component tiles, no single visit can complete its normalizer, and the kernel must carry a partial normalizer from one tile to the next. The running pair —a maximum seen so far, and a sum of exponentials rescaled by it—does so exactly, through the standard online softmax merge
(10)
which is associative and commutative, so every component tiling and every visit order is legal. The change of variables standard in online-softmax derivations gives both properties (Milakov & Gimelshein, 2018): on the map is injective, and it embeds in the componentwise (max, +) monoid, whose two-sided identity is . Both properties therefore transport back to ; its second coordinate, , is the quantity Appendix C folds. The kernel seeds the fold with the same rather than with , for the reason the padding mask of §3.1 is finite; since there, the seed contributes nothing to the sum either way.
That same property is what forces a second pass. Because is not addition, a kernel cannot commit partial normalizers by atomic update the way it commits partial statistics; it must finish a row's normalizer before any statistic can absorb that row. Pass 1 therefore does nothing else, storing only state rather than . Pass 2 then re-reads once per component tile, recomputes on chip, and forms without a divide, since places in —but only while the recomputed score is the score was built from. Appendix G reports a floating-point case where the two drift apart and fails; the released kernel of Bloch et al. (2026) also stores its row normalizer to HBM and re-derives the score, so the same mechanism reaches it. We do not clamp; the validity gate of §5.1 rejects any fit whose weights leave the simplex, and Theorem 1 shows the bound holds exactly in real arithmetic.
Pass 2 puts the component tile on the grid rather than the row tile, so that its accumulator stays at every . The price is one re-read of per component tile, which Theorem 2 counts and §5.3 pays.
Algorithm 3 Turbo-GMM, two-pass form (general , used wherever Algorithm 2 does not fit on chip, §5.2)
Require: , parameters , tiles (points) and (components), so component tiles; padded lanes predicated out
Ensure: , log-likelihood
1: Precompute the lift as in Algorithm 2
2: // Pass 1: row normalizers only
3: Initialize in HBM
4: for all point tile of size in parallel do
5: Load from HBM; form in registers; initialize on-chip // read once in this pass
6: for to do
7: Load // refetched per row tile
8: Compute the score tile on chip by (8)
9:
10: by (10)
11: end for
12: Write to HBM; atomic.add into // state, not
13: end for
14: // Pass 2: statistics, component tile on the grid
15: Initialize in HBM
16: for all component tile in parallel do
17: Load ; initialize on-chip
18: for all point tile of size do
19: Load and its normalizers ; form // one re-read of per tile
20: Recompute on chip from the pass-1 parameters // recomputation beats storage
21: // no divide;
22: Accumulate (4) for into
23: end for
24: atomic.add the partials into the tile- slices of // additive: atomics legal
25: end for
26: Compute as in Algorithm 2
Algorithm 3 occupies the design point of Bloch et al. (2026), whose released kernel fuses the same iteration in the same two sweeps. That makes it the closest prior work and the one baseline able to isolate what §3.1 adds, since it differs from Algorithm 2 in the number of traversals and little else; Appendix F sets the two constructions side by side. Algorithm 3 exists here only to cover the values of that leave Algorithm 2 no room on chip, and §5.2 states the rule that decides between them.
C PROOFS
Throughout, denotes the score matrix of (2), the row tiles and, for Algorithm 3, the component tiles. Both families are partitions: their members are nonempty, pairwise disjoint, and cover their axis. Padded lanes are predicated out, so a partial tile contributes nothing on either axis.
C.1 Proof of Lemma 1
With ,
The first two sums are the two blocks of . The third is independent of , so we put it in with , the constant , and the log-determinant .
C.2 Proof of Theorem 1
The score is exact. Both algorithms evaluate on the tile they hold. Since and , the precisions and the bias of (6)–(7) are finite, so with every entry of is finite; and Lemma 1 gives for every in the tile. Tiling selects which entries are formed, not their values.
The normalizer is exact. For Algorithm 2, means a tile visit holds the whole row , so and are formed exactly as Algorithm 2 prescribes, and , which is the of (3).
For Algorithm 3 the row spans and is assembled by folding (10). Fix a row and let be the permutation giving the order in which the tiles are visited. We show by induction on that after visits the on-chip pair satisfies the invariant
(11)
with the conventions and . Indexing by the visited set rather than by a prefix length is what makes the statement independent of both the partition and the order.
For we have , and the initializer satisfies (11). Algorithm 3 seeds instead with a finite , for which the first clause reads and the second is taken with that ; since makes the seed contribute nothing to the sum, the induction and the extracted are unchanged, so we argue with . Suppose (11) holds after visits and the kernel now visits , forming the tile quantities and . Write for the second coordinate of the of , with and with read as 0 whenever . One line of algebra gives
(12)
where is the merged maximum of (10). By (11) and the definition of , and , and and are disjoint, so the right-hand side of (12) is . The merged maximum is , because a maximum splits over the union ; and dividing (12) by gives , the second clause of (11) at . This closes the induction. At we have , hence , which is (3). Beyond the splitting of the maximum, only the homomorphism (12) is needed: the algorithm extracts , a function of alone, so never has to be inverted, and no injectivity is required of .
The responsibilities are exact. Algorithm 2 forms , which equals because . Algorithm 3 forms from the of pass 1 and the score recomputed in pass 2; tiling does not change the value of , so this is the same provided both passes use the same , and their tile partitions and visit orders need not agree. Both therefore equal of (3). Every term of is positive, so that sum dominates its -th term and for every ; hence exactly, and the violation of that bound reported in is a floating-point effect, not a property of the algorithm.
The statistics reassociate. Each of , , in (4) is a sum over of a term determined by alone. We assume each atomic update is linearizable, so that the value left in an HBM location is the sum, in some serial order, of the partials committed to it; commutativity of addition makes that order immaterial, and what remains to check is that the partials partition the index set. Both algorithms accumulate the partial sums over and commit them by addition, which is associative and commutative, so for every partition and order; here the being disjoint and covering is what rules out double counting. In Algorithm 2 the row tiles may be further grouped, as the launch of Theorem 2 groups them, and any such grouping gives each tile to exactly one group and so is one more reassociation of the same sum; in pass 2 of Algorithm 3 the visit of component tile writes only the slice of that indexes, so being a partition rules out double counting on the component axis too. The same argument gives , which equals (1): exponentiating (2) gives , so the normalizer identity above reads .
The parameter update is well defined. Every is finite because and , so and for . The updates (5) are a function of alone and are therefore defined and identical.
For the chaining claim of §4: the normalizer identity above gives , so and the updated weights are positive and sum to one. The numbers are positive and sum to one over , so for each coordinate
with the updated mean of (5), a weighted variance of . It is nonnegative by Cauchy–Schwarz, and zero exactly when that coordinate is constant across the data, so and whenever .
C.3 Proof of Theorem 2
We count array by array, as Dao et al. (2022) do for attention.
Algorithm 1. Kernel 1 writes and Kernel 2 reads it, elements; Kernel 2 writes and Kernel 4 reads it once per statistic, ; the total on the intermediate is , none of it input or output. is read by Kernels 1, 3 and 4, (only Kernel 3 gives an address; Kernel 1 forms it in registers), and the temporary is written by Kernel 3 and read by Kernel 4, , for on the input side. The normalizers contribute and the lift, the statistics and the updated parameters . Comparing with and with the residual, the intermediate exceeds every other term combined once , the residual being dominated as soon as .
Algorithm 2. Neither nor nor is given an address, so the terms are absent. The row tiles partition the rows, and the stride assigns each tile to exactly one program, which visits it once, so every element of is read exactly once: . Each of the programs loads once, before its row loop, and commits one atomic set of partial statistics after it, giving ; nothing else crosses HBM. If then and the total is . For the lower bound, occupies elements of HBM and the parameters and statistics . Every row of sums to one, so summing (4) over gives
The returned statistics therefore determine every column sum of exactly. An algorithm that leaves some
unread cannot distinguish two inputs differing in it, whose column sums differ, so it cannot be exact; it must read all entries and write the updated parameters, giving . Algorithm 2 is therefore optimal up to constants.
Algorithm 3. Pass 1 reads each element of once, , writes , and accumulates by one atomic per row tile. Pass 2 launches one program group per component tile, and each group strides over every row tile, so it reads all of and all of once per component tile: and . The reads of therefore total . Parameters and statistics are charged differently in the two passes. Pass 2 loads each lift tile once per component tile and commits one atomic set per component tile, . Pass 1 cannot hoist, because its component loop sits inside its row loop, so it refetches all lift tiles for every row tile, , which dominates ; pass 1 commits with one atomic per row tile, , and both terms are dominated by the refetch. The traffic is elements, one write in pass 1 and one read per component tile in pass 2; it carries the same factor as the reads of and is smaller by exactly , so it belongs beside them rather than in the residual. Collecting terms gives .
Pricing the three ledgers. The three ledgers price the design. In Algorithm 1 the is the intermediate itself, written and read, none of it input or output, and it dominates once passes . Both fused forms delete that term; what separates them is the coefficient on . The one-pass form reads the data once, which is optimal: because every row of sums to one, the statistics it returns determine every column sum of , so an exact algorithm must read all entries and write the updated parameters. The launch caps the program count at a multiple of the multiprocessor count, so and the side condition of Theorem 2 holds. The two-pass form pays reads instead, because its second pass places the component tile on the grid to keep the accumulator bounded, and that factor grows with : at and it is nine reads of . Its term is not a remainder, however. Pass 1 cannot hoist the lift out of its row loop, so it refetches all elements of it per row tile, which stands to the reads of in the ratio and is therefore the larger of the two at the tiles we run. The released kernel of Bloch et al. (2026) schedules its second pass the same way, so the ledger does not separate the two two-sweep designs, and it does not explain why theirs is the faster of them (§7). The ledgers are derived rather than profiled: no experiment here counts HBM bytes.
Numerical conditioning of the lift: a case study. The lifted score subtracts terms of magnitude , losing relative accuracy as the data moves away from the origin, the same cancellation that makes a naive sum-of-squares formula for variance less stable than a centered one (Chan et al., 1983). At in single precision, against a double-precision centered reference, the lifted form is less accurate than the centered form at the origin and times less accurate at offset , a decade per decade. Algorithm 1 expands identically, so fusion inherits this loss rather than introducing it.
D EXPERIMENTAL DETAILS
This appendix records what §5 defers: the measurement protocol, the validity gate, the two limits behind the dispatch rule, and the ablation ladder. Appendix F compares our design against prior fused work and Appendix G records how we ran their kernel.
The latency estimator. Each arm script times three repetitions for Flash-GMM, for both of our kernels and for every library arm but cuVS, which times five; the plotting pipeline discards each arm's own stored summary statistic and recomputes the minimum of its repetitions uniformly, since the arm scripts otherwise disagree on which statistic they report. The repetition count is thus not identical across arms, and a minimum over five is not larger in expectation than a minimum over three, so the convention mildly favours cuVS, the strongest library baseline— exactly the kind of summary-statistic choice Hoefler & Belli (2015) warn can distort cross-system comparisons.
The widened autotune list, and what it costs the comparison. One asymmetry runs against Flash-GMM: their published autotune list was authored for bf16 operands and holds no block small enough for fp32, so we widened it, with the consequences Appendix G details. Our margin then falls to at and to at , from and unwidened. The widened figures supersede the unwidened ones at those two shapes; the other thirteen margins rest on the unwidened list and read as upper estimates.
The validity gate, and the six cells that failed it. We score every arm's returned parameters in double precision from the same data the arm was fitted on, and accept the fit only if the resulting log-likelihood is finite and, for arms that return mixture weights, . Six otherwise-successful runs fail it: gmmx at and at and 4096 with , ; torchgmm at and pomegranate at , same and . All six exit cleanly and report success, so the failure stays silent unless a harness checks: each returns a latency, a parameter set and a success code, and only re-scoring the parameters reveals that the fit does not exist. Four of the six sit at , the regime this paper is about, and one of those is the widest shape we measure. A harness that trusted exit status would enter all six in its table. Flash-GMM fails the weight test at for the separate reason Appendix G traces.
Dispatch, first limit: capacity. Algorithm 2 carries across the whole component axis, a loop-carried state of . For and the compiler reports bytes of shared memory against the 166912-byte NVIDIA A100 budget (NVIDIA Corporation, 2026), so the kernel stops being launchable once . That predicate accounts exactly for the launch failures we observe: at , it asks for 524 288 B.
Dispatch, second limit: occupancy, and it binds first. The accumulator spills registers well inside the capacity bound, and the cliff does not follow . On auxiliary dispatch probes at and , rather than on the sixteen shapes of Figure 1, Algorithm 2 runs faster than Algorithm 3 at and slower at : a swing at one footprint, so dispatching on capacity alone would be wrong by on a configuration capacity admits. This is the one-pass form losing at small and large ; the of §5.4 runs the other way, the two-pass form losing at . alone separates the two, since it sets the live accumulator registers per lane, which is why the rule of §5.2 tests it separately. Algorithm 3 runs at at every shape we report, so its of Theorem 2 is 8, 16 and 64 at and 4096.
The ablation ladder. Every rung shares the lift of §2.2, so credit divides among the three dataflow changes. The baseline rung, the dataflow of Algorithm 1, writes the lifted score to HBM, normalizes it there, and reads the responsibilities back three times, once per statistic. Above it, the rungs fuse the score kernel, skipping the temporary for but still materializing the responsibilities; then the E- and M-steps (Algorithm 3); then the single sweep (Algorithm 2). Each rung keeps the changes below it, so the factors compose.
Ablation protocol, and two caveats. We run every rung on six configurations from Figure 1, covering its large- and regimes, on one NVIDIA A100-SXM4-80GB at . Latency here is the minimum over five repetitions; the arms of Figure 1 are timed over three repetitions, except cuVS over five, with the minimum taken uniformly as described above. All four returned quantities of every rung agree with the baseline to relative, so the ladder varies dataflow and not arithmetic. Two caveats. The first fused rung changes implementation language as well as dataflow—the baseline composes library calls, the fused kernels are ours—and the two do not separate: a library that fused its score kernel would no longer be the baseline. The top rung is unavailable wherever loop-carried state exceeds the on-chip budget above; we mark those cells rather than estimate them.
The complete per-shape results. Table 1 gives every arm's latency, memory, speedup relative to Turbo-GMM, and validity-gate outcome at all sixteen shapes.
Table 1: Every arm at every shape. Shape is . Speedup is this arm's latency relative to Turbo-GMM's (or Turbo-GMM Algorithm 3 where the dispatch rule of §5.2 selects it, marked "Alg. 3"); Turbo-GMM's own row is the reference and carries no speedup entry. Peak memory is omitted (—) for the two arms (cuVS, gmmx) that do not report it. The gate column applies §5.1's validity rule; one point, Flash-GMM at , is kept and flagged rather than dropped, per the disclosed exception in §5.1.
| Shape | Arm | ms/iter | Speedup | Mem (MB) | Gate |
|---|---|---|---|---|---|
| 20K/16/32 | Turbo-GMM | 0.49 | — | 3 | valid |
| Flash-GMM | 0.54 | 1.11× slower | 3 | valid | |
| cuVS | 1.55 | 3.18× slower | — | valid | |
| PyTorch | 0.41 | 1.18× faster | 17 | valid | |
| scikit-learn | 1.16 | 2.39× slower | 18 | valid | |
| gmmx | 0.22 | 2.20× faster | — | valid | |
| torchgmm | 35.73 | 73.45× slower | 17 | valid | |
| 20K/32/32 | pomegranate | 12.56 | 25.81× slower | 12 | valid |
| Turbo-GMM | 0.50 | — | 3 | valid | |
| Flash-GMM | 0.53 | 1.06× slower | 3 | valid | |
| cuVS | 1.08 | 2.18× slower | — | valid | |
| PyTorch | 0.39 | 1.27× faster | 20 | valid | |
| 20K/64/32 | scikit-learn | 1.21 | 2.43× slower | 26 | valid |
| gmmx | 0.30 | 1.66× faster | — | valid | |
| torchgmm | 4.90 | 9.86× slower | 23 | valid | |
| pomegranate | 24.59 | 49.49× slower | 15 | valid | |
| Turbo-GMM | 0.53 | — | 3 | valid | |
| 1M/32/32 | Flash-GMM | 0.53 | 1.01× faster | 3 | valid |
| cuVS | 1.23 | 2.31× slower | — | valid | |
| PyTorch | 0.39 | 1.37× faster | 28 | valid | |
| scikit-learn | 1.27 | 2.38× slower | 42 | valid | |
| gmmx | 0.43 | 1.25× faster | — | rejected (non-finite LL) | |
| torchgmm | 3.43 | 6.44× slower | 36 | valid | |
| pomegranate | 51.87 | 97.22× slower | 21 | valid | |
| 1M/128/32 | Turbo-GMM | 1.11 | — | 128 | valid |
| Flash-GMM | 3.45 | 3.11× slower | 136 | valid | |
| cuVS | 48.29 | 43.54× slower | — | valid | |
| PyTorch | 2.97 | 2.68× slower | 622 | valid | |
| scikit-learn | 5.70 | 5.14× slower | 905 | valid | |
| gmmx | 5.19 | 4.68× slower | — | valid | |
| torchgmm | 6.69 | 6.03× slower | 741 | valid | |
| 1M/512/32 | pomegranate | 104.37 | 94.11× slower | 737 | valid |
| Turbo-GMM | 3.02 | — | 128 | valid | |
| Flash-GMM | 4.47 | 1.48× slower | 136 | valid | |
| cuVS | 74.65 | 24.69× slower | — | valid | |
| PyTorch | 8.00 | 2.64× slower | 1721 | valid | |
| scikit-learn | 15.34 | 5.07× slower | 3194 | valid | |
| gmmx | 18.94 | 6.26× slower | — | rejected (non-finite LL) | |
| torchgmm | 14.07 | 4.65× slower | 2572 | valid | |
| 1M/1024/32 | pomegranate | 419.87 | 138.84× slower | 1592 | valid |
| Turbo-GMM (Alg. 3) | 11.89 | — | 133 | valid | |
| Flash-GMM | 11.03 | 1.08× faster | 137 | valid | |
| cuVS | 97.49 | 8.20× slower | — | valid | |
| PyTorch | 31.11 | 2.62× slower | 6119 | valid | |
| scikit-learn | 57.76 | 4.86× slower | 12355 | valid | |
| gmmx | 73.60 | 6.19× slower | — | valid | |
| torchgmm | 118.12 | 9.93× slower | 9901 | valid | |
| 1M/1024/32 | pomegranate | 1710.17 | 143.82× slower | 5993 | valid |
| Turbo-GMM (Alg. 3) | 23.11 | — | 134 | valid | |
| Flash-GMM | 18.03 | 1.28× faster | 138 | valid | |
| cuVS | 155.07 | 6.71× slower | — | valid | |
| PyTorch | 58.79 | 2.54× slower | 11976 | valid | |
| scikit-learn | 111.43 | 4.82× slower | 24558 | valid | |
| gmmx | 145.34 | 6.29× slower | — | rejected (non-finite LL) | |
| torchgmm | 249.61 | 10.80× slower | 19662 | valid |
Table 1 – continued
| Shape | Arm | ms/iter | Speedup | Mem (MB) | Gate |
|---|---|---|---|---|---|
| 1M/4096/32 | pomegranate | 3407.38 | 147.45× slower | 11856 | rejected (non-finite LL) |
| Turbo-GMM (Alg. 3) | 89.97 | — | 139 | valid | |
| Flash-GMM | 65.24 | 1.38× faster | 146 | rejected () | |
| cuVS | 442.04 | 4.91× slower | — | valid | |
| 4M/16/64 | PyTorch | 237.27 | 2.64× slower | 47138 | valid |
| scikit-learn | — | — | — | fail (OOM) | |
| gmmx | 579.30 | 6.44× slower | — | rejected (non-finite LL) | |
| torchgmm | 559.60 | 6.22× slower | 78264 | rejected (non-finite LL) | |
| pomegranate | — | — | — | fail (ERROR) | |
| 4M/16/128 | Turbo-GMM | 7.51 | — | 1024 | valid |
| Flash-GMM | 32.15 | 4.28× slower | 1057 | valid | |
| cuVS | 216.27 | 28.78× slower | — | valid | |
| PyTorch | 9.35 | 1.24× slower | 2709 | valid | |
| scikit-learn | 15.47 | 2.06× slower | 2694 | valid | |
| gmmx | 19.35 | 2.58× slower | — | valid | |
| torchgmm | 14.58 | 1.94× slower | 2465 | valid | |
| 4M/16/32 | pomegranate | 279.66 | 37.21× slower | 4410 | valid |
| Turbo-GMM | 14.12 | — | 2049 | valid | |
| Flash-GMM | — | — | — | fail (OutOfResources) | |
| cuVS | 266.32 | 18.86× slower | — | valid | |
| PyTorch | 14.05 | 1.00× faster | 4664 | valid | |
| scikit-learn | 21.69 | 1.54× slower | 4649 | valid | |
| gmmx | 35.28 | 2.50× slower | — | valid | |
| torchgmm | 20.39 | 1.44× slower | 4420 | valid | |
| 4M/32/32 | pomegranate | 509.99 | 36.11× slower | 8320 | valid |
| Turbo-GMM | 3.03 | — | 512 | valid | |
| Flash-GMM | 13.24 | 4.37× slower | 545 | valid | |
| cuVS | 187.37 | 61.77× slower | — | valid | |
| PyTorch | 11.21 | 3.69× slower | 2465 | valid | |
| scikit-learn | 20.58 | 6.79× slower | 3594 | valid | |
| gmmx | 19.12 | 6.30× slower | — | valid | |
| torchgmm | 17.47 | 5.76× slower | 2938 | valid | |
| 4M/32/64 | pomegranate | 342.56 | 112.92× slower | 2945 | valid |
| Turbo-GMM | 8.16 | — | 1024 | valid | |
| Flash-GMM | 32.15 | 3.94× slower | 1057 | valid | |
| cuVS | 255.61 | 31.32× slower | — | valid | |
| PyTorch | 13.23 | 1.62× slower | 3441 | valid | |
| scikit-learn | 23.34 | 2.86× slower | 4082 | valid | |
| gmmx | 35.27 | 4.32× slower | — | valid | |
| torchgmm | 20.24 | 2.48× slower | 3426 | valid | |
| 4M/64/16 | pomegranate | 565.88 | 69.33× slower | 4898 | valid |
| Turbo-GMM | 3.21 | — | 257 | valid | |
| Flash-GMM | 6.91 | 2.15× slower | 289 | valid | |
| cuVS | 183.10 | 57.01× slower | — | valid | |
| PyTorch | 16.88 | 5.25× slower | 3441 | valid | |
| scikit-learn | 31.79 | 9.90× slower | 6402 | valid | |
| gmmx | 22.55 | 7.02× slower | — | valid | |
| torchgmm | 26.35 | 8.20× slower | 5135 | valid | |
| 4M/64/32 | pomegranate | 389.34 | 121.22× slower | 3190 | valid |
| Turbo-GMM | 4.36 | — | 512 | valid | |
| Flash-GMM | 13.23 | 3.03× slower | 545 | valid | |
| cuVS | 251.44 | 57.66× slower | — | valid | |
| PyTorch | 17.80 | 4.08× slower | 3930 | valid | |
| scikit-learn | 33.13 | 7.60× slower | 6646 | valid | |
| gmmx | 36.28 | 8.32× slower | — | valid | |
| torchgmm | 27.86 | 6.39× slower | 5379 | valid | |
| 10M/32/32 | pomegranate | 689.55 | 158.14× slower | 3922 | valid |
| Turbo-GMM | 6.88 | — | 1280 | valid | |
| Flash-GMM | 20.15 | 2.93× slower | 1360 | valid | |
| cuVS | 470.49 | 68.35× slower | — | valid | |
| PyTorch | 27.72 | 4.03× slower | 6150 | valid | |
| scikit-learn | 50.17 | 7.29× slower | 8973 | valid |
Table 1 – continued
| Shape | Arm | ms/iter | Speedup | Mem (MB) | Gate |
|---|---|---|---|---|---|
| 20M/32/32 | gmmx | 53.40 | slower | — | valid |
| torchgmm | 155.08 | slower | 7332 | valid | |
| pomegranate | 820.88 | slower | 7363 | valid | |
| Turbo-GMM | 13.28 | — | 2561 | valid | |
| Flash-GMM | 40.16 | slower | 2721 | valid | |
| cuVS | 938.00 | slower | — | valid | |
| PyTorch | 55.26 | slower | 12294 | valid | |
| scikit-learn | 100.27 | slower | 17941 | valid | |
| gmmx | 126.47 | slower | — | valid | |
| torchgmm | 180.67 | slower | 14660 | valid | |
| pomegranate | 1626.24 | slower | 14729 | valid |
E IMPLEMENTATIONS COMPARED
Table 2 lists every implementation benchmarked in §5. Versions matter for three of the comparisons: cuVS's GMM exists only on main and has no released version to cite; the three arms built against a newer torch are pinned by their own Python requirements, not by our choice; and Flash-GMM is a source checkout with no version at all.
F RELATIONSHIP TO FLASH-GMM
Flash-GMM (Bloch et al., 2026) fuses the same EM iteration we fuse. This appendix states what the two constructions share and where they part; §G records how we ran theirs.
What the two share. Both avoid materializing the responsibilities, stream component blocks against a resident row block, accumulate the statistics on chip, commit them with atomic additions, and cut dominant HBM traffic from to a cost linear in the inputs. That pattern, and the observation that the responsibility matrix is a pure intermediate, are theirs as much as ours.
Algorithm 3 occupies their design point. Our two-pass variant and their released kernel are one idea: a first sweep of the component axis for the row normalizer, a second that recomputes the score and accumulates the statistics. It exists only because some values of leave Algorithm 2 no room on chip (§5.2).
Their paper and their released code part on the row block. Their paper puts both sweeps inside one residency of the row block, which would read once; the released diagonal kernel does not (§6). In flash_gmm_diag_h100.py at commit 57c3621, two @triton.jit kernels are declared at lines 64 and 164, the row normalizer reaches HBM at line 130, and t1.load reads at line 82 and again at line 233. We benchmark that code, so its row of Table 3 matches the Algorithm 3 row in all five columns.
Algorithm 2 has no counterpart in their work. They sweep the component axis twice at every shape; neither their paper nor their code holds a one-sweep variant. Table 3 places the three designs on the two axes that govern cost, and Algorithm 2 reduces the number of component traversals and avoids score recomputation relative to the evaluated two-sweep implementations, subject to the on-chip resource constraints described in §5.2.
The table accounts for one side of §5.3 and not the other. Of the fifteen shapes at which both kernels ran to completion we win eleven, by to : median over the wins, over all fifteen. The widened autotune list of §G supersedes that maximum— becomes at —leaving at as the largest margin we stand behind. The advantage is not ordered in : at and
it falls through , , , and at and , reversing from up, where Algorithm 2 stops fitting on chip. With at , , those are our four losses. Three run Algorithm 3, where the table separates the kernels on no column and the mechanism stays unidentified (§7); the fourth is the small- regime in which fusion pays little. At their kernel completes but its mixture weights leave the simplex (§G), so compares against a fit our validity gate rejects.
Four further differences. §6 names them; four details belong here. Their paper argues against full covariances on statistical grounds, yet their repository also ships diagonal and full kernels. Our lift costs conditioning (§4), and no experiment here prices the matrix form against their pointwise score in latency. Their paper makes no exactness claim, whereas we prove that both algorithms reproduce standard EM exactly under every tiling and verify the proof against an extended-precision reference (Theorem 1).
A control at . Two figures here run in opposite directions: §5.2 times Algorithm 2 slower than Algorithm 3 at , while §5.4 times our two-pass form slower than not fusing at . To separate our implementation from two-sweep fusion as such, we timed three further dataflows at the second shape over 10 EM iterations on one NVIDIA A100 at tf32x3, widening their autotune list (§G) so that their kernel launches at ; for the materializing baseline we use the ablation ladder's own logged run at this identical shape (§5.4, rung "A1") rather than re-timing it, 205.9 ms. Algorithm 2, one pass, 141.2 ms ( faster, matching the net margin §5.4 reports for this shape); Flash-GMM widened, 425.1 ms ( slower, its E-step only, so a lower bound on their full iteration); Algorithm 3, our two pass, 2736.6 ms ( slower, matching §5.4's own figure for this shape). Flash-GMM's regression is modest next to our own two-pass implementation's, so most of the belongs to our Algorithm 3 implementation rather than to two-sweep fusion in general. What survives still decides the design: at the one-pass form beats materializing outright, the best available two-sweep kernel is off it, and ours is worse still.
What we would tell a practitioner. Use one sweep when the component axis fits on chip: on an NVIDIA A100 at , . Over the thirteen shapes where both of our algorithms run, one sweep gains a median over our own two-pass fallback, and over it at the single shape we measure—an existence result, not a trend in , and not a margin over Flash-GMM—at no cost in accuracy. Outside that envelope the two designs are close, and we would choose on engineering grounds. A schedule holding both sweeps in one residency of the row block would
Table 2. Implementations compared in Figure 1. Versions are those the harness recorded at run time, not reconstructed afterwards. GitHub repositories are abbreviated owner/name.
| Arm | Package | Version | Upstream source |
|---|---|---|---|
| Turbo-GMM (ours, Algs. 2–3) | torch + triton | 2.6.0+cu124/3.2.0 | this work |
| Flash-GMM | — (source checkout) | 57c3621 (2026-07-30) | IBM/Flash-GMM |
| cuVS | libcuvs.cu12 | 26.12.0a14 (nightly) | RAPIDS nightly C++ wheel |
| PyTorch | torch | 2.6.0+cu124 | pytorch.org |
| scikit-learn | scikit-learn | 1.9.1 | scikit-learn.org |
| gmmx (JAX) | gmmx | 0.7 | adonath/gmmx |
| torchgmm | torchgmm | 0.1.4 | CSOgroup/torchgmm |
| pomegranate | pomegranate | 1.1.2 | jmschrei/torchegranate |
We installed every Python package from PyPI. Flash-GMM ships as source with no released version, so we record the commit; we ran its flash_gmm_diag_h100 kernel with the interventions of Appendix G. libcuvs is an archived RAPIDS nightly wheel, because cuVS's GMM is unreleased: published versions stop at 26.8.1 and export no GMM symbols. Each arm runs in its own virtual environment and subprocess, so one failure cannot affect another. scikit-learn, torchgmm and pomegranate build against torch 2.14.0+cu130, gmmx against jax 0.10.2. pomegranate v1.x is the PyTorch rewrite, whose repository retains its former name.
Table 3. The three designs on the two axes that set the cost of an iteration. Algorithm 2 dominates on both, and is the number of component tiles: both two-sweep designs put it on the grid in their second pass, so both re-read once per tile. The Flash-GMM row records their released diagonal kernel, not the schedule their paper describes; the last column records that only the two-pass designs park row normalizers outside the row block.
| Sweeps of comp. axis | Reads of | Score recomputed | On-chip state | Per-row HBM state | |
|---|---|---|---|---|---|
| Alg. 2 (ours, one pass) | 1 | 1 | no | none | |
| Flash-GMM (Bloch et al., 2026) | 2 | yes | |||
| Alg. 3 (ours, two pass) | 2 | yes |
read once; no released kernel does this, and building it inside Algorithm 3 is the obvious improvement we have not made.
G PROTOCOL FOR THE FLASH-GMM COMPARISON
Appendix F compares the designs; here we record how we ran theirs. Of the isotropic, diagonal and full kernels their repository holds, we benchmark the released diagonal kernel, so that both methods fit the same model class. Three choices make Figure 1 a comparison of methods, and each moves the result; the latency estimator, which is shared with every other arm, is in Appendix D.
Precision. Their kernel casts both matrix-multiply operands to bf16 with an fp32 accumulator, one tensor-core pass; our tf32x3 is three. That difference alone accounts for 1.75–2.17×, so comparing the two as shipped would measure the number format. We removed their five in-kernel and two host-side bf16 casts and set input_precision="tf32x3" on all six t1.dot calls.
A correctness fix. Their pass-2 kernel iterates range (n_start, n_end, BLOCK_N) but masks rows with n_off < N rather than n_off < n_end. When the per-CTA row slab is not a multiple of BLOCK_N, each slab's final tile reaches into the next and counts its rows twice. The effect is systematic: at a row of responsibilities sums to 1.0034 rather than 1, and the excess is exactly zero when the slab length divides evenly, which identifies the mechanism. We applied their own one-line correction, so our figures for them are those of a partition-respecting kernel; otherwise we would measure their fit rather than their speed.
Autotuning, and what it costs the comparison. Outside the precision port and the row mask, our first run left their kernel byte-identical: grid shapes, loop bounds, accumulator shapes, the log-sum-exp merge, the atomic placement and both autotune lists. One asymmetry remains, against them. They hand-authored their list for bf16 register and shared-memory footprints, and its smallest candidate block, BLOCK_N = 64, BLOCK_K = 32, exceeds the BLOCK_N = 16 our kernel selects at . At fp32 their autotuner cannot reach a block small enough: at the retained configurations no longer fit (196 608 B requested against 166 912 B available) and the kernel does not launch. We re-measured with their list widened by (16, 16), (16, 32), (32, 16), (32, 32), (32, 64) and (64, 16), the bf16 casts again replaced by input_precision="tf32x3". Both re-measured margins fell: at from to , and at from to . The widened list is the fairer configuration for them, so those are the margins we stand behind at those two shapes; we report both runs to keep the intervention visible, and every other shape carries the first list, which we did not re-measure. The widened list also launches at , which their published list cannot, and Appendix F times it there.
With the precision port and the row-mask fix in place, their kernel produces a valid fit at fourteen of the sixteen configurations. At it does not launch on their published list, for that autotuning reason rather than an algorithmic one. At it completes in 65.2 ms per iteration, but its mixture weights leave the simplex (). A single E-step there is exact (), so the EM trajectory rather than a kernel defect is the cause: with 244 points per component a variance collapses, and since pass 1 stores the normalizer while pass 2 recomputes the score, the recomputed score drifts from the stored normalizer and fails.