Is Debris-Flow Erosion a Hardware-Invariant Prediction?

Debris flows are fast, water-saturated avalanches of mud and boulders. They become dangerous in large part because they erode the channel bed beneath them, pick up sediment and grow in volume. Simulations of laboratory flumes show that how deep a flow cuts into its bed is governed by the peak force of individual grain collisions on the bed, and not by bulk flow averages. Those peak forces come from very stiff contact mechanics: two grains overlapping by a tiny fraction of their diameter. Scientific computing, meanwhile, is moving onto a zoo of accelerators (NVIDIA and AMD GPUs, TPUs, AWS Trainium). These chips differ in precision formats, rounding behavior and compiler pipelines, and the speed they offer comes mostly from low-precision arithmetic. We ask a question nobody seems to have asked. If the same erosion simulation, or a learned stand-in for it, is run on different hardware and precisions, does it give the same answer about whether and how deeply the bed erodes?

Our claim is that it often will not, and that the reason is specific and fixable. Contact forces are computed from the small difference between two large particle coordinates. In reduced precision that difference is cancelled away or distorted before the stiff force law amplifies it. The shift lands in exactly the extreme tail of collision loads that controls erosion. We propose three things. The first is a measurement protocol that separates hardware-induced spread in erosion predictions from ordinary chaotic run-to-run spread. The second is a contact formulation in local, per-pair coordinates that should remove the hardware sensitivity. The third is a learned surrogate that predicts the distribution of bed collision loads rather than bulk fields, and that is trained and checked to give the same erosion answer on every platform.

Core Claim

Huo and colleagues' unresolved CFD-DEM study (A Numerical Simulation Study on the Critical Erosion of Laboratory-Scale Debris Flow) couples a grid-based fluid solver to discrete-element (DEM) particle tracking. It finds that bed erosion depth $H$ follows a power law in collisional point load $F_c$ ($R^2 = 0.92$). It also finds that erosion length and critical entrainment follow power laws in impact energy, and that the bed splits into a bouncing layer, a shear-creeping layer and a stationary layer. This is our physical anchor, and it motivates the whole study: erosion is a tail-driven observable.

On the hardware side, HLAT (HLAT: High-quality Large Language Model Pre-trained on AWS Trainium) reports that Trainium's stochastic rounding made deep models diverge and had to be replaced by hand-engineered mixed precision. That is direct evidence that hardware arithmetic, not code, can change outcomes. HLAT is a constraint on our design: we cannot assume a numerics choice that is safe on one chip is safe on another.

Put together, these suggest a sharp and testable hypothesis. Bulk quantities such as mean flow depth and velocity will agree across platforms to within natural chaotic spread. The upper quantiles of $F_c$ at the bed, and therefore $H$ and the Froude number at erosion onset, will shift beyond that spread under 16-bit formats. A contact computation done in pair-relative coordinates should restore agreement at near-low-precision cost.

The central quantity is a platform sensitivity ratio for each observable $q$ (for example $H$, or the 99th percentile of $F_c$):

$$ \rho_q = \frac{\operatorname{Var}_{p}\left[\mathbb{E}_{s}\, q(p,s)\right]}{\mathbb{E}_{p}\left[\operatorname{Var}_{s}\, q(p,s)\right]} $$

Here $p$ indexes a platform-and-precision configuration and $s$ indexes random seeds, meaning perturbations of the initial particle packing at roughly $10^{-12}$ of a grain diameter. The numerator measures how much the seed-averaged prediction moves between platforms. The denominator measures ordinary chaotic spread on a single platform. $\rho_q \lesssim 1$ means hardware does not matter for $q$. $\rho_q \gg 1$ means the prediction is an artifact of the chip.

Research Program

The first component is a single-source solver. We will reimplement a lab-scale version of Huo et al.'s configuration in JAX: a dam-breach flow over a dry erodible bed, a Hertz–Mindlin contact law, and drag, buoyancy and lift coupling to a coarse fluid grid. The same source then compiles through XLA to CPU, NVIDIA GPU, AMD GPU and TPU, and to Trainium through the Neuron compiler where access allows. This follows the portability strategy that RedCoast (RedCoast: A Lightweight Tool to Automate Distributed Training of LLMs on Any GPU/TPUs) uses for language models, where compiler-level sharding replaces custom CUDA kernels. RedCoast supplies the method but not the workload. Its sharding rules assume dense transformer matrices, and a lab-scale flume fits on one device, so we use XLA only for portability, not for distribution.

On each backend we sweep FP64, FP32, BF16, and BF16 with stochastic rounding where the hardware supports it. To tie back to the literature, we validate the FP64 CPU run against Huo et al.'s reported $H$–$F_c$ power law and three-layer structure.

The second component is the fix. We will compute contact overlap in a per-pair local frame: store positions as a coarse cell index plus a small high-resolution offset, and form the overlap from offsets, so that small overlaps do not cancel against large absolute coordinates. Only the contact kernel is kept at higher precision. Everything else, including fluid coupling and neighbor search, runs low-precision. The hypothesis to test is that this targeted change drives $\rho_q$ for tail observables back below one at most of the low-precision speedup.

The third component is a bed-load surrogate. NeuralDEM (NeuralDEM - Real-time Simulation of Industrial Particulate Flows) replaces DEM with continuous fields such as occupancy and transport velocity. It is fast but, by construction, discards individual collisions, so it cannot output $F_c$. We keep a NeuralDEM-style field operator for the bulk flow and add a head that predicts, for each patch of bed surface and time window, the distribution of collision loads. We represent this distribution as quantiles, fitted with a pinball loss.

The contact-and-proximity edge idea from MeshGraphNets (Learning Mesh-Based Simulation with Graph Networks) supplies the local encoder near the bed. MeshGraphNets was built for single-phase fluids and cloth, not erodible beds. Erosion depth then follows from the predicted load tail through the fitted power law.

Training data come from the platform sweep itself. Only configurations that pass the $\rho$ test are labeled as ground truth. We then measure the surrogate's own $\rho$ when it is run on each accelerator, since HLAT shows that learned models can also be hardware-fragile.

Baselines

The naive reference point is the current practice of reporting erosion depth from a single run on whatever machine is at hand, which implicitly assumes $\rho = 1$ or lower. We implement it simply as the one-seed prediction on each platform. The protocol beats it if the across-platform differences it would have missed are larger than seed spread for at least one decision-relevant observable, such as onset Froude number or $H$.

The reference solver is the FP64 CPU CFD-DEM run, validated against Huo et al.'s $R^2 = 0.92$ $H$–$F_c$ relation from A Numerical Simulation Study on the Critical Erosion of Laboratory-Scale Debris Flow. Every other configuration is scored against it, on the same geometry, particle-size distribution and Froude sweep.

The strongest existing surrogate is a NeuralDEM-style Eulerian field operator (NeuralDEM - Real-time Simulation of Industrial Particulate Flows) with erosion depth read off by applying the power law to bed-adjacent stress estimated from the predicted fields. On its own benchmarks NeuralDEM reports reducing a 500,000-particle fluidized-bed CFD-DEM run from 6 hours on a 64-core cluster to 11 seconds on one GPU, and stable rollouts of up to 2,800 timesteps. We found no reported result on Lacuna for NeuralDEM, or any learned surrogate, on debris-flow erosion depth or collision-load accuracy.

To keep the comparison fair, both surrogates get identical training trajectories, the same parameter count within 10%, the same number of hyperparameter trials, and the same GPU-hour budget. Our surrogate beats this baseline if it predicts $H$ and the upper $F_c$ quantiles with lower error against the FP64 reference at matched inference cost, and if its own $\rho$ across accelerators stays at or below one.

Three ablations isolate the key ingredients. The first is the full low-precision solver without the local-frame contact, which isolates the fix. The second is the surrogate with its quantile head replaced by a mean-load head, which tests whether the tail is really what matters. The third is the surrogate trained on single-platform data versus data filtered by the $\rho$ test, which checks whether hardware-inconsistent labels hurt the surrogate.

Why not just…?

Why not just run everything in FP64 and ignore platform questions? FP64 is correct and should be the reference. However, it is slow or absent on the accelerators that are becoming cheap and available: HLAT reports Trainium at about 60% of A100 cost per token. FP64 also gives up the low-precision speed that makes landscape-scale runs conceivable. The practical question is how little precision can be spent while keeping erosion answers stable, and experiment one answers it directly by reporting $\rho$ and wall-clock time together.

Why not just run seed ensembles on one platform, since granular flow is chaotic anyway? This is the real threat. If chaotic spread already swamps hardware effects, then $\rho \le 1$ everywhere and the hardware question is moot. The protocol is designed to settle this. The denominator of $\rho$ is exactly the single-platform ensemble spread. A uniform null result is a publishable finding: erosion statistics are hardware-invariant and single-platform ensembles suffice. If that happens we would drop the surrogate's platform-invariance component and keep only the tail-predicting head.

Why not just port an existing CUDA DEM code with a transpiler and compare outputs? Transpilation changes syntax, not arithmetic. Dash et al. (Optimizing Distributed Training on Frontier for Large Language Models) show that hipify-ported code still inherits hardware-specific behavior, in their case in communication. A transpiled code would also reveal differences without explaining them. The precision sweep, together with the local-frame ablation, attributes any drift to the contact computation specifically.

Why not just use an Eulerian surrogate plus the empirical power law? That is our strongest baseline, and it may well capture mean erosion. The weakness is structural: Huo et al. tie $H$ to point loads, and averaged fields smooth out exactly those peaks. BubbleML (BubbleML: A Multiphase Multiphysics Dataset and Benchmarks for Machine Learning) reports an analogous failure, where spectral operators smear sharp phase interfaces that UNets resolve. The head-to-head comparison on upper-quantile $F_c$ and onset Froude number is the test.

Proposed Experiments

The first experiment is the sensitivity map. We compute $\rho_q$ on the reference flume geometry across a Froude sweep for mean flow depth and front velocity, for the 50th, 90th and 99th percentiles of bed $F_c$, and for $H$, erosion length, onset Froude number and the thickness of the three bed layers. We use at least 16 seeds per configuration. Confidence intervals on $\rho$ come from bootstrapping over seeds. The prediction is that bulk quantities give $\rho \approx 1$ while tail and threshold quantities under BF16 give $\rho \gg 1$.

The second experiment is the mechanism test. We rerun the worst configurations with the local-frame contact and sweep particle-size ratio. The prediction follows from the cancellation argument: the loss of overlap resolution scales with the ratio of domain coordinate magnitude to grain diameter, so sensitivity should grow with domain size at fixed grain size. If it does not, the cancellation explanation is wrong and we will report that.

The third experiment compares the surrogates. We compare the tail-head surrogate with the NeuralDEM-style baseline and the ablations on held-out Froude numbers and grain sizes, scoring error in $H$, quantile loss on $F_c$, and the surrogate's own $\rho$ when run on each accelerator.

The decisive check is simple. If experiment one gives $\rho \le 1$ for $H$ and onset Froude number in every configuration, the hardware thesis fails and the contribution reduces to a tail-aware surrogate. If $\rho \gg 1$ and the local-frame fix does not restore it, the mechanism is wrong. The proposal succeeds only if both the effect and its removal are observed.