betaFeedback

WorksComputer Science

FlashSinkhorn 2: Block-Sparse Entropic Optimal Transport

Abstract

Streaming GPU solvers for entropic optimal transport (EOT), such as FlashSinkhorn, avoid storing the dense kernel but still evaluate all n×mn\times m point pairs in every Sinkhorn iteration. We present FlashSinkhorn~2 (FS2), a solver for squared-Euclidean cost on low-dimensional point clouds that solves large discrete EOT problems to a prescribed marginal residual on a single GPU by coupling two stages. A coarse stage solves on cell centroids, lifts the potentials to every point and, when a sampled marginal check rejects the lift, continues on the centroids, replacing most point-level updates. A block-sparse fine stage then removes the centroid error that coarse updates cannot. Its Morton-ordered blocks support screening and fused tensor-core execution, and a threshold set by the block masses bounds each omitted tile's contribution to every row and column. On synthetic benchmarks, FS2 reaches the target residual on all 32 problems and GeomLoss multiscale on 10. On one A100, FS2 solves discrete EOT between two 1.34×1081.34\times10^8-particle measures from a cosmological NN-body simulation, at an entropic blur equal to the mean interparticle distance, to an all-particle marginal residual below 0.01 in under 2.5 hours. To our knowledge, it is the largest discrete EOT problem solved to this accuracy within hours. For reproducibility, we release an open-source implementation at https://github.com/ot-triton-lab/flash-sinkhorn

Introduction

Optimal transport (OT) compares probability measures in applications ranging from generative modeling to cell dynamics and cosmological reconstruction [3, 32, 15]. Entropic regularization [9] yields a differentiable problem, entropic OT (EOT), solved by Sinkhorn iterations. Applications in computational biology, medical imaging, and cosmology now routinely produce point clouds with 10510^{5}–10810^{8} points per measure [6, 13, 25]. Solvers that store the dense n×mn \times m kernel exceed GPU memory beyond about 10510^{5} points. MOSCOT [21] couples a few hundred thousand cells per time point and suggests low-rank plans [31] for millions. Lévy et al. [25] recover initial particle positions from a cosmological dataset with 1.34×1081.34 \times10^{8} target particles by semi-discrete transport, and note that a Sinkhorn iteration between unstructured point clouds costs quadratic time, “prohibiting very large-scale applications.” Solvers that evaluate entries on the fly, GeomLoss [14] through KeOps [7] and FlashSinkhorn (Ye et al., 2026) through one fused tiled kernel per update, avoid storing the n×mn \times m matrix but still perform O(nm)\mathcal{O}(nm) work per update.

At moderate regularization, much of this work is wasted, because the entropic plan concentrates on nearby pairs. Multiscale solvers first solve a coarser problem, which cuts the number of fine iterations, and then skip distant pairs whose contribution is bounded [35] or estimated from the coarse potentials [13]. GeomLoss multiscale combines both on the GPU but does not test the marginals it returns. Bringing a large problem to a prescribed residual with both ideas raises three practical issues. First, the solution of the coarser problem is only approximate, and checking whether it is accurate enough costs O(nm)\mathcal{O}(nm). Second, screening all point pairs to find useful ones costs O(nm)\mathcal{O}(nm) as well. Third, the surviving pairs are distributed unevenly across rows, yet GPU tensor cores require fixed-size tiles.

We introduce FlashSinkhorn 2 (FS2), which addresses these issues for squared-Euclidean costs in d≤3d \le3 by coupling a coarse stage with a block-sparse fine stage. FS2 first groups nearby points into cells and solves the much smaller problem between the cell centroids. It then lifts this solution to the original points and checks it on randomly drawn rows and columns instead of all nmnm pairs. If the check fails, FS2 refines the centroid solution further and, if the check still fails, removes the error of replacing points by centroids with sparse updates on the points. These updates skip negligible pairs by screening fixed-size blocks of nearby points instead of single points, and each block pair they keep maps onto whole tensor-core tiles. Every update runs FlashSinkhorn’s streaming kernel, so FS2 stores block-pair indices but no kernel entries. Our contributions are:

  • Error guarantees. Building on Schmitzer [35], we bound each omitted tile’s contribution to every row and column, and hence the full marginal residual. For the lift, we isolate the centroid error that only fine updates remove.

  • GPU co-design. Cells and blocks are contiguous ranges of one Morton order. The fine stage screens block pairs, cutting the cost to O(nm/B2)\mathcal{O}(nm/B^2), and runs each sparse half-step through FlashSinkhorn’s fused kernel on the kept tiles.

  • Large-scale evaluation. On one A100, FS2 solves discrete EOT between two 1.34×1081.34 \times10^8-particle measures to a marginal residual below 0.01 in under 2.5 hours. To our knowledge, it is the largest discrete EOT problem solved to this accuracy within hours.

Background and Related Work

Entropic OT and FlashSinkhorn

For point clouds X=(xi)i=1n\mathbf{X} = (x_i)_{i=1}^n, Y=(yj)j=1m\mathbf{Y} = (y_j)_{j=1}^m in Rd\mathbb{R}^d, strictly positive probability weights a∈Δn\mathbf{a} \in\Delta^n, b∈Δm\mathbf{b} \in\Delta^m, and squared Euclidean cost Cij=∥xi−yj∥2C_{ij} = \lVert x_i-y_j\rVert^2, EOT solves

OT⁡ε(a,b)=min⁡P∈Π(a,b)⟨P,C⟩+εKL⁡(P∥a⊗b),ε>0,(1)\operatorname{OT}_{\varepsilon}(\mathbf{a},\mathbf{b}) = \min_{P \in\Pi(\mathbf{a},\mathbf{b})} \langle P,C\rangle+ \varepsilon\operatorname{KL}(P \mathbin{\|} \mathbf{a} \otimes\mathbf{b}), \qquad\varepsilon> 0, \tag*{(1)}

where Π(a,b)={P≥0:P1=a,PT1=b}\Pi(\mathbf{a},\mathbf{b}) = \{P \ge0 : P\mathbf{1} = \mathbf{a}, P^{\mathsf{T}}\mathbf{1} = \mathbf{b}\}. The optimal plan is Pij=aibjexp⁡((fi+gj−Cij)/ε)P_{ij} = a_i b_j \exp((f_i + g_j - C_{ij})/\varepsilon), with dual potentials f∈Rn\mathbf{f} \in\mathbb{R}^n, g∈Rm\mathbf{g} \in\mathbb{R}^m. With LSE⁡j(zj)=log⁡∑jexp⁡(zj)\operatorname{LSE}_j(z_j) = \log\sum_j \exp(z_j) denoting the log-sum-exp over the index jj, log-domain Sinkhorn uses the half-steps

fi←−εLSE⁡j[(gj−Cij)/ε+log⁡bj],gj←−εLSE⁡i[(fi−Cij)/ε+log⁡ai].(2)f_i \leftarrow-\varepsilon\operatorname{LSE}_j\left[(g_j-C_{ij})/\varepsilon+\log b_j\right], \qquad g_j \leftarrow-\varepsilon\operatorname{LSE}_i\left[(f_i-C_{ij})/\varepsilon+\log a_i\right]. \tag*{(2)}

Alternating updates apply the half-steps sequentially. Symmetric updates compute both from the same previous potentials, then average each updated potential with its previous value Feydy [12]. At converged balanced potentials, the source-coordinate gradient of EOT is 2ai(xi−Tε(xi))2a_i(x_i-T_{\varepsilon}(x_i)), where Tε(xi)T_{\varepsilon}(x_i) is the barycentric projection of xix_i Li et al. [26].

FlashSinkhorn (FS) rewrites each half-step as a row-wise LSE reduction of a biased dot-product score matrix Ye et al. (2026). For squared Euclidean cost, Cij=∥xi∥2+∥yj∥2−2xiTyjC_{ij} = \lVert x_i\rVert^2 + \lVert y_j\rVert^2 - 2x_i^{\mathsf{T}}y_j, so with shifted potentials f^i=fi−∥xi∥2\hat{f}_i = f_i - \lVert x_i\rVert^2 and g^j=gj−∥yj∥2\hat{g}_j = g_j - \lVert y_j\rVert^2 the first half-step becomes

f^i←−εLSE⁡j[(2xiTyj+g^j)/ε+log⁡bj],\hat{f}_i \leftarrow-\varepsilon\operatorname{LSE}_j\left[(2x_i^{\mathsf{T}}y_j+\hat{g}_j)/\varepsilon+\log b_j\right],

and the second exchanges the points and weights. A fused Triton kernel Tillet et al. (2019) computes each half-step in one pass over tiles, fixed-size submatrices of the score matrix. For each tile it forms the dot products xiTyjx_i^{\mathsf{T}}y_j as a matrix product (GEMM), adds the bias, and folds the tile’s scores into a running LSE Milakov & Gimelshein [28]. The matrix products run on TF32 tensor cores, which offer higher throughput than FP32 at reduced mantissa precision. Scores and running statistics stay on chip and the kernel writes only the updated potentials to high-bandwidth memory (HBM), so FlashSinkhorn uses O((n+m)d)\mathcal{O}((n+m)d) working memory without materializing the n×mn \times m score matrix. KeOps Charlier et al. [7] evaluates the same reduction pair by pair in scalar FP32 arithmetic and forms no matrix product, so it does not use the tensor cores. Each dense half-step still evaluates all nmnm point pairs. The reduction streams over tiles, so a block mask can select the tiles the kernel visits, as in block-sparse variants of FlashAttention Dao et al. [10]; ); Dong et al. [11].

Multiscale Sinkhorn and Related Approaches

The remaining question is which tiles to skip. Prior multiscale Sinkhorn methods answer it through spatial coarsening and potential-based truncation. In the plan, the factor e−Cij/εe^{-C_{ij}/\varepsilon} falls to 1/e1/e at ∥xi−yj∥=ε\lVert x_i-y_j\rVert=\sqrt{\varepsilon}, so ε\sqrt{\varepsilon} is the spatial scale of the regularization, called the blur. In a locally uniform cloud, a ball whose radius is proportional to the blur holds few of the mm target points when the blur spans a few nearest-neighbour spacings, so most point pairs carry negligible mass and screening pays off. The number of points in such a ball grows exponentially with the dimension dd, as the dd-th power of the blur over the spacing, and the methods below, including ours, therefore target d≤3d\leq3.

Schmitzer [35] combines coarsening and potential-based truncation with ε\varepsilon-annealing. It truncates the kernel at the current potentials, keeping only entries above a threshold, and bounds the resulting error in the primal–dual gap (Eq. (3.7) and Propositions 10–11). To find these entries without testing all of them, it descends a hierarchy of cells and discards each cell pair that a bound shows to be negligible. This search combines potential maxima and cost lower bounds with entrywise refinement (Definition 13 and Algorithm 4). The reported experiments use a single CPU core (Section 5.1).

GeomLoss multiscale (Feydy et al., [13]; Feydy, [12]) anneals ε\varepsilon on weighted cell centroids and lifts the coarse potentials to the points without checking them. Before the fine updates, it builds a cell-pair mask from the last coarse potentials, keeping a pair of cells when their centroid cost is below the sum of their potentials plus a default margin of 5ε5\varepsilon. KeOps (Charlier et al., [7]) then evaluates the fine updates on the kept pairs. Because the centroid cost does not bound the point-pair costs from below, this mask approximates Schmitzer’s truncation but carries no bound on the mass it drops. Domain-decomposition methods solve local entropic subproblems in parallel, on CPUs (Bonafini & Schmitzer, [5]) or, for regular grids, on GPUs (Medina & Schmitzer, [27]).

Additional Related Work

Other approaches replace the Sinkhorn half-steps with gradient-based or Newton-type optimization to reduce iteration counts. Kemertas et al. [20] combine mirror descent with conjugate gradients, and Kemertas et al. [19] achieve locally quadratic convergence with a truncated Newton method. Like Sinkhorn-Newton-Sparse (Tang et al., 2024) and cuRegOT (Qiu, [30]), these solvers retain O(nm)\mathcal{O}(nm) work per iteration and become impractical at the problem sizes we target. Over-relaxed Sinkhorn iterations (Thibault et al., 2021; Lehmann et al., 2022) reduce the iteration count but also retain O(nm)\mathcal{O}(nm) work per iteration. Nyström [2] and low-rank [31] methods approximate the kernel or plan globally rather than exploiting spatial locality. Hierarchical Refinement [18] refines low-rank couplings recursively into a bijective Monge map in log-linear time, a different output from an EOT plan at a prescribed marginal residual.

Other multiscale methods address unregularized OT [34, 17], and octree extensions apply the GeomLoss centroid test at successive resolutions [33]. Chowdhury et al. [8] scale a quantized Gromov–Wasserstein variant to more than a million points. Sparse local corrections [16] extend the Nyström approximation of Altschuler et al. [2]. Convolutional heat kernels on grids [36] and nonequispaced fast Fourier transforms accelerate kernel application. Lakshmanan et al. [22] report matrix-free Sinkhorn computations with 10710^7 points in low dimension. Screenkhorn fixes selected dual variables before solving the reduced problem [1]. Native Sparse Attention (Yuan et al., 2025) uses compressed representations to score, rank and select key/value blocks. Each selected block contains consecutive tokens, allowing contiguous loads and tiled matrix computations even when selected blocks are separated in the sequence. FS2 uses spatial blocks of points and selects tiles through the potential-dependent, mass-based rule in § 3.2.

FlashSinkhorn 2: Algorithm and Analysis

FS2 rests on two observations. First, coarse updates are cheap but cannot remove the error of replacing points by centroids. FS2 therefore stays on the centroids until coarse updates stall. It switches to fine updates (Sinkhorn updates on the points themselves) only if a sampled check of the lifted potentials fails (§ 3.1). Second, most block pairs carry negligible mass. Fine updates skip them using a threshold set by the block masses, with a bounded error (§ 3.2). Figure 1

Figure 1. FlashSinkhorn 2 overview (Algorithm 1), drawn with B=4B=4. Panel (a) is the Morton order both stages share. Panels (b)–(d) are the coarse stage (§ 3.1) and panels (e)–(g) the fine stage (§ 3.2). Red outlines trace source block I4. Yellow and green mark candidate and admitted tiles. Purple denotes on-chip work, and hatched grey denotes HBM storage.

Algorithm 1 FlashSinkhorn 2 forward solver. Appendix B.2 gives the full stopping rules.

Require: Source X, target Y, probability weights a, b, regularization ε\varepsilon, tolerance τ\tau

Ensure: pointwise potentials (f,g)(f,g) and the sampled-check outcome

  1. Morton-sort, choose BB and tt, form blocks, boxes, and cells (xIc,aI),(yJc,bJ)(x^c_I,a_I),(y^c_J,b_J) // (a)

  2. anneal on centroids with FS streaming kernels to reach ε\varepsilon // (b)

  3. lift: fi,gjf_i,g_j by one half-step of (2) against the coarse records // (c)

  4. sample i∼aii \sim a_i, j∼bjj \sim b_j, then if both means plus three standard errors <τ<\tau, return // (d)

  5. continue coarse updates at ε\varepsilon until they stall, lift, then if the check passes, return

  6. for each fine update within budget do

  7. &nbsp;&nbsp;&nbsp;&nbsp;screen: keep (I,J)(I,J) with dmin⁡2(I,J)<fIY+gJY−ερIJd^2_{\min}(I,J)<f^Y_I+g^Y_J-\varepsilon\rho_{IJ} // (e)

  8. &nbsp;&nbsp;&nbsp;&nbsp;verify: A←{(I,J):mIJ>ρIJ}A\leftarrow\{(I,J):m_{IJ}>\rho_{IJ}\} in CSR form // (f)

  9. &nbsp;&nbsp;&nbsp;&nbsp;update: both sparse half-steps on AA from the same (f,g)(f,g), then average // (g)

  10. &nbsp;&nbsp;&nbsp;&nbsp;if a scheduled sampled check passes, return

  11. end for

  12. return potentials and check outcome

illustrates the dataflow and Algorithm 1 summarizes the solver. Appendix A gives the proofs and Appendix B the implementation details.

Both stages need spatially compact groups of points stored contiguously for coalesced GPU access. We sort the points by Morton key (Figure 1a), which interleaves the bits of the coordinates, so points that share a key prefix are contiguous and lie in one axis-aligned box. Two partitions of the sorted order serve the two stages: cells, whose points share all but the lowest tt key bits, for the coarse stage of § 3.1, and blocks of BB consecutive points for the fine stage of § 3.2. We replace each cell by its total mass and mass-weighted centroid, giving KxK_x source records (xIc,aI)(x^c_I,a_I) and KyK_y target records (yJc,bJ)(y^c_J,b_J). A finer partition reduces the distance from points to their centroids, but increases the KxKyK_xK_y pairs evaluated by each coarse update. The automatic policy chooses B∈{64,128,256}B \in\{64,128,256\} by comparing the estimated block-summary memory with the L2 budget, and takes the smallest tt whose coarse state fits the same budget, with at most twice as many cells as blocks.

Coarse Sinkhorn Updates

The coarse stage solves the EOT problem between the cell records. We anneal with FlashSinkhorn’s streaming TF32 kernels (Ye et al., 2026) (Figure 1b), running coarse updates along a decreasing ε\varepsilon-schedule, each from the potentials of the previous one. When the schedule first reaches the requested ε\varepsilon, we lift the coarse potentials to the original points (Figure 1c). The lifted fif_i is the first half-step of (2) with the coarse target records (yJc,bJ,gJc)(y^c_J,b_J,g^c_J) in place of (yj,bj,gj)(y_j,b_j,g_j), and gjg_j is the second with (xIc,aI,fIc)(x^c_I,a_I,f^c_I) in place of (xi,ai,fi)(x_i,a_i,f_i). The two lifts evaluate nKy+mKxnK_y+mK_x pairs.

The solver returns once a check finds both marginal residuals of the current plan, ∥P1−a∥1\lVert\mathbf{P1}-a\rVert_1 and ∥PT1−b∥1\lVert\mathbf{P}^{\mathsf{T}}\mathbf{1}-b\rVert_1, below a tolerance τ\tau. Computing them exactly costs O(nm)O(nm), so we check by sampling (Figure 1d). We draw rows ii with probability aia_i and average ∣ri/ai−1∣\lvert r_i/a_i-1\rvert, where the row sum ri=(P1)ir_i=(\mathbf{P1})_i costs O(md)O(md). The average is an unbiased estimate of the row residual, and columns are sampled in the same way. The check passes when both estimates plus three standard errors are below τ\tau. Every residual we report is evaluated at the returned potentials, independently of the check. A lifted plan can miss τ\tau for two reasons, which the following bound separates.

Proposition 1. Let PcP^c be the entropic plan induced by any finite coarse potentials, λc=max⁡J∣log⁡(PIJc/bJ)∣\lambda_c=\max_J\lvert\log(P^c_{IJ}/b_J)\rvert its largest log column-mass error, RY=max⁡Jmax⁡j∈J∥yj−yJc∥R_Y=\max_J\max_{j\in J}\lVert y_j-y^c_J\rVert the largest target-cell radius, and θ=2diam⁡(X)RY/ε\theta=2\operatorname{diam}(X)R_Y/\varepsilon. The plan PP induced by the two lifts satisfies

∥P1−a∥1≤(eλc−1)+eλc(eθ−1−θ).(3)\lVert\mathbf{P1}-a\rVert_1\leq(e^{\lambda_c}-1)+e^{\lambda_c}(e^\theta-1-\theta). \tag*{(3)}

With the clouds exchanged, the same bound holds for the column residual ∥PT1−b∥1\lVert\mathbf{P}^{\mathsf{T}}\mathbf{1}-b\rVert_1.

The proof is in Appendix § 7.§ 1. The first term comes from inexact coarse marginals and vanishes at coarse convergence. The second bounds the error of replacing points by centroids. It grows like θ2/2\theta^2/2 for small θ\theta, and at coarse convergence it reduces to eθ−1−θe^\theta-1-\theta, which no coarse update changes. When the check rejects a lift, the solver therefore shrinks the first term with further coarse updates at the target ε\varepsilon, which cost only KxKyK_xK_y centroid pairs each, until its potentials stall or 2048 extra updates have run, and then lifts and checks again. If this check also fails, the solver turns to fine updates on the points, repeats the check on a schedule, and reports that the tolerance was not confirmed if the fine-update budget runs out first. On all our problems the bound of Proposition 1 exceeds τ\tau, so the sampled check, not the bound, decides whether to accept a lift.

Outside the forward solve, the coarse records also yield a surrogate gradient for optimization. Holding the coarse target records (yJc,bJ,gJc)(y^c_J,b_J,g^c_J) fixed makes each lifted fif_i a function of xix_i alone, and the surrogate L^=∑iaifi\widehat{\mathcal{L}}=\sum_i a_i f_i has gradient G^i=2ai(xi−T~i)\widehat{G}_i=2a_i(x_i-\widetilde{T}_i), where T~i\widetilde{T}_i is the barycentric projection of xix_i against these records. The gradient costs the lift’s nKynK_y pairs and needs no fine update. Appendix § 7.§ 2 gives a condition on direction and step size sufficient to decrease the original objective.

Sparse Sinkhorn Updates

A dense fine update evaluates all nmnm point pairs, so FS2 restricts each fine update to the block pairs in a mask. We build the mask over the NB=⌈n/B⌉N_B=\lceil n/B\rceil source and MB=⌈m/B⌉M_B=\lceil m/B\rceil target blocks of at most BB points by potential-dependent truncation of the current entropic plan Pij=aibje(fi+gj−Cij)/εP_{ij}=a_i b_j e^{(f_i+g_j-C_{ij})/\varepsilon}. From here on, II and JJ index blocks rather than cells. Both half-steps share the mask, so its threshold must account for both block masses. The following bound makes this precise.

Theorem 1. Fix the potentials and δrel>0\delta_{\mathrm{rel}}>0. Write aI=∑i∈Iaia_I=\sum_{i\in I}a_i, bJ=∑j∈Jbjb_J=\sum_{j\in J}b_j, and define

mIJ=max⁡i∈I,j∈Jfi+gj−Cijε,ρIJ=log⁡δrelmax⁡(aI,bJ).(4)m_{IJ}=\max_{i\in I,j\in J}\frac{f_i+g_j-C_{ij}}{\varepsilon},\qquad \rho_{IJ}=\log\frac{\delta_{\mathrm{rel}}}{\max(a_I,b_J)}. \tag*{(4)}

If mIJ≤ρIJm_{IJ}\leq\rho_{IJ}, then ∑j∈JPij≤δrelai\sum_{j\in J}P_{ij}\leq\delta_{\mathrm{rel}}a_i for every i∈Ii\in I, and ∑i∈IPij≤δrelbj\sum_{i\in I}P_{ij}\leq\delta_{\mathrm{rel}}b_j for every j∈Jj\in J.

The proof is in Appendix § 7.§ 3: bound each plan entry by emIJe^{m_{IJ}}, then sum the weights in the opposite block. Testing every mIJm_{IJ} directly would evaluate all nmnm point pairs, so we screen in two stages Figure 1e–Figure 1f. First, a box screen rejects block pairs whose axis-aligned bounding boxes are far apart, using only block-level potential maxima fIV=max⁡i∈Ifif_I^{\mathrm{V}} = \max_{i\in I} f_i, gJV=max⁡j∈Jgjg_J^{\mathrm{V}} = \max_{j\in J} g_j and the minimum squared distance dmin⁡2(I,J)d_{\min}^2(I,J):

A:={(I,J):mIJ>ρIJ}⊆{(I,J):dmin⁡2(I,J)<fIV+gJV−ερIJ}.(5)\mathcal{A} := \{(I,J):m_{IJ}>\rho_{IJ}\}\subseteq\{(I,J):d_{\min}^2(I,J)<f_I^{\mathrm{V}}+g_J^{\mathrm{V}}-\varepsilon\rho_{IJ}\}. \tag*{(5)}

This reduces the scan from nmdnmd to NBMBdN_BM_Bd. Second, a verification pass evaluates the exact mIJm_{IJ} over all B2B^2 point pairs of each candidate (a block pair that passes the box screen) and rejects those with mIJ≤ρIJm_{IJ}\leq\rho_{IJ}. We store the admitted tiles A\mathcal{A} in CSR form, which lists, for each source block II, the target blocks JJ with (I,J)∈A(I,J)\in\mathcal{A}. The ff half-step reads this index and the gg half-step reads its transpose. If a block has no admitted tile, its sparse half-step would have no terms, so the solver computes it densely, against every point of the other cloud. The other blocks stay sparse.

Both the truncation principle, which rejects negligible pairs with the current potentials, and the block relaxation behind Equation (5) come from Schmitzer [35], but FS2 differs from his solver in three ways. First, Schmitzer stores the truncated kernel, one entry per retained point pair, and iterates by sparse matrix–vector products. FS2 stores one index per admitted tile instead of its B2B^2 entries, because each sparse half-step runs FlashSinkhorn’s streaming kernel (§ 2.1) over these tiles and recomputes their scores on chip. Second, Schmitzer refines a cell hierarchy recursively down to point pairs, whereas we screen all block pairs in parallel at a single level and keep whole B×BB\times B tiles, since the kernel evaluates every pair of an admitted tile. Each kept tile spans two contiguous ranges of the Morton order, so the kernel loads both ranges with coalesced reads and forms their scores on tensor cores. Third, Schmitzer’s threshold is uniform, whereas ours is set by the block masses. Because Theorem 1 certifies a mask only at the potentials used to build it, we rebuild the mask at every fine update. The mask also determines the error in each sparse update and in the gradient.

Proposition 2. Let νi\nu_i be the fraction of row ii’s plan mass omitted by the mask, with positive retained mass. Then (i) the sparse and full row updates differ by ∣fi+,A−fi+∣=εlog⁡11−νi\lvert f_i^{+, \mathcal{A}}-f_i^+\rvert=\varepsilon\log\frac{1}{1-\nu_i}, and (ii) the barycentric projection over the admitted columns satisfies ∥TεA(xi)−Tε(xi)∥≤νidiam⁡(Y)\lVert T^{\mathcal{A}}_\varepsilon(x_i)-T_\varepsilon(x_i)\rVert\leq\nu_i\operatorname{diam}(\mathbf{Y}).

The proof is in Appendix § 7.§ 4. Both errors vanish with νi\nu_i, which Theorem 1 bounds. Each omitted tile contributes at most δrelai\delta_{\mathrm{rel}}a_i to row ii, and a source block omits at most MBM_B tiles, so νi≤MBδrelai/ri\nu_i\leq M_B\delta_{\mathrm{rel}}a_i/r_i, where ai/ria_i/r_i tends to 1 as the marginals converge. This bound guides the choice of δrel\delta_{\mathrm{rel}} for a tolerance τ\tau. The automatic policy takes δrel=τ/(4max⁡(NB,MB))\delta_{\mathrm{rel}}=\tau/(4\max(N_B,M_B)), so νi≤(τ/4)ai/ri\nu_i\leq(\tau/4)a_i/r_i in every row and the mass the mask omits, summed over all rows or over all columns, is at most τ/4\tau/4. This also certifies the full residual. Let PA\mathbf{P}^{\mathcal{A}} keep only the admitted tiles of P\mathbf{P}, and let Ω=∑(I,J)∉AaibjemˉIJ\Omega=\sum_{(I,J)\notin\mathcal{A}}a_i b_j e^{\bar m_{IJ}}, where mˉIJ\bar m_{IJ} is mIJm_{IJ} for a rejected candidate and (fIV+gJV−dmin⁡2(I,J))/ε(f_I^{\mathrm{V}}+g_J^{\mathrm{V}}-d_{\min}^2(I,J))/\varepsilon for a pair the box screen rejects. Then Ω\Omega, at most τ/4\tau/4, bounds the omitted mass. At the potentials used to build the mask, ∥P1−a∥1≤∥PA1−a∥1+Ω\lVert\mathbf{P}\mathbf{1}-a\rVert_1\leq\lVert\mathbf{P}^{\mathcal{A}}\mathbf{1}-a\rVert_1+\Omega, and likewise for the columns. The sparse half-steps give the marginals of PA\mathbf{P}^{\mathcal{A}} at no extra cost, since (PA1)i/ai=e(fi−fi+,A)/ε(\mathbf{P}^{\mathcal{A}}\mathbf{1})_i/a_i=e^{(f_i-f_i^{+,\mathcal{A}})/\varepsilon}, and Ω\Omega costs one reduction over values the two passes already form.

When an application needs an accurate gradient rather than the surrogate, FS2 evaluates the gradient 2ai(xi−Tε(xi))2a_i(x_i-T_\varepsilon(x_i)) on the points. It builds a mask at the returned potentials by the same rule and replaces Tε(xi)T_\varepsilon(x_i) by TεA(xi)T_\varepsilon^{\mathcal{A}}(x_i), the barycentric projection over the admitted tiles of the source block containing ii. A kernel computes it by streaming ∑jPijyj\sum_j P_{ij}y_j alongside the row sum, and the transposed index gives the target-side gradient in the same way. Proposition 2(ii) bounds the error that the mask adds, and the potentials’ distance from convergence and the kernel’s arithmetic add the rest.

Each fine update has three costs: the box screen (Θ(NBMBd)\Theta(N_BM_Bd)), the verification (Θ(B2d)\Theta(B^2d) per candidate), and both sparse half-steps (Θ(B2d∣A∣)\Theta(B^2d\lvert\mathcal{A}\rvert)). As the box blur ν\nu falls to a few nearest-neighbour spacings, ∣A∣\lvert\mathcal{A}\rvert drops well below NBMBN_BM_B and sparse updates become cheaper than dense ones. Beyond the points and potentials, working memory holds only the indices of the candidate and admitted tiles. Appendices A.5 and B.4 give the IO model and the complete operation count.

Experiments

We evaluate FS2 on 32 synthetic problems and on the Quijote cosmological NN-body simulation, measuring the time each solver takes to return potentials whose full two-sided marginal residual, R=max⁡(∥P1−a∥1,∥PT1−b∥1)R=\max(\lVert\mathbf{P}\mathbf{1}-a\rVert_1,\lVert\mathbf{P}^{\mathsf{T}}\mathbf{1}-b\rVert_1), is at most a tolerance τ\tau. On the synthetic problems (Section 4.1), we compare FS2 with GeomLoss multiscale and FlashSinkhorn and isolate its three ingredients: the coarse stage, the sparse fine stage and the surrogate gradient for optimization. On Quijote (§ 4.2), we scale FS2 from 2242^{24} particles to the full 2272^{27}-particle box.

Every solve runs on one A100, and FS2 receives centered, TF32-rounded coordinates. Any potentials induce the plan Pij=aibje(fi+gj−Cij)/εP_{ij}=a_i b_j e^{(f_i+g_j-C_{ij})/\varepsilon}, which is the exact EOT solution for its own marginals P1\mathbf{P1} and PT1\mathbf{P}^{\mathsf{T}}\mathbf{1} ([29]). Its error therefore lies entirely in these marginals, and RR measures how far they are from a\mathbf{a} and b\mathbf{b}.

Benchmarks

Setup. We benchmark 32 problems in d=3d=3 with uniform weights, 16 on clustered clouds of 32 Gaussian clusters and 16 on heterogeneous clouds that mix a compact Gaussian, a thin needle and a 1% uniform background. Both families span n=mn=m from 2192^{19} to 2232^{23} and ε\varepsilon from 0.001 to 0.02. This range of ε\varepsilon puts the blur ε\sqrt{\varepsilon} between 0.032 and 0.14, or 3–14% of the side of the unit cube of the clustered clouds. All methods receive the same coordinates and the full squared-Euclidean cost, GeomLoss always runs its multiscale solver, and the target is τ=0.005\tau=0.005. Appendix C gives the data, the protocol, the endpoint of every run and a sweep of GeomLoss’s scaling and cluster scale.

Speed. FS2 meets τ\tau on all 32 problems and GeomLoss on 10, all heterogeneous (Figure 2a–Figure 2d). At the returned potentials, the certificate of § 3.2 confirms R≤τR\leq\tau for every return we evaluated on the 32 problems. Across 20 further sampling seeds on each of the seven problems closest to τ\tau, the check never accepted potentials whose residual exceeded τ\tau (Appendix § 9.§ 4). On clustered problems GeomLoss misses τ\tau at every size and regularization. Table 1 shows one such problem, n=221n=2^{21}, in full: FS2 meets τ\tau in 15.4 s, GeomLoss ends its schedule after 21.45 s at residual 0.054, and FlashSinkhorn needs 312 s to reach 0.060, because each of its 44 updates evaluates all n2n^2 pairs. With its native schedule, GeomLoss misses τ\tau on this problem at every scaling and cluster scale. we tried, and the best setting needs 421 s when continued at the target ε\varepsilon until it meets τ\tau (GL+). Figure 2(f) shows how FS2 reaches τ\tau on clustered n=222n=2^{22}. At ε=0.001\varepsilon=0.001, FS2 lifts after less than a second, because a coarse update evaluates KxKyK_xK_y centroid pairs rather than n2n^2 point pairs, and the lifted residual is already below GeomLoss’s final one. Further coarse updates then lower the residual, and the fine updates remove the remaining centroid error, bringing the residual below τ\tau in about a quarter of GeomLoss’s time. At ε=0.01\varepsilon=0.01 the blur is 10\sqrt{10} times wider relative to the cells, so the centroid error is smaller and the coarse stage alone reaches τ\tau. GeomLoss returns sooner but misses it.

Figure 2. FS2 vs GeomLoss (GL). (a–d) Time of a complete solve on 26 problems: nn from 2192^{19} to 2232^{23} (a,c) and ε\varepsilon from 0.001 to 0.02 at n=222n=2^{22} (b,d). A cross marks a GL return with residual R>τ=0.005R > \tau=0.005. (e) Peak GPU memory allocated by PyTorch. (f) On clustered n=222n=2^{22}, the time at which each new best full residual RR is reached, for FS2’s potentials along the solve and for GL’s native returns. The residual decreases to the right. The dotted line marks τ\tau and the arrow marks the first fine update. (g,h) Change in the grouped objective UU over twenty optimization steps at n=221n=2^{21}, against cumulative end-to-end (E2E) time, including compilation and autotuning.

Table 1: FS2 against GeomLoss (GL) and FlashSinkhorn (FS) on the clustered n=m=221n=m=2^{21}, ε=0.001\varepsilon=0.001 problem. Bold marks solves that meet τ=0.005\tau=0.005. In (a), stage times are GPU kernel time from a separate profiled call, with sampled checks counted in the fine stage. GL+ is GL at scaling 0.99, continued at the target ε\varepsilon until its full residual first meets τ\tau.

FS2GLGL+FS
(a) Complete solve
Time (s)15.4421.45421.10311.98
coarse stage2.940.0050.022–
fine stage12.3021.40420.67311.98
Fine updates181222544
per update (s)0.681.781.877.09
Memory (GiB)2.090.260.260.20
Residual0.004830.054160.0049970.05972
(b) One fine update per direction
Point pairs (101110^{11})2.582.5844.0
Kernel time (ms)2513943,600
ms per 10910^{9} pairs0.971.530.82
Warp instr. per pair0.280.630.34
HBM read (B/10310^{3} pairs)14.90.324.35
Tensor pipe (%)21.10.07–
Math-pipe stall (%)2.317.49.0

Table 1.

On the ten problems where both solvers meet τ\tau, FS2 is 74–645× faster than GeomLoss at its default cluster scale. The largest gap is on heterogeneous n=223n=2^{23} at ε=0.001\varepsilon=0.001, where FS2 returns in 4.026 s and GeomLoss takes 2595 s. On all ten, FS2’s first lift already passes the check, so its only work on the points is that lift and the check. GeomLoss’s default gives far fewer cells, than the final blur, so its schedule ends with levels on the points, and it never checks its lift. FS2 picks its cell count from the input. We tested that count on one of these ten problems, where GeomLoss also stops after its coarse stage and comes close to FS2 but remains slower.

Ablations. Each row of Table 2 removes or shortens one component of FS2. FS2 itself runs 2196 coarse updates and then needs just 15 fine updates. Without the coarse stage, the solve anneals on the points and misses τ\tau even at the fine-update cap. Stopping the coarse stage after 404 updates instead leaves 1115 fine updates and makes the solve 51.6× slower. With the same 15 fine updates, dense execution evaluates every tile rather than the 6.3% the mask admits and is 8.00× slower. The box screen alone, without tile verification, recovers almost all of this gain and is only 4% slower.

Table 2: Ablations on clustered n=m=220n=m=2^{20}, ε=0.001\varepsilon=0.001.

ControlCoarseFineTime (s)Time/FS2
FS22196154.171
No coarse stage0130153.33R>τR>\tau
Early coarse stop4041115215.6751.59
Dense fine21961533.338.00
Box only2196154.341.04

Table 2. Coarse, Fine: updates. Early coarse stop: fine cap 8192.

Profiling insight. To see why FS2’s fine update is fast, Table 1b profiles one, in both directions, with NCU on an A100, next to a dense FlashSinkhorn update and GeomLoss’s KeOps executor on FS2’s mask and potentials. FS2’s update evaluates only 5.9% of the point pairs (xi,yj)(x_i,y_j) of the dense update, and NCU measures a 14× shorter kernel time. Per pair, the sparse kernel is nearly as cheap as the dense one, 0.97 against 0.82 per 10910^9 pairs, and executes fewer warp instructions. This holds although it gathers each admitted target block through the CSR index, while the dense kernel streams every block in order (Proposition 5). On the same mask, GeomLoss’s KeOps executor takes 1.57× longer and executes 2.3× more instructions per pair, because FS2 computes the squared distances as tiled dot products on the tensor cores. FS2 even reads more HBM data per pair than GeomLoss, so on the same mask its speed comes from fewer instructions, not fewer bytes.

Memory. FS2 trades memory for speed by design. The selector keeps the coarse state and the block summaries within the L2 budget and, within it, picks the finest cells and blocks, so the coarse stage stays cheap and the mask screens at fine granularity. The price is the mask’s index, 24 bytes per screened or admitted tile, which puts FS2’s peak allocation at 8–10× that of either baseline in Table 1a. The peak follows the mask (Table 3). At n=220n=2^{20} the heterogeneous mask admits ten times the clustered share and needs three times the memory. At n=223n=2^{23} the heterogeneous solve returns its first lift and builds no mask, so its peak lies below the one at 2212^{21}. Without a mask, as at ε=0.01\varepsilon=0.01 for n≥220n\geq2^{20}, the peak grows only as GeomLoss’s does. At fixed ε\varepsilon the mask grows faster than nn, because each point has more neighbours within the blur, so over the clustered sweep at ε=0.001\varepsilon=0.001 the peak rises 40-fold while nn rises 16-fold (Figure 2e). Larger blocks cut this cost. At n=223n=2^{23}, B=256B=256 instead of the selected 128 lowers the peak from 16.2 to 6.9 GiB for slightly more time, and the selector itself takes B=256B=256 for the 2272^{27} Quijote run, whose peak stays within the 80 GiB card.

Table 3: FS2 peak memory at ε=0.001\varepsilon=0.001.

CloudnnBBAdmittedPeak (GiB)
Clustered2202^{20}1286.3%0.85
Heterog.2202^{20}12860.6%2.72
Heterog.2212^{21}12859.8%9.89
Clustered2232^{23}1285.2%16.17
Clustered2232^{23}2565.6%6.88
Heterog.2232^{23}128no mask3.40

Table 3.

Optimization. Many applications move points along an OT gradient and need a descent direction rather than an exact gradient. We test FS2’s direction and its end-to-end cost by moving the source points to decrease their EOT cost OTε\mathrm{OT}_{\varepsilon} (Equation (1)) to a fixed target cloud, with no other term in the objective. FS2 steps along the surrogate gradient G~\widetilde{G}, which takes the barycentric projection over the KuK_u coarse target centroids instead of the mm targets. A step therefore costs one coarse solve and one pass over the centroids, and needs no fine update. A small step along any direction whose relative error to the exact gradient is below one decreases the objective (Proposition 4). On each of the 32 inputs, both methods take twenty normalized steps X←X−0.03 H/∥H∥FX\leftarrow X-0.03\,H/\lVert H\rVert_F, with H=G~H=\widetilde{G} for FS2 and, for GeomLoss, the autograd gradient with respect to the source points, which costs about one forward solve per step. Each step moves the points by 0.03/n0.03/\sqrt{n} RMS, so the twenty steps measure the direction at the initial points rather than following a long flow. Both methods’ iterates are scored by the same grouped objective UU, which fixes KK groups of the initial source points and of the targets and adds the EOT cost between the mass-weighted group centroids, solved accurately, to the mean squared distance of the points to their group centroids. This score ranks the iterates without a full-point solve, and the surrogate lowers it at every checkpoint on all 32 inputs. At n=221n=2^{21} (Figure 2g), FS2 is 25–61× faster end to end on heterogeneous data, with tied final scores. On clustered data it reaches a lower final UU at both ε\varepsilon, and is also faster at ε=0.001\varepsilon=0.001. GeomLoss is faster only at clustered ε=0.01\varepsilon=0.01, where its forward solve takes 0.03 s but misses τ\tau.

Quijote Particle Transport

Problem and data. We test FS2 on one fiducial realization of the Quijote cosmological NN-body suite, 5123512^3 dark-matter particles in a periodic 1 h−1 Gpc1\,h^{-1}\,\mathrm{Gpc} box (Villaescusa-Navarro et al., 2020). The sources are the redshift-zero positions xix_i and the targets are the Lagrangian lattice sites qiq_i, both with uniform weights. The particle IDs define the reference displacements but are hidden from the solve. Nested subdomains centered in the box give n=mn=m from 2242^{24} to 2272^{27}, the full box. We fix the blur ε≃1.95 Mpc/h\sqrt{\varepsilon}\simeq1.95\,\mathrm{Mpc}/h at one lattice spacing, the mean interparticle distance and 0.2–0.4% of the domain width, and use the plain squared-Euclidean cost, which ignores the periodic wrap of the box. The evolved cloud is strongly clustered and far from the lattice. In the 2242^{24} subdomain the median particle lies 4.6 blurs from its lattice site. At this blur the coarse stage alone does not reach the target, so every solve’s fine updates start from the first lift. We set the cell level tt and the fine-update cap for each size. Appendix D gives the data, the protocol and every run.

Scaling. At τ=0.05\tau=0.05, FS2 meets the target at all four sizes of Figure 3, verified on sampled points at the two intermediate sizes. From 2242^{24} to 2272^{27} particles, the time grows 9.2-fold for an 8-fold increase in nn, and the peak memory stays within the 80 GiB card. As on the clustered benchmarks, the fine stage does most of the work. It begins within the first 3% of each run’s time and lowers the sampled residual from about 1 to the target. GeomLoss multiscale at scaling 0.95 takes 25 times as long as FS2 at 2242^{24} and still misses τ\tau. Its time grows almost quadratically with nn on the synthetic benchmarks, so we run it only at 2242^{24}. At τ=0.01\tau=0.01, a first complete call of FS2 solves the full box, 2542^{54} particle pairs, on one A100 in under 2.5 hours. Its full marginal residual is below 0.01, even after an FP64 correction estimated on sampled points. The certificate of § 3.2 gives the same bound from one mask build at the returned potentials, in minutes rather than the hours of the full evaluation. To our knowledge, the full box is the largest discrete EOT problem solved to this accuracy within hours, and it matches the particle count of the semi-discrete reconstruction of Lévy et al. [25].

Figure 3. FS2 on Quijote. (a) Time of a complete warm call of FS2 at τ=0.05\tau=0.05. The cross marks GL’s instrumented call at 2242^{24}. (b) Peak GPU memory allocated by PyTorch, and the selected block size BB. (c) Best sampled residual versus time. Diamonds mark the first fine update and dotted lines the targets. (d) Key results. Orange marks a return with residual above τ\tau, and RMSE is the displacement error of the 2272^{27} solution at τ=0.01\tau=0.01 and of a zero-displacement predictor.

Displacement reconstruction. The plan also estimates each particle’s displacement. On 4096 particles sampled from the 2272^{27}, τ=0.01\tau=0.01 solution, the barycentric projection Tε(xi)T_{\varepsilon}(x_i) of § 2.1, taken over all 2272^{27} targets, gives displacements xi−Tε(xi)x_i - T_{\varepsilon}(x_i) whose RMSE against the particle-ID displacements xi−qix_i-q_i, both wrapped to the periodic box, is 35.7% below that of predicting no displacement (Figure 3d). The three components correlate equally well with the reference, and particles whose reference trajectories cross a periodic face have larger errors than the rest.

Conclusion and Limitations

We introduced FlashSinkhorn 2 (FS2), which solves large discrete EOT problems to a prescribed marginal residual by coupling a coarse stage on cell centroids with a block-sparse fine stage that removes the centroid error. On synthetic benchmarks, FS2 reaches the target residual on all 32 problems and GeomLoss on 10. On one A100 it solves EOT between two 1.34×1081.34 \times10^{8}-particle measures, at a blur of one lattice spacing, to a marginal residual below 0.01 in under 2.5 hours.

FS2 targets squared-Euclidean cost in d≤3d \le3, where a blur-sized ball holds few points and screening pays off. Reaching the 101010^{10} points that Lévy et al. [25] set as the goal for cosmology needs blocks spread over several GPUs, because the coordinates of one measure alone take 112 GiB in FP32, more than an A100’s 80 GiB. It also needs a sub-quadratic pair search, such as a dual-tree traversal (Lee et al. [23]), because the box screen tests every block pair.

AI USE STATEMENT

Generative AI tools (Anthropic’s Claude through Claude Code, and OpenAI’s Codex) assisted with code, experiments, figures and editing. The authors checked every reported number against the experiment records and take full responsibility for the content.

Proofs for Section 3

Proof of Proposition 1

Let fcf^c, gcg^c be finite coarse potentials, not necessarily converged, with coarse plan and target marginal ratios

PIJc=aIbJe(fIc+gJc−C(xIc,yJc))/ε,cJ=∑IPIJcbJ.P^c_{IJ}=a_Ib_J e^{(f_I^c+g_J^c-C(x_I^c,y_J^c))/\varepsilon}, \qquad c_J=\frac{\sum_I P^c_{IJ}}{b_J}.

The first lift defines weights wiJ=bJe(fi+gJc−C(xi,yJc))/εw_{iJ}=b_J e^{(f_i+g_J^c-C(x_i,y_J^c))/\varepsilon} with ∑JwiJ=1\sum_J w_{iJ}=1, and πI∣J=PIJc/(bJcJ)\pi_{I\mid J}=P^c_{IJ}/(b_Jc_J) is the conditional distribution over source centroids for target cell JJ, with mean uJ=∑IπI∣JxIcu_J=\sum_I\pi_{I\mid J}x_I^c. For j∈Jj\in J write zj=yj−yJcz_j=y_j-y_J^c and

ϕiJ(z)=[∑IπI∣Je2(xIc−xi)⊤z/ε]−1.\phi_{iJ}(z)=\left[\sum_I\pi_{I\mid J}e^{2(x_I^c-x_i)^\top z/\varepsilon}\right]^{-1}.

Substituting both lifts into the fine plan and expanding the squared distances, the two copies of e−∥zj∥2/εe^{-\lVert z_j\rVert^2/\varepsilon} cancel, and

(P1)iai=∑JwiJcJ∑j∈JbjbJϕiJ(zj).(6)\frac{(P1)_i}{a_i}=\sum_J\frac{w_{iJ}}{c_J}\sum_{j\in J}\frac{b_j}{b_J}\phi_{iJ}(z_j). \tag*{(6)}

Proof. Fix JJ and z=zjz=z_j, and put ℓI=2(xIc−xi)⊤z/ε\ell_I=2(x_I^c-x_i)^\top z/\varepsilon and F(s)=(∑IπI∣JesℓI)−1F(s)=\left(\sum_I\pi_{I\mid J}e^{s\ell_I}\right)^{-1}, so that ϕiJ(z)=F(1)\phi_{iJ}(z)=F(1). Exact centroids are convex combinations of points, so ∣ℓI∣≤2diam⁡(X)RY/ε=θ\lvert\ell_I\rvert\le2\operatorname{diam}(X)R_Y/\varepsilon=\theta. With μs\mu_s and vsv_s the mean and variance of ℓI\ell_I under probabilities proportional to πI∣JesℓI\pi_{I\mid J}e^{s\ell_I}, we have F′(s)=−F(s)μsF'(s)=-F(s)\mu_s and F′′(s)=F(s)(μs2−vs)F''(s)=F(s)(\mu_s^2-v_s). Since μs2+vs≤θ2\mu_s^2+v_s\le\theta^2 and F(s)≤esθF(s)\le e^{s\theta} on [0,1][0,1], ∣F′′(s)∣≤esθθ2\lvert F''(s)\rvert\le e^{s\theta}\theta^2, and

∣F(1)−1−F′(0)∣≤∫01(1−s)esθθ2 ds=eθ−1−θ.\lvert F(1)-1-F'(0)\rvert\le\int_0^1(1-s)e^{s\theta}\theta^2\,ds=e^\theta-1-\theta.

The cell average of F′(0)=−2(uJ−xi)⊤z/εF'(0)=-2(u_J-x_i)^\top z/\varepsilon vanishes because yJcy_J^c is the exact mass-weighted centroid, so ∣∑j∈J(bj/bJ)ϕiJ(zj)−1∣≤eθ−1−θ\left|\sum_{j\in J}(b_j/b_J)\phi_{iJ}(z_j)-1\right|\le e^\theta-1-\theta. Substituting into Equation (6) with ∑JwiJ=1\sum_J w_{iJ}=1, cJ−1≤eλcc_J^{-1}\le e^{\lambda c} and ∣cJ−1−1∣≤eλc−1\left|c_J^{-1}-1\right|\le e^{\lambda c}-1 gives, for every row,

∣(P1)iai−1∣≤(eλc−1)+eλc(eθ−1−θ).\left|\frac{(\mathbf{P}\mathbf{1})_i}{a_i}-1\right|\le(e^{\lambda c}-1)+e^{\lambda c}(e^\theta-1-\theta).

and multiplying by aia_i and summing proves Equation (3). The column bound exchanges the roles of the two clouds.

Exact coarse convergence does not remove the second term. Let both measures put mass 1/21/2 at −h-h and hh, aggregated into one cell at zero. Then fc=gc=0f^c=g^c=0 is optimal, the lifted potentials are fi=gj=h2f_i=g_j=h^2, and ∥P1−a∥1=∥P⊤1−b∥1=cosh⁡(2h2/ε)−1>0\|\mathbf{P}\mathbf{1}-a\|_1=\|\mathbf{P}^{\top}\mathbf{1}-b\|_1=\cosh(2h^2/\varepsilon)-1>0.

Size of the bound on the grid. On the 32 grid problems of Section C.3, θ\theta ranges from 2.1 to 143 for rows and from 2.1 to 145 for columns, so the second term of Equation (3) exceeds 4.8 everywhere and the bound never accepts a lift, while the 20 lifted returns have residuals of at most 0.0041. The two terms still separate the two ways a lift fails. On clustered problems with ε≥0.002\varepsilon\ge0.002, extra coarse updates lower the lifted residual. On heterogeneous problems at ε=0.001\varepsilon=0.001 and n≤221n\le2^{21}, and on clustered n=219n=2^{19} at ε=0.001\varepsilon=0.001, it stays flat, and fine updates are required.

Stored centroids. The proof uses exact centroids. FS2 rounds the aggregated coordinates once to TF32, so that the same stored coordinates supply the norms, the dot products and the lift, and this rounding changes the potentials by about 1.6×10−41.6\times10^{-4} and the lift’s residual by 0.5%.

Coordinate Gradients from Coarse Potentials (Propositions 3 and 4)

At each outer step the optimization rebuilds the geometry at the current iterate X\mathbf{X} and anneals on the cells until it first reaches ε\varepsilon. The target centroids yJcy_J^c, masses bJb_J and potentials gJcg_J^c are then held fixed, so gradients do not pass through the partition, the centroids or the coarse updates. With the source coordinates replaced by Z=(zi)iZ=(z_i)_i, let

wiJ(Z)=bJexp⁡((gJc−∥zi−yJc∥2)/ε)∑LbLexp⁡((gLc−∥zi−yLc∥2)/ε),T~i(Z)=∑JwiJ(Z)yJc.w_{iJ}(Z)=\frac{b_J\exp\left((g_J^c-\lVert z_i-y_J^c\rVert^2)/\varepsilon\right)}{\sum_L b_L\exp\left((g_L^c-\lVert z_i-y_L^c\rVert^2)/\varepsilon\right)},\qquad\widetilde{T}_i(Z)=\sum_J w_{iJ}(Z)y_J^c.

At Z=XZ=X these are the lift weights of Section A.1 and the projection T~i\widetilde{T}_i of § 3.1, and direct differentiation gives ∇ziL~(Z)=2ai(zi−T~i(Z))\nabla_{z_i}\widetilde{\mathcal{L}}(Z)=2a_i(z_i-\widetilde{T}_i(Z)), the gradient formula of § 3.1.

The surrogate gradient can differ from a gradient built on a fine barycentric projection in two ways. Let pijp_{ij} be any normalized conditional distribution over the target points for source row ii, piJ=∑j∈Jpijp_{iJ}=\sum_{j\in J}p_{ij}, and, when piJ>0p_{iJ}>0, yˉiJ=piJ−1∑j∈Jpijyj\bar{y}_{iJ}=p_{iJ}^{-1}\sum_{j\in J}p_{ij}y_j. With wiJ=wiJ(X)w_{iJ}=w_{iJ}(X), let rJ=max⁡j∈J∥yj−yJc∥r_J=\max_{j\in J}\lVert y_j-y_J^c\rVert and TV⁡i=12∑J∣piJ−wiJ∣\operatorname{TV}_i=\frac{1}{2}\sum_J\lvert p_{iJ}-w_{iJ}\rvert.

Proposition 3. For Ti=∑JpiJyjT_i=\sum_Jp_{iJ}y_j and T~i=∑JwiJyJc\widetilde{T}_i=\sum_Jw_{iJ}y_J^c,

∥Ti−T~i∥≤∑JpiJrJ+diam⁡(Yc)TV⁡i.(7)\lVert T_i-\widetilde{T}_i\rVert\le\sum_Jp_{iJ}r_J+\operatorname{diam}(Y^c)\operatorname{TV}_i. \tag*{(7)}

Consequently, for Gi=2ai(xi−Ti)G_i=2a_i(x_i-T_i) and G~i=2ai(xi−T~i)\widetilde{G}_i=2a_i(x_i-\widetilde{T}_i),

∥G−G~∥F≤2[∑iai2(∑JpiJrJ+diam⁡(Yc)TV⁡i)2]1/2.(8)\lVert G-\widetilde{G}\rVert_F\le2\left[\sum_i a_i^2\left(\sum_Jp_{iJ}r_J+\operatorname{diam}(Y^c)\operatorname{TV}_i\right)^2\right]^{1/2}. \tag*{(8)}

Proof. Insert the intermediate barycentre Tic=∑JpiJyJcT_i^c=\sum_Jp_{iJ}y_J^c. The within-cell term satisfies

∥Ti−Tic∥=∥∑JpiJ(yˉiJ−yJc)∥≤∑JpiJrJ.\lVert T_i-T_i^c\rVert=\left\lVert\sum_Jp_{iJ}(\bar{y}_{iJ}-y_J^c)\right\rVert\le\sum_Jp_{iJ}r_J.

The differences piJ−wiJp_{iJ}-w_{iJ} sum to zero, so their positive and negative parts both have total mass TVi\mathrm{TV}_i. If TVi=0\mathrm{TV}_i=0, the two centroid averages coincide. Otherwise

Tic−T~i=TVi(∑J(piJ−wiJ)+TViyJc−∑J(wiJ−piJ)+TViyJc).T_i^c-\widetilde{T}_i=\mathrm{TV}_i\left(\sum_J\frac{(p_{iJ}-w_{iJ})_+}{\mathrm{TV}_i}y_J^c-\sum_J\frac{(w_{iJ}-p_{iJ})_+}{\mathrm{TV}_i}y_J^c\right).

The two sums in parentheses are convex combinations of the same centroid set and their distance is at most its diameter. This proves ∥Tic−T~i∥≤diam⁡(Yc) TVi\lVert T_i^c-\widetilde{T}_i\rVert\leq\operatorname{diam}(Y^c)\,\mathrm{TV}_i. The first claim follows by another triangle inequality. Multiplying row ii by 2ai2a_i, squaring, and summing proves (8).

The first term of (7) is quantization and the second the difference in conditional weights, which includes coarse solve error. With pij=Pij∗aip_{ij}=\frac{P_{ij}^*}{a_i}, GG is the gradient of the converged balanced OT value.

Proposition 4. Let G=∇L(X)≠0G=\nabla\mathcal{L}(\mathbf{X})\neq0, let H≠0H\neq0 be a supplied direction, and write c=⟨G,H⟩/(∥G∥F∥H∥F)c=\langle G,H\rangle/(\lVert G\rVert_F\lVert H\rVert_F). Suppose the gradient of L\mathcal{L} is β\beta-Lipschitz, with β>0\beta>0, on the segment from X\mathbf{X} to X+=X−ηoptH/∥H∥F\mathbf{X}^+=\mathbf{X}-\eta_{\mathrm{opt}}H/\lVert H\rVert_F. Then

L(X+)≤L(X)−ηopt∥G∥Fc+βηopt22.(9)\mathcal{L}(\mathbf{X}^+)\leq\mathcal{L}(\mathbf{X})-\eta_{\mathrm{opt}}\lVert G\rVert_Fc+\frac{\beta\eta_{\mathrm{opt}}^2}{2}. \tag*{(9)}

If c>0c>0 and 0<ηopt<2∥G∥Fc/β0<\eta_{\mathrm{opt}}<2\lVert G\rVert_Fc/\beta, the objective decreases. A sufficient condition for c>0c>0 is ∥H−G∥F≤δ∥G∥F\lVert H-G\rVert_F\leq\delta\lVert G\rVert_F with 0≤δ<10\leq\delta<1, which implies c≥1−δ2c\geq\sqrt{1-\delta^2}.

Proof. Let v=H/∥H∥Fv=H/\lVert H\rVert_F. The descent lemma for a β\beta-smooth function gives

L(X−ηoptv)≤L(X)−ηopt⟨G,v⟩+βηopt22.\mathcal{L}(\mathbf{X}-\eta_{\mathrm{opt}}v)\leq\mathcal{L}(\mathbf{X})-\eta_{\mathrm{opt}}\langle G,v\rangle+\frac{\beta\eta_{\mathrm{opt}}^2}{2}.

Since ⟨G,v⟩=∥G∥Fc\langle G,v\rangle=\lVert G\rVert_Fc, this is (9), and the stated step-size condition makes its right-hand side strictly smaller than L(X)\mathcal{L}(\mathbf{X}).

For the relative-error claim, set u=G/∥G∥Fu=G/\lVert G\rVert_F, h=H/∥G∥Fh=H/\lVert G\rVert_F, and r=∥h∥F>0r=\lVert h\rVert_F>0. If c=⟨u,h⟩/rc=\langle u,h\rangle/r, then ∥h−u∥F2=r2+1−2rc≤δ2\lVert h-u\rVert_F^2=r^2+1-2rc\leq\delta^2, and therefore

c≥r2+1−δ22r=12(r+1−δ2r)≥1−δ2,c\geq\frac{r^2+1-\delta^2}{2r}=\frac{1}{2}\left(r+\frac{1-\delta^2}{r}\right)\geq\sqrt{1-\delta^2},

where the last step is the arithmetic–geometric mean inequality.

Proof of Theorem 1

Proof. Write the plan at the current potentials, with no convergence assumed, as

Pij(f,g)=aibjexp⁡((fi+gj−Cij)/ε).(10)P_{ij}(\mathbf{f},\mathbf{g})=a_i b_j\exp\left((f_i+g_j-C_{ij})/\varepsilon\right). \tag*{(10)}

Every exponent in the tile is at most mIJm_{IJ}, so Pij≤aibjemIJP_{ij}\leq a_i b_j e^{m_{IJ}} for i∈Ii\in I, j∈Jj\in J, and summing over the opposite block gives

∑j′∈JPij′≤aibJemIJ,∑i′∈IPi′j≤bjaIemIJ.(11)\sum_{j'\in J}P_{ij'}\leq a_i b_J e^{m_{IJ}},\qquad\sum_{i'\in I}P_{i'j}\leq b_j a_I e^{m_{IJ}}. \tag*{(11)}

Since eρIJ=δrel/max⁡(aI,bJ)e^{\rho_{IJ}}=\delta_{\mathrm{rel}}/\max(a_I,b_J) and both block masses are at most max⁡(aI,bJ)\max(a_I,b_J), the hypothesis mIJ≤ρIJm_{IJ}\leq\rho_{IJ} bounds the two right-hand sides by δrelai\delta_{\mathrm{rel}}a_i and δrelbj\delta_{\mathrm{rel}}b_j.

One bound thus serves both directions, because the row bound carries the factor bJ/max⁡(aI,bJ)b_J/\max(a_I,b_J), the column bound carries aI/max⁡(aI,bJ)a_I/\max(a_I,b_J), and one of the two is always 1. The box screen is conservative, because fi≤fI∨f_i\leq f_I^\vee, gj≤gJ∨g_j\leq g_J^\vee and Cij≥dmin⁡2(I,J)C_{ij}\geq d_{\min}^2(I,J) give

mIJ≤(fI∨+gJ∨−dmin⁡2(I,J))/ε,(12)m_{IJ}\leq\left(f_I^\vee+g_J^\vee-d_{\min}^2(I,J)\right)/\varepsilon, \tag*{(12)}

so a pair that fails (5) has mIJ≤ρIJm_{IJ}\leq\rho_{IJ}. Both bounds use only pointwise inequalities at the current potentials and hold at every level of the schedule. The screen depends on the potentials only through fJV+gJVf_J^{\mathrm{V}} + g_J^{\mathrm{V}}, so it is invariant under the shift f↦f+κ0f \mapsto f + \kappa_0, g↦g−κ0g \mapsto g - \kappa_0, which leaves the plan unchanged. A rule built on max⁡(fIV,gJV)\max(f_I^{\mathrm{V}},g_J^{\mathrm{V}}) would give different masks for these equivalent potential pairs.

Non-uniform weights. Every benchmark uses uniform weights, for which ρIJ\rho_{IJ} is the constant log⁡(τ/4)\log(\tau/4) whenever BB divides n=mn=m. We rerun the two problems of Table 4 with the non-uniform weights of FlashSinkhorn’s public benchmark code (Ye et al., 2026), ai∝ui+0.1a_i \propto u_i + 0.1 with uiu_i uniform on [0,1][0,1], and with a rank-−1/2-1/2 power law. FS2 meets τ\tau in all four cases, and the per-point bound of Theorem 1 holds everywhere. Against a scalar rule that uses the largest block mass for every pair, the mass-dependent rule admits 0.3–0.5% fewer block pairs under the first weighting and 2.9–5.3% fewer under the power law, with the same number of fine updates.

Cloudδrel\delta_{\mathrm{rel}} factorAdmittedMax νi\nu_iνi\nu_i over Thm. 1 boundMax error over νidiam⁡(Y)\nu_i \operatorname{diam}(\mathrm{Y})∥TεA−Tε∥\lVert T_{\varepsilon}^{A}-T_{\varepsilon}\rVertGradient rel. ℓ2\ell_2
Clustered16.33%6.7×10−66.7 \times10^{-6}0.0052.7×10−62.7 \times10^{-6}0.481.6×10−71.6 \times10^{-7}
Clustered645.32%3.7×10−43.7 \times10^{-4}0.0051.4×10−41.4 \times10^{-4}0.481.3×10−51.3 \times10^{-5}
Heterog.160.54%2.9×10−52.9 \times10^{-5}0.0232.4×10−62.4 \times10^{-6}0.239.1×10−69.1 \times10^{-6}
Heterog.6449.24%3.0×10−33.0 \times10^{-3}0.0381.7×10−41.7 \times10^{-4}0.231.8×10−31.8 \times10^{-3}

Table 4. Proposition 2 at FS2’s returned potentials, n=m=220n=m=2^{20}, ε=0.001\varepsilon=0.001: largest values over all rows. The νi\nu_i column divides by the Theorem 1 bound MBδrelai/riM_B\delta_{\mathrm{rel}}a_i/r_i, the error column by νidiam⁡(Y)\nu_i\operatorname{diam}(\mathrm{Y}), and the gradient compares 2ai(xi−TεA(xi))2a_i(x_i-T_{\varepsilon}^{A}(x_i)) with 2ai(xi−Tε(xi))2a_i(x_i-T_{\varepsilon}(x_i)).

Proof of Proposition 2

Proof. (i) Write Si=∑jbje(gj−Cij)/εS_i = \sum_j b_j e^{(g_j-C_{ij})/\varepsilon}. The common factor aiefi/εa_i e^{f_i/\varepsilon} cancels from the omitted mass ratio, so the restricted sum is SiA=(1−νi)SiS_i^A = (1-\nu_i)S_i and

fi+,A−fi+=−εlog⁡SiA+εlog⁡Si=−εlog⁡(1−νi).f_i^{+,A}-f_i^+ = -\varepsilon\log S_i^A+\varepsilon\log S_i=-\varepsilon\log(1-\nu_i).

The column update is identical.

(ii) The masked projection TεA(xi)T_\varepsilon^A(x_i) restricts both sums of Tε(xi)=∑jPijyj/∑jPijT_\varepsilon(x_i)=\sum_j P_{ij}y_j/\sum_j P_{ij} to the admitted columns. Subtracting it from the full projection gives the exact identity

Tε(xi)−TεA(xi)=∑J:(I,J)∉A∑j∈JPij(yj−TεA(xi))∑jPij,(13)T_\varepsilon(x_i)-T_\varepsilon^A(x_i)=\frac{\sum_{J:(I,J)\notin A}\sum_{j\in J}P_{ij}\left(y_j-T_\varepsilon^A(x_i)\right)}{\sum_j P_{ij}}, \tag*{(13)}

whose denominator sums over all targets, and the triangle inequality gives

∥TεA(xi)−Tε(xi)∥≤∑J:(I,J)∉A∑j∈JPij∥yj−TεA(xi)∥∑jPij≤νidiam⁡(Y).(14)\left\|T_\varepsilon^A(x_i)-T_\varepsilon(x_i)\right\| \leq\frac{\sum_{J:(I,J)\notin A}\sum_{j\in J}P_{ij}\left\|y_j-T_\varepsilon^A(x_i)\right\|}{\sum_j P_{ij}} \leq\nu_i\operatorname{diam}(Y). \tag*{(14)}

The middle term of Equation (14) keeps the distance of each omitted contribution, so it is much smaller than the diameter bound when the omitted mass lies near the masked projection. The diameter bound is nevertheless sharp. Take two identical one-dimensional clouds, each with BB points at 00 and BB at D>0D>0, uniform weights and one block per location. At the balanced optimum every row sends the fraction νi=(1+eD2/ε)−1\nu_i=(1+e^{D^2/\varepsilon})^{-1} to the opposite location, so when νi≤δrel<1−νi\nu_i\leq\delta_{\mathrm{rel}}<1-\nu_i the admission rule keeps only the two same-location tiles. For xi=0x_i=0, TεA(xi)=0T_\varepsilon^A(x_i)=0 while Tε(xi)=νiDT_\varepsilon(x_i)=\nu_iD. By (ii), the source gradient 2ai(xi−Tε(xi))2a_i(x_i-T_\varepsilon(x_i)) changes by at most 2aiνidiam⁡(Y)2a_i\nu_i\operatorname{diam}(Y) when the masked projection is used.

Measured error. Table 4 evaluates Proposition 2 at the potentials FS2 returns on the clustered and heterogeneous n=m=220n=m=2^{20}, ε=0.001\varepsilon=0.001 problems, with the production δrel\delta_{\mathrm{rel}} and with 64δrel64\delta_{\mathrm{rel}} as a positive control. One FP64 pass over all n×mn\times m pairs splits each row’s mass and first moment into admitted and omitted sums. No row exceeds either bound, and the looser mask raises the largest error 50–70-fold, so the production values are not a floor of the measurement. The block-sparse gradient kernel, run on the production mask, adds its own arithmetic error. Against the FP64 masked gradient it is within 1.0×10−41.0\times10^{-4} (clustered) and 1.0×10−21.0\times10^{-2} (heterogeneous) in relative ℓ2\ell_2 in FP32, far above the masking error of the table.

IO Model (Proposition 5)

The dense FlashSinkhorn kernel moves Θ(nd+md+nmd2/M)\Theta(nd+md+ nmd^2/M) scalars between HBM and fast memory of size MM (Ye et al., 2026). For the sparse traversal of Algorithm 3, the count is governed by neighbour-record misses.

Proposition 5. *Let a neighbour block record occupy σ=Θ(B(d+1))\sigma=\Theta(B(d+1)) scalars. Suppose one source block’s queries and accumulators stay resident in fast memory of size M≥c0σM\geq c_0\sigma for a fixed constant c0c_0, costs are computed online, CSR indices are read once per traversal, and caches are cold at the start of each half-step. If LfL_f and LgL_g count neighbour-record misses along the CSR and its transpose, one iteration evaluating both directions moves

Qiter=Θ((n+m)(d+1)+∣A∣+σ[Lf+Lg])(15)Q_{\mathrm{iter}}=\Theta((n+m)(d+1)+|\mathcal{A}|+\sigma[L_f+L_g]) \tag*{(15)}

scalars between slow and fast memory. Each miss count lies between the number of active neighbour blocks in its traversal and ∣A∣|\mathcal{A}|.

Proof. We count the f^\hat{f} half-step, and the g^\hat{g} half-step is the same count on the transposed index. Each of the NBN_B source blocks moves its queries XI\mathrm{X}_I and writes back f^I\hat{f}_I once, Θ(B(d+1))\Theta(B(d+1)) scalars, because both stay resident for the whole row. Over both directions this is Θ((n+m)(d+1))\Theta((n+m)(d+1)). The traversal reads crow once and each entry of col once, Θ(NB+∣A∣)\Theta(N_B+|\mathcal{A}|) scalars, and NB≤nN_B\le n is absorbed by the first term. An empty row reads no neighbour record. Its repair is a dense reduction, counted with the dense updates in Equation (19). Visiting an admitted pair needs YJ\mathrm{Y}_J, g^J\hat{g}_J and δJ\delta_J, σ=Θ(B(d+1))\sigma=\Theta(B(d+1)) scalars, and moves nothing when the record is already resident. The LfL_f visits that miss contribute Θ(σLf)\Theta(\sigma L_f). Summing gives Equation (15). Each half-step starts cold, so every active neighbour block misses at least once. At most one miss is charged per admitted pair, so LfL_f lies between the number of active neighbour blocks and ∣A∣|\mathcal{A}|, and so does LgL_g.

On-chip memory is private to each program, and within one row the CSR entries are distinct, so a neighbour record can be reused across source blocks only through L2. The upper end, one gather per admitted pair, is therefore the bound that always holds. Unlike the dense case, enlarging MM does not reduce it, because the admitted columns of a row form an arbitrary subset.

Implementation Details

Block Size and Coarse Cells

The automatic policy chooses the block size from B∈{64,128,256}B\in\{64,128,256\} by estimating the memory of the block summaries. Each summary holds a bounding box, a potential maximum and a log block mass, 32 bytes for d=3d=3, so the summaries of both clouds take 32(NB+MB)32(N_B+M_B) bytes, with NB=⌈n/B⌉N_B=\lceil n/B\rceil and MB=⌈m/B⌉M_B=\lceil m/B\rceil. The chosen BB keeps this estimate within 0.8CL20.8C_{\mathrm{L2}}, where CL2C_{\mathrm{L2}} is the physical L2 cache size, so the budget forces larger blocks on larger clouds.

For each t∈{0,…,62}t\in\{0,\ldots,62\}, we count the occupied prefixes of the sorted 63-bit Morton keys. Smaller tt gives a finer partition. We choose the smallest tt satisfying

Kx≤2NB,Ky≤2MB,112(Kx+Ky)≤0.8CL2,16max⁡(Kx,Ky,BNB,BMB)≤231−1.(16)\begin{aligned} K_x&\le2N_B,\qquad K_y\le2M_B,\qquad112(K_x+K_y)\le0.8C_{\mathrm{L2}},\\ 16\max(K_x,K_y,BN_B,BM_B)&\le2^{31}-1. \tag*{(16)} \end{aligned}

The first two conditions limit the coarse point count relative to the execution blocks. The third limits estimated storage for coarse arrays, and the fourth checks signed 32-bit offsets for coordinates padded to width 16. The fourth errs by one on the safe side, so it excludes n=227n=2^{27}, whose largest offset 16n−1=231−116n-1=2^{31}-1 still fits. Cell counts come from the sorted keys, without solving a coarse problem for each tt. The budget constants are empirical. They make the cells and blocks as fine as memory allows, which raises memory traffic.

Forward Solver and Stopping Rules

Sampled check. In exact arithmetic (P1)i/ai=exp⁡((fi−fi+)/ε)(\mathbf{P}\mathbf{1})_i/a_i = \exp((f_i-f_i^+)/\varepsilon), where fi+f_i^+ is the unrestricted row update, so for potentials fixed independently of the sample, drawing ii with probability aia_i gives

Ei∼a∣exp⁡((fi−fi+)/ε)−1∣=∑iai∣(P1)i/ai−1∣=∥P1−a∥1,(17)\mathbb{E}_{i\sim a}\left|\exp((f_i-f_i^+)/\varepsilon)-1\right|=\sum_i a_i\left|(\mathbf{P}\mathbf{1})_i/a_i-1\right|=\|\mathbf{P}\mathbf{1}-a\|_1, \tag*{(17)}

and columns drawn with j∼bj\sim b estimate ∥PT1−b∥1\|\mathbf{P}^{\mathsf{T}}\mathbf{1}-b\|_1 in the same way. The check draws 1024 indices per side with seed 0, reduces each sampled marginal over all opposite points, and bounds each residual by its sample mean plus three standard errors. It passes when the larger bound is below τ\tau and fails when a mean minus three standard errors exceeds τ\tau. Otherwise it evaluates 8192 further indices and passes only if their bound is below τ\tau. No sample size gives a distribution-free guarantee on a mean ([4]). With uniform weights, SS draws miss a given row with probability (1−1/n)S(1-1/n)^S, and the solver draws the indices once per solve and reuses them at every check, so the potentials at the stopping check depend on the sample, whereas Equation (17) assumes they do not. The check can therefore accept potentials whose full residual exceeds τ\tau, and every reported residual comes from a full evaluation, except at two intermediate Quijote sizes. Section C.4 measures how often the check accepts such potentials on the grid.

Coarse stage. The coarse solve anneals on the Morton-prefix cells of § 3 with GeomLoss’s ε\varepsilon-scaling schedule, from the diagonal of the joint bounding box down to the blur ε\sqrt{\varepsilon} with scaling 0.95 and averaged updates, and lifts when it first reaches the requested ε\varepsilon. If the sampled check rejects the lift, the solver completes the 64-entry target-ε\varepsilon tail, lifts and checks again, and then continues in batches of 64 coarse updates. After each batch it evaluates, from the shifted coarse potentials before and after the last averaged update,

Dc=2εmax⁡{∑IaI∣f^Ic+−f^Ic∣,∑JbJ∣g^Jc+−g^Jc∣},(18)D_c=\frac{2}{\varepsilon}\max\left\{\sum_I a_I\left|\hat{f}_I^{c+}-\hat{f}_I^c\right|,\sum_J b_J\left|\hat{g}_J^{c+}-\hat{g}_J^c\right|\right\}, \tag*{(18)}

accumulated in FP64. In exact arithmetic DcD_c is the larger of the two mass-weighted coarse log-marginal errors before that update. These are means, whereas λc\lambda_c in Proposition 1 is a maximum over target cells, so the stop does not bound the first term of Equation (3). Extra coarse work stops after two consecutive batches with Dc≤τ/2D_c\leq\tau/2, three consecutive relative improvements below 1%, or 2048 extra updates. A non-finite DcD_c discards the extra batches. The refined state is lifted and checked.

Fine stage. The lifted pair initializes the fine updates without another annealing schedule. The two symmetric half-steps start from the same incoming potentials, so one mask, rebuilt before every fine update, serves both. The first two ordinary updates are checked one by one. Afterwards the check interval is the smallest of 1, 2, 4, 8 and 16 updates whose combined time is at least ten times that of a check, and 1 once the 1024-index bound is at most 2τ2\tau, with further checks at every 16th update and at the cap. A terminal preview is a complete fine update with its own mask that forms unaveraged potentials from the same incoming pair. It runs after the re-lift that ends the coarse continuation, after the second ordinary update, at every 16th ordinary update once the 1024-index bound is at most 2τ2\tau, and at the cap. A rejected preview does not enter the ordinary trajectory, and the fine-update counts of § 4.1 include previews.

Return. The solver returns as soon as a sampled check passes. At the fine-update cap, 128 ordinary updates unless stated otherwise, it returns the checked potentials with the best finite sample score and reports the tolerance as not confirmed. If no score is finite, it returns the retained lift.

Mask Construction and Sparse Half-Steps

Algorithm 2 builds the candidates of the box screen Equation (5) in CSR form, and verification then evaluates mIJm_{IJ} on each candidate tile. Algorithm 3 gives the sparse f^\hat{f} half-step over the admitted blocks, and the g^\hat{g} half-step runs the same kernel on the transposed index.

All forward solves form the dot products on TF32 tensor cores with FP32 accumulation, keep the potentials in FP32, and add the bias (g^j+εlog⁡bj)/ε(\hat{g}_j+\varepsilon\log b_j)/\varepsilon in FP32 after the dot product. Folding the bias into the dot as an extra coordinate would round an O(1/ε)O(1/\varepsilon) operand to TF32, an absolute logit error of about 5 at ε=10−4\varepsilon=10^{-4}.

Algorithm 2 BUILDMASK: (5) as two Triton passes over block rows, one counting and one writing. Both scan the full NB×MBN_B \times M_B grid with the predicate in registers. Each tile test costs about 6d+36d + 3 operations, about 0.010 per point pair at d=3d = 3 and B=64B = 64.

Require: boxes [xloI,xhiI][x_{\mathrm{lo}}^I, x_{\mathrm{hi}}^I], [yloJ,yhiJ][y_{\mathrm{lo}}^J, y_{\mathrm{hi}}^J], block maxima fIf^I, gJg^J, log masses log⁡a\log a, log⁡b\log b, ε\varepsilon, δrel\delta_{\mathrm{rel}}

Ensure: CSR arrays crow, col

  1. for each block row II in parallel do

  2. cI←0c_I \leftarrow0 // pass 1: count

  3. for each tile JJ of column blocks do

  4. W←max⁡(xloI−yhiJ,yloJ−xhiI,0)W \leftarrow\max(x_{\mathrm{lo}}^I-y_{\mathrm{hi}}^J, y_{\mathrm{lo}}^J-x_{\mathrm{hi}}^I, 0) // per-axis box separation

  5. dmin⁡2←rowsum⁡(W⊙W)d_{\min}^2 \leftarrow\operatorname{rowsum}(W \odot W) // lower-bounds every pair in the tile

  6. keep⁡←[dmin⁡2<fIV+gJV−ερIJ]\operatorname{keep} \leftarrow[d_{\min}^2 < f_I^V + g_J^V - \varepsilon\rho_{IJ}] // (5), log⁡aI\log a_I is hoisted

  7. cI←cI+sum⁡(keep⁡)c_I \leftarrow c_I + \operatorname{sum}(\operatorname{keep})

  8. end for

  9. write cIc_I to HBM

  10. end for

  11. crow⁡←ExclusiveScan⁡(c)\operatorname{crow} \leftarrow\operatorname{ExclusiveScan}(c) // offsets exist before any row writes

  12. if crow⁡[NB]\operatorname{crow}[N_B] exceeds the index type then raise // refuse rather than wrap silently

  13. for each block row II in parallel do

  14. base⁡←crow⁡[I]\operatorname{base} \leftarrow\operatorname{crow}[I], w←0w \leftarrow0 // pass 2: fill

  15. for each tile JJ of column blocks do

  16. recompute keep in registers // cheaper than storing a dense Boolean mask

  17. pos⁡←ExclusiveScan⁡(keep⁡)\operatorname{pos} \leftarrow\operatorname{ExclusiveScan}(\operatorname{keep}) // slot inside this tile

  18. col⁡[base⁡+w+pos⁡]←J\operatorname{col}[\operatorname{base} + w + \operatorname{pos}] \leftarrow J where keep // one program per row, so ascending

  19. w←w+sum⁡(keep⁡)w \leftarrow w + \operatorname{sum}(\operatorname{keep})

  20. end for

  21. end for

Algorithm 3 SPARSELSE: the streaming f^\hat{f}-update over the admitted blocks. The online max/sum-exp recurrence is FlashSinkhorn’s, run here over a CSR row rather than over every column block. The cost is never formed either way.

Require: X∈Rn×dX \in\mathbb{R}^{n \times d}, Y∈Rm×dY \in\mathbb{R}^{m \times d}, g^∈Rm\hat{g} \in\mathbb{R}^{m}, b∈Δmb \in\Delta^m, CSR (crow, col), ε\varepsilon

Ensure: f^∈Rn\hat{f} \in\mathbb{R}^{n}

  1. δ←εlog⁡b\delta\leftarrow\varepsilon\log b // precompute the weight bias

  2. for each block row II of size BB do

  3. load XIX_I to SRAM, mI←−∞m_I \leftarrow-\infty, sI←0s_I \leftarrow0 // running max and sum-exp

  4. r0←crow⁡[I]r_0 \leftarrow\operatorname{crow}[I], nnz⁡I←crow⁡[I+1]−r0\operatorname{nnz}_I \leftarrow\operatorname{crow}[I+1] - r_0

  5. for t=0,…,nnz⁡I−1t = 0, \ldots, \operatorname{nnz}_I - 1 do

  6. J←col⁡[r0+t]J \leftarrow\operatorname{col}[r_0 + t], load YJY_J, g^J\hat{g}_J, δJ\delta_J to SRAM // admitted blocks only

  7. Z←(2XIYJ⊤+g^J+δJ)/εZ \leftarrow(2X_IY_J^\top+ \hat{g}_J + \delta_J)/\varepsilon // one kernel tile, the cost is never formed

  8. mnew←max⁡(mI,rowmax⁡(Z))m_{\mathrm{new}} \leftarrow\max(m_I, \operatorname{rowmax}(Z))

  9. sI←emI−mnew⊙sI+rowsum⁡(eZ−mnew)s_I \leftarrow e^{m_I-m_{\mathrm{new}}} \odot s_I + \operatorname{rowsum}(e^{Z-m_{\mathrm{new}}}), mI←mnewm_I \leftarrow m_{\mathrm{new}}

  10. end for

  11. f^I←−ε(mI+log⁡sI)\hat{f}_I \leftarrow-\varepsilon(m_I + \log s_I), write to HBM // −εLSE⁡row-\varepsilon\operatorname{LSE}_{\mathrm{row}} over the admitted blocks

  12. end for

Operation Count

Let ScS_c count all coarse updates, including annealing and additional iterations at the requested ε\varepsilon, and let LliftL_{\mathrm{lift}} count paired lifts. Each contributes respectively O(KxKyd)O(K_xK_yd) and O((nKy+mKx)d)O((nK_y + mK_x)d) operations. For sampled checks, define Qcheck=∑ℓ(mSx,ℓ+nSy,ℓ)Q_{\mathrm{check}} = \sum_{\ell}(mS_{x,\ell} + nS_{y,\ell}), where Sx,ℓS_{x,\ell}, Sy,ℓS_{y,\ell} are the actual sample sizes in check ℓ\ell. Both stages of an enlarged check contribute to this sum.

For fine update kk, let CkC_k be the bounding-box candidates and AkA_k the verified tiles. Computing potential maxima and scanning block pairs costs O(n+m+NBMBd)O(n + m + N_BM_Bd). Verification and the two sparse half-steps cost O(B2d(∣Ck∣+2∣Ak∣))O(B^2d(|C_k| + 2|A_k|)). Writing and transposing the indices adds O(NB+MB+Eklog⁡(2+Ek))O(N_B + M_B + E_k\log(2 + E_k)) as a conservative bound including sorting, where Ek=∣Ck∣+∣Ak∣E_k = |C_k| + |A_k|. Let QdenseQ_{\mathrm{dense}} count point pairs evaluated by dense updates and empty-row repairs. The complete arithmetic and index work is bounded by

O((n+m)log⁡(n+m)+(n+m)d+d{SCKxKy+Llift(nKy+mKx)+Qcheck+Qdense}+∑k{n+m+NBMBd+B2d(∣Ck∣+2∣Ak∣)+Eklog⁡(2+Ek)})(19)\mathcal{O}\left((n+m)\log(n+m)+(n+m)d +d\{S_CK_xK_y+L_{\mathrm{lift}}(nK_y+mK_x)+Q_{\mathrm{check}}+Q_{\mathrm{dense}}\} +\sum_k\{n+m+N_BM_Bd+B^2d(|C_k|+2|A_k|)+E_k\log(2+E_k)\}\right) \tag*{(19)}

The sum runs over ordinary updates and terminal previews, rejected ones included, and each dense update adds nmnm evaluations to QdenseQ_{\mathrm{dense}}. No score matrix is stored. Beyond the point and coarse arrays, memory holds the candidate and admitted CSR indices, and an index with zz nonzeros is allocated only if it fits signed 32-bit offsets and 24z+8(NB+MB+2)≤0.8Mfree24z+8(N_B+M_B+2)\leq0.8M_{\mathrm{free}} bytes, with MfreeM_{\mathrm{free}} the free GPU memory. The selector’s limits give KxKy≤4NBMBK_xK_y\leq4N_BM_B and nKy+mKx≤2(nMB+mNB)nK_y+mK_x\leq2(nM_B+mN_B). Both remain quadratic in nn at fixed BB.

Synthetic Benchmarks

After the setup and the GeomLoss baseline, the subsections follow the paragraphs of § 4.1 in order, each with its own protocol.

Setup

Unless stated otherwise, every run uses one A100 with PyTorch 2.8.0+cu128, Triton 3.4.0, GeomLoss 0.3.1 and PyKeOps 2.3. The kernel profiles of Section C.6 use a separate A100. Inputs are three-dimensional with uniform weights and seed zero, and all methods receive the same centered, TF32-rounded coordinates and the full squared-Euclidean cost, without a factor of 1/21/2, so GeomLoss’s default blur of 0.05 is the grid point ε=0.005\varepsilon=0.005. Times are warmed complete calls, from preparation and parameter selection to return, and exclude input loading, compilation and validation. Grid endpoints are single calls, and comparisons and ablations report medians of three. Accuracy is the full residual RR of the returned potentials (§ 4), evaluated on all points, against τ=0.005\tau=0.005. Peak memory is the largest PyTorch allocation, inputs included, in a separate warmed call.

Methods compared.

  • FS2: the automatic policy of Section B, which chooses B=128B=128 over 64 on every problem and, for n=219,…,223n=2^{19},\ldots,2^{23}, the cell levels t=46t=46, 45, 44, 43 and 42 on clustered and 43, 42, 41, 40 and 39 on heterogeneous clouds.

  • GeomLoss multiscale: its native multiscale solver with scaling 0.9, default cluster scale and truncation 5, with KeOps for the fine reductions.

  • FlashSinkhorn: its native dense solver with scaling 0.9.

Neither baseline gets added refinement or a residual-based stopping rule.

Data. A clustered cloud draws 32 centers uniformly in [0,1]3[0,1]^3 and places each point at a uniformly chosen center plus isotropic Gaussian noise of standard deviation 0.02. Source and target draw their centers independently. A heterogeneous cloud mixes three components: 80% of the points in a compact Gaussian at (−0.35,−0.15,0)(-0.35,-0.15,0) with standard deviations (0.04,0.025,0.02)(0.04,0.025,0.02), 19% in a thin needle at (0.35,0.10,0)(0.35,0.10,0) with standard deviations (0.20,0.008,0.008)(0.20,0.008,0.008), rotated by 0.6 rad about the zz-axis, and 1% uniform background in [−0.9,0.9]3[-0.9,0.9]^3. The target shifts the two Gaussian centers by (0.025,−0.01,0.008)(0.025,-0.01,0.008) and (−0.018,0.018,−0.006)(-0.018,0.018,-0.006) and is drawn independently.

GeomLoss Multiscale Workflow

The evaluated GeomLoss 0.3.1 point-cloud backend ([13, 12]) uses two resolutions, the weighted centroids of cells of side ℓcell\ell_{\mathrm{cell}} and the original points. It follows a decreasing schedule ε1≥⋯≥εNε\varepsilon_1\geq\cdots\geq\varepsilon_{N_\varepsilon} on the centroids, switches to the points just before the first level whose blur falls below ℓcell\ell_{\mathrm{cell}}, and lifts the potentials there by an LSE against the coarse records. If the schedule never reaches such a blur, or reaches it only at its last level, GeomLoss lifts its final coarse potentials and takes no fine update. Otherwise it builds the mask of § 2.2 once, at the last coarse level p⋆p^\star,

AGL={(I,J):C(xIc,yJc)<fIc+gJc+5εp⋆},(20)A^{\mathrm{GL}} = \{(I,J) : C(x_I^{c},y_J^{c}) < f_I^{c} + g_J^{c} + 5\varepsilon_{p^\star}\}, \tag*{(20)}

and reuses the resulting KeOps index ranges [7] for every fine update.

Omitted mass. One FP64 pass over all pairs of the two problems of Table 4 measures the plan mass each mask omits. At FS2’s returned potentials on clustered data, the GeomLoss mask, built at its switch to the points, omits more than half the plan mass of 964 of the 2202^{20} rows and nearly all of it in 12, while FS2’s mask omits at most 6.7×10−66.7 \times10^{-6} of any row and keeps half as many point pairs. This difference includes the stage at which GeomLoss builds its mask, not only its criterion. At GeomLoss’s own returned potentials its mask omits 9.8×10−69.8 \times10^{-6} of the mass, 0.02%0.02\% of its residual of 0.0540.054, so that residual is not mainly omitted mass. On heterogeneous data GeomLoss’s mask omits at most 7×10−187 \times10^{-18} of any row, and FS2’s at most 2.9×10−52.9 \times10^{-5}.

Speed

The grid covers clustered and heterogeneous clouds with a size sweep over n=m∈{219,…,223}n=m\in\{2^{19},\ldots,2^{23}\} at ε∈{0.001,0.01}\varepsilon\in\{0.001,0.01\} and a regularization sweep over ε∈{0.001,0.002,0.005,0.01,0.02}\varepsilon\in\{0.001,0.002,0.005,0.01,0.02\} at n=m∈{221,222}n=m\in\{2^{21},2^{22}\}. Eight problems are shared, which leaves 32 inputs (Table 5). Figure 2(a–Figure 2d) shows the size sweep and the n=222n=2^{22} regularization sweep, 26 problems. FS2 runs its automatic policy (Sections B.1 and B.2) with one fixed kernel calibration and no per-problem tuning.

n=mn=mε\varepsilonFS2 time (s)FS2 RRGL time (s)GL RR
Clustered
2192^{19}0.0015.6380.0048791.5210.054122†
2192^{19}0.010.2900.0029180.0260.072730†
2202^{20}0.0014.1760.0047915.5000.053802†
2202^{20}0.010.2750.0032450.0270.071918†
2212^{21}0.00115.5930.00482821.4480.054161†
2212^{21}0.0025.3800.00409414.3050.055280†
2212^{21}0.0052.3180.0031987.1670.056265†
2212^{21}0.010.8120.0026730.0310.073064†
2212^{21}0.020.6460.0010660.0290.046715†
2222^{22}0.00120.2890.00463985.4840.053612†
2222^{22}0.0029.8430.00487156.8680.054748†
2222^{22}0.0053.6760.00412928.4550.055743†
2222^{22}0.012.8250.0019890.0370.070512†
2222^{22}0.022.2480.0008100.0370.046228†
2232^{23}0.00145.4050.004694346.0510.054192†
2232^{23}0.019.9140.0012760.0520.071911†
Heterogeneous
2192^{19}0.0010.9290.00360510.5470.012514†
2192^{19}0.010.0450.0019443.3140.002151
2202^{20}0.0011.8240.00434239.6280.013687†
2202^{20}0.010.1060.00097014.8860.000886
2212^{21}0.0017.0600.003875154.1220.013793†
2212^{21}0.0020.3020.001911125.2130.007890†
2212^{21}0.0050.2850.00096286.6840.002550
2212^{21}0.010.2720.00094957.8200.000841
2212^{21}0.020.2610.00054819.3000.001679
2222^{22}0.0011.0960.003059612.4150.013734†
2222^{22}0.0021.0530.001056497.3910.007850†
2222^{22}0.0050.9920.000644344.3340.002531
2222^{22}0.010.9470.000880229.5730.000846
2222^{22}0.020.9080.00053176.5660.001682
2232^{23}0.0014.0260.0016242595.4170.003906
2232^{23}0.013.4840.000885915.9750.000883

Table 5. The 32-problem forward grid. A dagger marks R>0.005R > 0.005. FS2 meets the target on all 32 problems and GeomLoss on 10, all heterogeneous. Each entry is one call. Table 1a and Table 6 remeasure clustered 2212^{21}, ε=0.001\varepsilon= 0.001 as medians of three calls.

Trajectories. In Figure 2(f), FS2’s potentials are lifted every 64 coarse updates and taken after every fine update, and each is placed at the time in the solve at which it is available, its own lift included.

GeomLoss settings. The grid runs GeomLoss at scaling 0.9 with its default cluster scale and truncation 5. Table 6 varies the scaling and the cluster scale on two n=m=221n=m=2^{21} problems. The matched cluster scale gives GeomLoss FS2’s cell count, taken from FS2’s record and not charged to GeomLoss, and at this scale GeomLoss’s schedule stays on the centroids and ends with a lift. On clustered data at ε=0.001\varepsilon=0.001 none of the six settings meets τ\tau. The best, scaling 0.99 at the default cluster scale, returns 0.0069 after 200 s, 13 times FS2’s time. FS2’s own coarse stage also misses τ\tau there, so the target needs fine updates, and GeomLoss’s fine stage in these settings does not reach it. On heterogeneous data at ε=0.01\varepsilon=0.01 all six settings meet τ\tau. At the default cluster scale GeomLoss takes 57.8 s, 212 times FS2, while with FS2’s cell count its coarse exit takes 0.39 s, 1.4 times FS2. The two scaling-0.9 runs differ only in the cluster scale, so on this problem the gap under the default setting comes from the cluster scale.

SolverCellsClustered, ε=0.001\varepsilon=0.001 Time (s)Clustered, ε=0.001\varepsilon=0.001 RRHeterogeneous, ε=0.01\varepsilon=0.01 Time (s)Heterogeneous, ε=0.01\varepsilon=0.01 RR
FS2auto15.37.004830.273.00095
GL, scaling .90default21.46.054257.80.00084
GL, scaling .95default39.48.031086.59.00094
GL, scaling .99default200.38.00687404.03.00020
GL, scaling .90matched0.361.05970.391.00076
GL, scaling .95matched0.548.03730.567.00083
GL, scaling .99matched2.023.01712.012.00036

Table 6. GeomLoss settings on two n=m=221n=m=2^{21} problems, truncation 5, rerun with FS2 in the same session. Bold marks solves that meet τ=0.005\tau=0.005. Default is GeomLoss’s cluster scale (430 and 2033 source cells), and matched gives as many source cells as FS2’s coarse stage, to within one (23,799 against 23,800, and 28,332). FS2 and matched times are medians of three calls, the others single calls. RR is the full two-sided residual.

GeomLoss continued at the target ε\varepsilon. The grid gives GeomLoss no residual-based stopping rule, so here we give it one that favours it. We append KK copies of the target ε\varepsilon to its native schedule and stop at K⋆K^\star, found by scoring K=0,1,2,4,…,2048K=0,1,2,4,\ldots,2048 and bisecting the first bracket that meets τ\tau. This oracle stop charges GeomLoss for no residual test, whereas FS2’s times include its sampled checks. On clustered ε=0.001\varepsilon=0.001, scaling 0.99 at the default cluster scale reaches τ\tau after 118 extra entries in 421 s, 27.3 times FS2’s 15.4 s (Table 7), and the grid’s setting reaches it at none of the scored KK. At ε=0.01\varepsilon=0.01 the matched setting reaches τ\tau in 1.13 s, 1.38 times FS2, while both default-cell settings level off at 0.037. Both results are specific to these two problems.

ProblemGL settingK=0K=0 RRK∗K^*Continued at the target ε\varepsilon Time (s)Continued at the target ε\varepsilon RR
ε=0.001\varepsilon=0.001.90, default.0542––.0203 at K=512K=512
.99, default.00687118421.10.004997
.90, matched.0597––.0160 at K=2048K=2048
ε=0.01\varepsilon=0.01.90, default.0731––.0372 at K=512K=512
.99, default.0373––.0372 at K=512K=512
.90, matched.05911831.13.004976

Table 7. GeomLoss continued at the target ε\varepsilon on clustered n=m=221n=m=2^{21}, truncation 5, on the GPU of Table 6. K∗K^* is the smallest number KK of appended target-ε\varepsilon entries whose full residual meets τ=0.005\tau=0.005. Time is the median of three clean calls at K∗K^*, which at ε=0.001\varepsilon=0.001 are the GL+ calls of Table 1a. Bold marks solves that meet τ\tau. Without a K∗K^*, the last column gives the lowest scored residual. FS2 takes 15.44 s with R=0.00483R=0.00483 at ε=0.001\varepsilon=0.001 (Table 1a) and, in the run of this table, 0.817 s with R=0.00267R=0.00267 at ε=0.01\varepsilon=0.01.

Residual Certificate and Sampled Check

Certificate. The solver as run stops on its sampled check, and the certificate is computed afterwards. At each evaluated return we build the mask by the production rule at the returned pair and compute RAR_A with the solver’s sparse kernel. We evaluated the clustered returns up to n=222n=2^{22} at ε=0.001\varepsilon=0.001 and up to 2212^{21} at the other regularizations, the heterogeneous returns at ε=0.001\varepsilon=0.001 up to 2212^{21}, and both 2272^{27} Quijote solutions, but not the other grid returns. All 15 are certified (Table 8). On the grid, Ω\Omega is at most 1%1\% of τ\tau and RAR_A agrees with the recorded full residual to within 1.2×10−61.2 \times10^{-6}, at the cost of one mask build and one sparse update. The heterogeneous returns take the dense update, so their certificate is the full residual. At 2272^{27}, Ω\Omega is below 10−710^{-7}, so FP32 arithmetic rather than the mask sets the certificate, which gives 0.009108 at τ=0.01\tau=0.01 against a recorded full residual of 0.009154. Both are FP32 estimates, and the FP64 correction of Section D.3 gives 0.00882 and 0.00869 for rows and columns. The certificate takes minutes on one A100, where the full evaluation takes some 38 hours.

Problemnnε\varepsilonτ\tauMaskRRRAR_AΩ\OmegaRA+ΩR_A+\Omega
Clustered2192^{19}0.0010.005sparse0.0048790.0048794.7×10−64.7\times10^{-6}0.004884
Clustered2192^{19}0.010.005sparse0.0029180.0029182.7×10−52.7\times10^{-5}0.002945
Clustered2202^{20}0.0010.005sparse0.0047910.0047914.7×10−64.7\times10^{-6}0.004796
Clustered2202^{20}0.010.005sparse0.0032450.0032462.5×10−52.5\times10^{-5}0.003271
Clustered2212^{21}0.0010.005sparse0.0048280.0048284.8×10−64.8\times10^{-6}0.004833
Clustered2212^{21}0.0020.005sparse0.0040940.0040947.5×10−67.5\times10^{-6}0.004101
Clustered2212^{21}0.0050.005sparse0.0031980.0031981.4×10−51.4\times10^{-5}0.003211
Clustered2212^{21}0.010.005sparse0.0026730.0026742.3×10−52.3\times10^{-5}0.002697
Clustered2212^{21}0.020.005sparse0.0010660.0010674.9×10−54.9\times10^{-5}0.001115
Clustered2222^{22}0.0010.005sparse0.0046390.0046394.8×10−64.8\times10^{-6}0.004644
Heterog.2192^{19}0.0010.005dense0.0036050.00360500.003605
Heterog.2202^{20}0.0010.005dense0.0043420.00434200.004342
Heterog.2212^{21}0.0010.005dense0.0038750.00387500.003875
Quijote2272^{27}3.810.01sparse0.0091540.0091081.1×10−81.1\times10^{-8}0.009108
Quijote2272^{27}3.810.05sparse0.0489650.0489535.4×10−85.4\times10^{-8}0.048953

Table 8. The certificate RA+ΩR_A+\Omega of § 3.2 at returned potentials, with RAR_A the larger of the row and column residuals of PAP^A in IEEE FP32 and Ω\Omega the tile-sum bound on the omitted mass in FP64. Where the mask would admit more than half of the tiles (dense), the update is dense, Ω=0\Omega=0 and RAR_A is the full residual. RR is the recorded full residual, and bold certifies R≤τR\le\tau.

Sampled check. Of the 40 reported returns with a full residual, none exceeds τ\tau, and the largest is 0.98τ0.98\tau. We re-solved the seven grid problems closest to τ\tau, clustered ε=0.001\varepsilon= 0.001 at n=219n = 2^{19}, 2202^{20} and 2212^{21}, clustered 2212^{21} at ε=0.002\varepsilon= 0.002, and heterogeneous ε=0.001\varepsilon= 0.001 at 2192^{19}, 2202^{20} and 2212^{21}, with the check’s index seeds set to (s,159015+s)(s, 159015 + s) for s=1,…,20s = 1,\ldots,20. All 140 solves returned confirmed pairs, and none has a full residual above τ\tau, which bounds the rate of false acceptance at 2.6% (Clopper–Pearson, 95%), or at 6.0% over the 60 solves on the three problems whose stopping update moved with the seed. At the accepting check, (R−mean⁡)/SE⁡(R - \operatorname{mean})/\operatorname{SE} over the 280 sides has mean 0.03 and standard deviation 1.01, so reusing one sample across checks leaves no detectable bias at the stop.

Concentrated error. On the accepted pair of heterogeneous 2202^{20} at ε=0.01\varepsilon= 0.01 (R=0.19τR = 0.19\tau), we shift ff on a random 0.01%, 0.1% or 1% of the rows so that the row residual becomes 1.2τ1.2\tau or 2τ2\tau, and run the check with 1000 index seeds per setting. The row side alone accepts 95.8%, 38.0–38.9% and 0.1–0.6% of the seeds, close to the rates predicted from the exact per-row values. The production check also tests the columns, whose residual the shift raises to 1.15–1.96τ\tau, and accepted none of the 6000 perturbed states. These measurements do not extend to n≥222n \ge2^{22}, to other ε\varepsilon, to non-uniform weights or to the Quijote blur.

Ablations

The ablations use clustered and heterogeneous clouds with n=m=220n=m=2^{20} at ε∈{0.001,0.01}\varepsilon\in\{0.001, 0.01\}, and pair each control with an FS2 reference measured in the same run on the same GPU. Each of three controls removes one component. No coarse stage anneals on the points instead of the centroids, with no lift and no coarse continuation. Dense fine keeps the coarse stage and replaces every fine update by a dense streaming update. Box only keeps the box screen and sparse execution but skips tile verification.

Table 9: Component ablations. C and H denote clustered and heterogeneous inputs, followed by ε\varepsilon. The ratio (control/FS2) is given for active controls that meet the target.

CaseControlFS2 (s)Control (s)Full RRRatioState
C, 0.001No coarse stage4.165153.3300.02135–misses target
Dense fine4.16533.3270.004798.001qualified
Box only4.1674.3350.004791.040qualified
C, 0.01No coarse stage0.275183.1320.00477664.818qualified
Dense fine0.2760.2750.00325–inactive
Box only0.2760.2750.00325–inactive
H, 0.001No coarse stage1.825281.1330.00039154.023qualified
Dense fine1.8242.4230.004341.328qualified
Box only1.8241.5760.004340.864qualified
H, 0.01No coarse stage0.089145.5990.003181643.418qualified
Dense fine0.0890.0890.00097–inactive
Box only0.0890.1070.00097–inactive

Table 9.

Coarse stage. Removing the coarse stage slows the solve by 154–1643×\times on the three problems where both arms meet the target (Table 9). On clustered ε=0.001\varepsilon=0.001 the control stops at the 128-update fine cap with R=0.02135R=0.02135. A shorter coarse continuation has the same effect on a smaller scale (Table 10a): after 64 or 256 extra coarse updates the solve misses τ\tau within the fine cap, and with the cap raised to 8192 it needs 1305 or 1115 fine updates, 51.6–60.0×\times the FS2 time.

Extra coarseFine capFine updatesTime (s)RRRatio
2048 (native)12813 + 24.1690.004791
64128128 + 324.3550.01896–
256128128 + 324.8170.01421–
6481921267 + 38250.2350.0047860.0
25681921077 + 38215.6740.0047751.6

Table 10. (a) Extra coarse updates, clustered

Table 10: Coarse-continuation and threshold controls at n=m=220n=m=2^{20}, ε=0.001\varepsilon=0.001. Fine updates count ordinary updates plus terminal previews. (a) Clustered, with the number of extra coarse updates fixed. Ratios divide by the FS2 reference of the same run. (b) Every threshold control meets the target.

FactorClusteredHeterogeneous
10−210^{-2}1.0801.039
10−110^{-1}1.0681.027
10110^{1}0.9650.945
10210^{2}0.9081.530

Table 10b. (b) δrel\delta_{\mathrm{rel}} scaled by a factor; time relative to the native threshold

Sparse fine execution. On clustered ε=0.001\varepsilon=0.001 both arms run 13 ordinary updates and two terminal previews, and sparse execution cuts the time from 33.327 to 4.165 s (8.00×\times). Heterogeneous ε=0.001\varepsilon=0.001 takes one terminal preview over a mask that admits 60.6% of the tiles and gains 1.33×\times. At ε=0.01\varepsilon=0.01 neither geometry takes a fine update.

Tile verification. On clustered ε=0.001\varepsilon=0.001, verification cuts the padded point-pair work from 3.049×10123.049\times10^{12} to 2.087×10122.087\times10^{12} and the time from 4.335 to 4.167 s. On heterogeneous data it removes 3.95% of the work and costs time, 1.824 against 1.576 s. Scaling δrel\delta_{\mathrm{rel}} by 10−210^{-2} to 10210^{2} changes the clustered time by at most 10%, and the largest factor slows the heterogeneous solve by 53% (Table 10b).

Profiling

The profiles use the clustered n=m=221n=m=2^{21}, ε=0.001\varepsilon=0.001 problem of Table 1. The stage times of Table 1a come from one Nsight Systems call per solver. FS2’s coarse stage is its coarse kernels (2.663 s) and lifts (0.277 s), and its fine stage its fine kernels (8.274 s), mask construction (3.118 s) and sampled checks (0.909 s). GeomLoss’s fine phase is 96 kernels averaging 0.22 s, so kernel launches do not explain its time. The kernel counters come from NCU on a separate A100, where the unprofiled solve takes 16.23 s with FS2 and 21.49 s with GeomLoss.

Table 11: Kernel counters for one fine update per direction on clustered n=m=221n=m=2^{21}, ε=0.001\varepsilon=0.001, on the profiling A100. FS replays one dense reduction per direction from its native incoming state, with its counters averaged over the two directions. GL and FS2 run FS2’s first ordinary fine update on the same B=128B=128 mask, and f/gf/g gives the two directions. Per-pair counts divide totals by the point pairs they cover, instructions are executed warp instructions, and dashes mark counters not collected.

MetricFS (dense)GL (KeOps, FP32)FS2 (TF32)
Point pairs per direction4.40×10124.40 \times10^{12}2.58×10112.58 \times10^{11}2.58×10112.58 \times10^{11}
NCU time per direction (ms)3,600393.957251.435
Warm update, both directions (ms)–791.073504.392
Warp instructions / pair0.340.6283150.278530
Shared-load wavefronts / pair–0.06250010.0246587
Shared-store wavefronts / pair–0.00098060.0053709
HBM read bytes / pair0.00435420.00031610.0149489
HBM write bytes / pair0.00000250.00011350.0000558
Tensor-pipe instructions / pair–0.00033440.015625
Tensor activity, f/gf/g (%)–0.07 / 0.0721.11 / 21.08
Occupancy, f/gf/g (%)37.0891.4 / 91.1412.48 / 12.47
Math-pipe throttle, f/gf/g (%)8.99517.39 / 17.412.32 / 2.31
Long scoreboard, f/gf/g (%)1.210.51 / 0.516.05 / 6.03

Table 11.

Kernel counters. Table 11 compares the GL and FS2 executors on the same mask. We freeze FS2’s first ordinary fine update on the clustered n=m=221n=m=2^{21}, ε=0.001\varepsilon=0.001 problem, with a B=128B=128 mask of 15,760,133 admitted block pairs and 5.16×10115.16 \times10^{11} point pairs over both directions. FS2’s TF32 kernels and GeomLoss’s FP32 KeOps executor receive the same sorted points, incoming potentials, weights and transposed support, KeOps with each run of contiguous target blocks as one range. Over 20 warmed repetitions the update takes 504.392 ms with FS2 and 791.073 ms with KeOps, 1.568× longer. Per pair, FS2 executes 55.7% fewer warp instructions and 60.5% fewer shared-load wavefronts, with tensor-pipe activity of 21% against 0.07%, despite more HBM reads, lower occupancy and more long-scoreboard stall. The extra HBM traffic follows from the policy’s block size B=128B=128 (Section 8.1). The dense FlashSinkhorn reduction evaluates all 4.40×10124.40 \times10^{12} pairs of one direction in 3.6 s, 14× longer than FS2’s reduction on its mask.

Memory

Figure 2(e) reports the PyTorch allocator peak, inputs included. The same protocol on the five heterogeneous FS2 solves at ε=0.001\varepsilon=0.001 gives peaks of 0.80, 2.72, 9.89, 1.70 and 3.40 GiB for n=219n=2^{19} to 2232^{23}. Up to 2212^{21}, FS2 takes one or two fine updates over 60–61% of the tiles. From 2222^{22} it returns the lifted coarse potentials without a fine update and builds no mask.

Block size. We hold the clustered n=m=223n=m=2^{23}, ε=0.001\varepsilon=0.001 problem and its coarse partition fixed (t=42t=42) and change only the block size. Raising BB from 128 to 256 cuts the admitted tiles from 2.25×1082.25 \times10^{8} to 6.0×1076.0 \times10^{7} and the PyTorch peak from 16.17 to 6.88 GiB, for 7% more time, 48.52 against 45.38 s, with the same returned R=0.004694R=0.004694. The automatic policy chooses BB from the L2 budget of the block summaries, not from this mask memory.

Optimization

The optimization grid reuses the 32 forward inputs of Section C.3. Each method runs one trajectory of twenty normalized updates (§ 4.1) and saves steps 0, 5, 10, 15 and 20. The timer includes compilation and autotuning, and a run stops at 7200 s. FS2 steps along the surrogate gradient of § 3.1, while GeomLoss differentiates its native multiscale loss with autograd. GeomLoss reaches the time limit on six problems: clustered 2232^{23} at ε=0.001\varepsilon= 0.001, and heterogeneous 2222^{22} at ε∈{0.001,0.002,0.005}\varepsilon\in\{0.001, 0.002, 0.005\} and 2232^{23} at ε∈{0.001,0.01}\varepsilon\in\{0.001, 0.01\}. Table 12 summarizes the n=m=221n = m = 2^{21} runs of Figure 2(g,Figure 2h).

Cloudε\varepsilonU0U_0FS2 sGL sFS2 decreaseGL decrease
Heterogeneous.001.00429752.803215.67.5829%.5826%
Heterogeneous.01.0150151.661290.01.2551%.2550%
Clustered.001.0523079.81453.22.3064%.2906%
Clustered.01.0816642.580.80.1756%.1682%

Table 12. Twenty-step optimization at n=m=221n = m = 2^{21}.

Score. The evaluator fixes KK nested groups of the initial source cloud and of YY, with FP64 centroids and within-group variances. At a saved iterate, UKU_K is the entropic cost between the source and target group centroids, solved to row and column residuals of at most 10−410^{-4}, plus the within-group squared-distance averages. We report K=131072K = 131072 at ε≤0.002\varepsilon\le0.002, 6553665536 at ε=0.005\varepsilon= 0.005 and 1638416384 at ε≥0.01\varepsilon\ge0.01, and require every decrease to agree with the one at a coarser count (6553665536, 1638416384 and 40964096) within max⁡(10−6,0.02∣ΔUK∣)\max(10^{-6}, 0.02|\Delta U_K|). The score ranks trajectories and is not the full-point OT value.

Direction at X0X_0. At the initial points of the four n=m=221n = m = 2^{21} runs, we compare G~\widetilde{G} and GeomLoss’s autograd direction with Gi=2ai(xi−Tε(xi))G_i = 2a_i(x_i - T_\varepsilon(x_i)) from a separate solve at τ=5×10−4\tau= 5 \times10^{-4}. On clustered data (ε=0.001\varepsilon= 0.001 and 0.010.01), G~\widetilde{G} has cosine 0.92 and 0.96 with GG and relative error 0.39 and 0.28, against 0.49 and 0.40 for GeomLoss’s direction. On heterogeneous data its cosine is at least 0.9997 and, from 4096 rows evaluated in FP64, its relative error is 0.023 and 0.012, and the difference between the two directions lies within the uncertainty of the references. These values measure alignment with a numerical reference, not the error to the exact gradient, because references at τ=0.005\tau= 0.005 and 5×10−45 \times10^{-4} differ by 0.2–3%, and on clustered data at ε=0.001\varepsilon= 0.001 the tighter solve stopped at residual 1.2×10−31.2 \times10^{-3}, above its target. On the same 4096 rows, on three of the four problems, the right-hand side of Equation (8) exceeds ∥G∥F\lVert G\rVert_F, so Proposition 3 does not certify a relative error below one there.

Table 12: Twenty-step optimization at n=m=221n = m = 2^{21}. A decrease is the percentage drop of UU from the common initial score U0U_0 over the twenty steps, and final scores within 3×10−63 \times10^{-6} tie. Times cover the twenty updates, including compilation and autotuning.

Quijote Particle Transport

Problem and Data

The sources are redshift-zero positions matched by particle ID to their Lagrangian lattice sites, the targets. The 2242^{24} instance is the central 2563256^3 subcube and the 2272^{27} instance the full 5123512^3 box, with ε=3.814697265625\varepsilon= 3.814697265625, so that the blur ε=1.953125\sqrt{\varepsilon} = 1.953125 Mpc/hh equals the lattice spacing, and a nonperiodic cutoff. FS2 solves on TF32-rounded coordinates, which move each particle by at most 0.125 Mpc/hh, 6% of the blur. In the 2242^{24} subcube the particle-ID displacement ∥xi−qi∥\lVert x_i - q_i\rVert has median 9.013, 99th percentile 20.668 and maximum 39.135 Mpc/hh.

Configuration and Timing

Configuration. At 2242^{24}, FS2 uses t=47t = 47, the selector’s B=64B = 64 and a sampled check every 16 fine updates. At 2272^{27} it uses the selector’s B=256B = 256, process batches as 64 ×\times 64 point tiles, t=45t = 45 and an automatic check interval. The fine cap is 128 at τ=0.05\tau= 0.05 and 800 at τ=0.01\tau= 0.01, where the two sizes return after 432 and 560 ordinary updates. At every size the solver completes the 64 entries at ε\varepsilon before its first lift. In place of the continuation of Appendix B.2, it then runs at most one batch of 64 to 384 coarse updates after the second fine update and lifts again, and in every run the check scored Table 13: Quijote forward solves, with the τ=0.05\tau= 0.05 size sweep in the first four rows. B/t/c/hB/t/c/h: block size, cell level, fine cap and returned ordinary updates. Peak: PyTorch allocator peak of the size sweep. Light validation: mean absolute relative marginal error on 4096 sampled indices per direction, 65,536 at 2252^{25} and 2262^{26}, with the mean plus three standard errors in brackets. Full max: RR, with dashes where it is not enumerated. W: warm call, F: first call, I: instrumented call. MS/.95/default/5: multiscale, scaling 0.95, default cluster scale, truncation 5.

that lift worse than the fine iterate. The time of this batch is included. We set tt by hand. At 2272^{27} the rule would select t=46t = 46 if its fourth condition admitted that size, but with t=46t = 46 the sampled check became non-finite in the first fine updates, so we use t=45t = 45, whose coarse state exceeds the L2 budget of Equation (16). With the continuation of Appendix § 8.§ 2 instead of the single batch, the 2272^{27}, τ=0.05\tau= 0.05 solve took 2030.4 s and 119 ordinary updates, against 1351.6 s and 80 in Table 13. GeomLoss runs only at 2242^{24} and τ=0.05\tau= 0.05, at scaling 0.95, default cluster scale and truncation 5.

methodn=mn = mτ\tauconfigurationtime (s)peak (GiB)light validation [U3SEU_{3\mathrm{SE}}]full max
FS22242^{24}.05B64/t47/c128/h80B64/t47/c128/h80146.905W^{\mathrm{W}}12.053.046836 [.048531].046631 ✓
FS22252^{25}.05B64/t45/c128/h48B64/t45/c128/h48374.839W^{\mathrm{W}}19.472.049304 [.049758]—
FS22262^{26}.05B128/t45/c128/h72B128/t45/c128/h72694.630W^{\mathrm{W}}33.131.048340 [.048783]—
FS22272^{27}.05B256/t45/c128/h80B256/t45/c128/h801351.589W^{\mathrm{W}}64.129.049009 [.050797].048965 ✓
FS22242^{24}.01B64/t47/c800/h432B64/t47/c800/h432736.393W^{\mathrm{W}}—.009538 [.009924].009433 ✓
FS22272^{27}.01B256/t45/c800/h560B256/t45/c800/h5608832.994F^{\mathrm{F}}—.009585 [.009954].009154 ✓
native GL2242^{24}.05MS/.95/default/53713.300I^{\mathrm{I}}—.058976 [.060909].058463 ✗

Table 13. Quijote forward solves, with the τ=0.05\tau= 0.05 size sweep in the first four rows. B/t/c/hB/t/c/h: block size, cell level, fine cap and returned ordinary updates. Peak: PyTorch allocator peak of the size sweep. Light validation: mean absolute relative marginal error on 4096 sampled indices per direction, 65,536 at 2252^{25} and 2262^{26}, with the mean plus three standard errors in brackets. Full max: RR, with dashes where it is not enumerated. W: warm call, F: first call, I: instrumented call. MS/.95/default/5: multiscale, scaling 0.95, default cluster scale, truncation 5.

Mask size. At 2272^{27} and τ=0.01\tau= 0.01, in the update that produced the returned potentials, the box screen passed 107,397,067 of the 2382^{38} block pairs and verification admitted 24,451,822, which hold 1.60×10121.60 \times10^{12} point pairs. A truncated kernel with one FP32 value and one 32-bit index per pair would take 11.7 TiB. FS2’s index for the candidate and admitted tiles, at 24 bytes per tile, takes 2.9 GiB.

Timed calls. Every time in Table 13 is a single call. FS2’s are warm calls, except the first complete call at 2272^{27} and τ=0.01\tau= 0.01, and at 2242^{24} a second call returns identical potentials, so the all-particle validation applies to the timed call. GeomLoss’s is the instrumented call whose potentials are scored. Validation is not timed. The light validation of Table 13 uses seed 1 and reduces each sampled marginal against every point of the opposite measure. At 2272^{27} the IEEE-FP32 evaluator of the full residual takes some 38 hours on an A100 for the τ=0.01\tau= 0.01 solution.

Evaluator Precision

The full residuals come from an IEEE-FP32 evaluator that forms each row’s log marginal ratio as the difference of two potentials shifted by ∥xi∥2\lVert x_i\rVert^2. Near the box corners ∥xi∥2\lVert x_i\rVert^2 reaches 7.5×1057.5 \times10^5, whose FP32 spacing is 1.6% of ϵ\epsilon, so a single row’s mass is resolved only to 0.1–1.6%. On 4096 or 16384 sampled rows and columns per entry, we recompute each row’s error in FP64 from coordinate differences and subtract the mean paired difference from the full FP32 residual. This gives .04653/.04661, .04883/.04889, .00939/.00942 and .00882/.00869 (row/column) for the rows of Table 13 with a full residual, in table order, with three standard errors of at most .0002, so every entry stays below its τ\tau.

Size Sweep

Figure 3(a,Figure 3b) and the first four rows of Table 13 fix τ=0.05\tau= 0.05 and use FS2 only, on nested cuboids centered in the box from 2563256^3 to 5123512^3 lattice sites with the lattice spacing and ϵ\epsilon fixed. At 2242^{24} the time and the memory come from two calls with identical potentials. The middle sizes are single warm calls with the 2272^{27} configuration and the selector’s BB. Both pass the solver’s sampled check and are validated on 65,536 sampled outputs per side, without enumerating the full residual.

Displacement Reconstruction

We take the 2272^{27}-particle, τ=0.01\tau= 0.01 solution of Table 13 and a uniform sample of 4096 source indices, drawn without replacement with seed 20260919. Each projection sums over all 2272^{27} targets without a mask, using the plan of the TF32-rounded input and the unrounded physical target positions. With L=1000L = 1000 Mpc/hh and the componentwise minimum image wL(v)=v−L⌊v/L+1/2⌋w_L(v) = v - L\left\lfloor v/L + 1/2 \right\rfloor, we evaluate

Ti=∑jPijqjphys∑jPij,ψ^i=wL(xiphys−Ti),ψi∗=wL(xiphys−qiphys).T_i = \frac{\sum_j P_{ij}q_j^{\mathrm{phys}}}{\sum_j P_{ij}}, \qquad\hat{\psi}_i = w_L\left(x_i^{\mathrm{phys}} - T_i\right), \qquad\psi_i^* = w_L\left(x_i^{\mathrm{phys}} - q_i^{\mathrm{phys}}\right).

The wrapping enters only the scoring, and the solver’s cost stays nonperiodic. Over the sample SS, displacement RMSE is [∣S∣−1∑i∈S∥ψ^i−ψi∗∥2]1/2\left[|S|^{-1}\sum_{i\in S}\left\|\hat{\psi}_i-\psi_i^*\right\|^2\right]^{1/2}, and normalized RMSE divides it by the RMS reference displacement (Table 14). The component correlations are 0.797, 0.789 and 0.802, and the unwrapped position RMSE is 122.268 Mpc/hh.

PredictorParticlesRMSE (Mpc/h)Normalized RMSE95% interval
Zero displacement409610.0641.000–
FS2 barycentric displacement40966.4730.643[0.625, 0.662]
no periodic-face crossing40346.333––
periodic-face crossing6212.603––

Table 14. Displacement reconstruction from the 2272^{27}-particle FS2 solution at τ=0.01\tau= 0.01 on 4096 sampled particles, with minimum-image scoring. The interval comes from 500 bootstrap resamples over particles at 95% confidence. The subsets split the sample by whether the reference trajectory crosses a periodic face.

The 4096-query projection takes 9.303 s on one A100, excluding 43.474 s of loading and preparation, and FP64 direct-distance projections of eight sampled queries agree with the FP32 stream within 0.002281 Mpc/hh.

References

  1. [1]Mokhtar Z. Alaya, Maxime Bérar, Gilles Gasso, and Alain Rakotomamonjy. Screening Sinkhorn algorithm for regularized optimal transport. In Advances in Neural Information Processing Systems 32 (NeurIPS), 2019. URL https://arxiv.org/abs/1906.08540.
  2. [2]Jason Altschuler, Francis Bach, Alessandro Rudi, and Jonathan Niles-Weed. Massively scalable Sinkhorn distances via the Nyström method. In Advances in Neural Information Processing Systems 32 (NeurIPS), 2019. URL https://arxiv.org/abs/1812.05189.
  3. [3]Martin Ariovsky, Soumith Chintala, and Léon Bottou. Wasserstein generative adversarial networks. In International Conference on Machine Learning, pp. 214–223, 2017.
  4. [4]R. R. Bahadur and L. J. Savage. The nonexistence of certain statistical procedures in nonparametric problems. The Annals of Mathematical Statistics, 27(4):1115–1122, 1956.DOI
  5. [5]Mauro Bonafini and Bernhard Schmitzer. Domain decomposition for entropy regularized optimal transport. Numerische Mathematik, 149(4):819–870, 2021. doi: 10.1007/s00211-021-01245-0.DOI
  6. [6]Charlotte Bunne, Geoffrey Schiebinger, Andreas Krause, Aviv Regev, and Marco Cuturi. Optimal transport for single-cell and spatial omics. Nature Reviews Methods Primers, 4(1):58, 2024.DOI
  7. [7]Benjamin Charlier, Jean Feydy, Joan Alexis Glaunès, François-David Collin, and Ghislain Durif. Kernel operations on the GPU, with autodiff, without memory overflows. Journal of Machine Learning Research, 22(74):1–6, 2021.
  8. [8]Samir Chowdhury, David Miller, and Tom Needham. Quantized Gromov-Wasserstein. In Machine Learning and Knowledge Discovery in Databases (ECML PKDD), volume 12977 of Lecture Notes in Computer Science, pp. 811–827, 2021. doi: 10.1007/978-3-030-86523-8_49. URL https://arxiv.org/abs/2104.02013.
  9. [9]Marco Cuturi. Sinkhorn Distances: Lightspeed computation of optimal transport. In Advances in Neural Information Processing Systems, volume 26, 2013.
  10. [10]Tri Dao, Dan Fu, Stefano Ermon, Atıı Rudra, and Christopher Ré. FlashAttention: Fast and memory-efficient exact attention with IO-awareness. In Advances in Neural Information Processing Systems, volume 35, pp. 16344–16359, 2022.arxiv.org/abs/2205.14135
  11. [11]Juechu Dong, Boyuan Feng, Driss Gueoussou, Yanbo Liang, and Horace He. Flex attention: A programming model for generating optimized attention kernels. In Proceedings of Machine Learning and Systems (MLSys), volume 7, 2025. arXiv:2412.05496.
  12. [12]Jean Feydy. Geometric data analysis, beyond convolutions. PhD thesis, Université Paris-Saclay, 2020.
  13. [13]Jean Feydy, Pierre Roussillon, Alain Trouvé, and Pietro Gori. Fast and scalable optimal transport for brain tractograms. In Medical Image Computing and Computer Assisted Intervention (MICCAI), pp. 636–644, 2019a. doi: 10.1007/978-3-030-32248-9_71.DOI
  14. [14]Jean Feydy, Thibault Séjourné, François-Xavier Vialard, Shun-ichi Amari, Alain Trouvé, and Gabriel Peyré. Interpolating between optimal transport and MMD using Sinkhorn divergences. In International Conference on Artificial Intelligence and Statistics, pp. 2681–2690, 2019b.
  15. [15]Uriel Frisch, Sabino Matarrese, Roya Mohayaee, and Andrei Sobolevski. A reconstruction of the initial conditions of the Universe by optimal mass transportation. Nature, 417:260–262, 2002. doi: 10.1038/417260a.
  16. [16]Johannes Gasteiger, Marten Lienen, and Stephan Günnemann. Scalable optimal transport in high dimensions for graph distances, embedding alignment, and more. In Proceedings of the 38th International Conference on Machine Learning (ICML), 2021. URL https://arxiv.org/abs/2107.06876.
  17. [17]Samuel Gerber and Mauro Maggioni. Multiscale strategies for computing optimal transport. Journal of Machine Learning Research, 18(72):1–32, 2017.arxiv.org/abs/1708.02469
  18. [18]Peter Halmos, Julian Gold, Xinhao Liu, and Benjamin J. Raphael. Hierarchical refinement: Optimal transport to infinity and beyond. In Proceedings of the 42nd International Conference on Machine Learning, volume 267 of Proceedings of Machine Learning Research, pp. 21629–21661, 2025.
  19. [19]Mete Kemertas, Amir-massoud Farahmand, and Allan D. Jepson. A truncated Newton method for optimal transport. In International Conference on Learning Representations (ICLR), 2025a. URL https://arxiv.org/abs/2504.02067.
  20. [20]Mete Kemertas, Allan D. Jepson, and Amir-massoud Farahmand. Efficient and accurate optimal transport with mirror descent and conjugate gradients. Transactions on Machine Learning Research, 2025b. URL https://openreview.net/forum?id=FVFqrxeF8e.arxiv.org/abs/2307.08507
  21. [21]Dominik Klein, Giovanni Palla, Marius Lange, Michal Klein, Zoe Piran, Manuel Gander, Laetitia Meng-Papaxanthos, Michael Sterr, Lama Saber, Changying Jing, Aimée Bastidas-Ponce, Perla Cota, Marta Tarquis-Medina, Shrey Parikh, Ilan Gold, Heiko Lickert, Mostafa Bakhti, Mor Nitzan, Marco Cuturi, and Fabian J. Theis. Mapping cells through time and space with mosco­t. Nature, 638(8052):1065–1075, 2025. doi: 10.1038/s41586-024-08453-2.DOI
  22. [22]Rajmadan Lakshmanan, Alois Pichler, and Daniel Potts. Nonequispaced fast Fourier transform boost for the Sinkhorn algorithm. Electronic Transactions on Numerical Analysis, 58:289–315, 2023. doi: 10.1553/etna_vol58s289.DOI
  23. [23]Dongryeol Lee, Alexander G. Gray, and Andrew W. Moore. Dual-tree fast Gauss transforms. arXiv preprint arXiv:1102.2878, 2011. URL https://arxiv.org/abs/1102.2878.
  24. [25]Bruno Lévy, Nicolas Ray, Quentin Mérigot, and Hugo Leclerc. Large-scale semi-discrete optimal transport with distributed Voronoi diagrams. Journal of Computational Physics, 542:114374, 2025. doi: 10.1016/j.jcp.2025.114374. arXiv:2406.04192.DOI
  25. [26]Xingjie Li, Fei Lu, Molei Tao, and Felix X-F Ye. Robust first- and second-order differentiation for regularized optimal transport. SIAM Journal on Scientific Computing, 47(3):C630–C654, 2025. doi: 10.1137/24M1674030.DOI
  26. [27]Ismael Medina and Bernhard Schmitzer. Flow updates for domain decomposition of entropic optimal transport. ESAIM: Mathematical Modelling and Numerical Analysis, 59(3):1239–1270, 2025. doi: 10.1051/m2an/2025022.DOI
  27. [28]Maxim Milakov and Natalia Gimelshein. Online Normalizer Calculation for Softmax. arXiv preprint arXiv:1805.02867, 2018.arxiv.org/abs/1805.02867
  28. [29]Gabriel Peyré and Marco Cuturi. Computational Optimal Transport. Foundations and Trends in Machine Learning, 11(5-6):355–607, 2019.
  29. [30]Yixuan Qiu. cuRegOT: A GPU-Accelerated Solver for Entropic-Regularized Optimal Transport. arXiv preprint arXiv:2605.08793, 2026. URL https://arxiv.org/abs/2605.08793.
  30. [31]Meyer Scetbon, Marco Cuturi, and Gabriel Peyré. Low-rank Sinkhorn factorization. In International Conference on Machine Learning, pp. 9349–9354, 2021.arxiv.org/abs/2103.04737
  31. [32]Geoffrey Schiebinger, Jian Shu, Marcin Tabaka, Brian Cleary, Vidya Subramanian, Aryeh Solomon, Joshua Gould, Siyan Liu, Stacie Lin, Peter Berube, Lia Lee, Jenny Chen, Justin Brumbaugh, Philippe Rigollet, Konrad Hochedlinger, Rudolf Jaenisch, Aviv Regev, and Eric S. Lander. Optimal-Transport analysis of single-cell Gene expression identifies developmental trajectories in reprogramming. Cell, 176(4):928–943.e22, 2019.
  32. [33]Marwin Schindler. Shape shifting: A multiscale optimal transport approach to 3D point cloud comparison. Master’s thesis, TU Wien, 2025. URL https://repositum.tuwien.at/handle/20.500.12708/216205.DOI
  33. [34]Bernhard Schmitzer. A sparse multiscale algorithm for dense optimal transport. Journal of Mathematical Imaging and Vision, 56(2):238–259, 2016. doi: 10.1007/s10851-016-0653-9. URL https://arxiv.org/abs/1510.05466.
  34. [35]Bernhard Schmitzer. Stabilized sparse scaling algorithms for entropy regularized transport problems. SIAM Journal on Scientific Computing, 41(3):A1443–A1481, 2019.arxiv.org/abs/1610.06519
  35. [36]Justin Solomon, Fernando de Goes, Gabriel Peyré, Marco Cuturi, Adrian Butscher, Andy Nguyen, Tao Du, and Leonidas Guibas. Convolutional Wasserstein Distances: Efficient optimal transportation on geometric domains. ACM Transactions on Graphics, 34(4):66:1–66:11, 2015.

Paper details

vlnc:W_fkt33pc4
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Claude Code, Codex

View statement
Looking for related papers…
Contents