Official implementation of Scale-Autoregressive Modeling from [📄 Research Paper]
Analyzing unsteady fluid flows often requires access to the full distribution of possible temporal states, yet conventional PDE solvers are computationally prohibitive and learned time-stepping surrogates quickly accumulate error over long rollouts. Generative models avoid compounding error by sampling states independently, but diffusion and flow-matching methods, while accurate, are limited by the cost of many evaluations over the entire mesh.
Scale-Autoregressive Modeling (SAR) samples flows on unstructured meshes hierarchically from coarse to fine: it first generates a low-resolution field, then refines it by progressively sampling higher resolutions conditioned on coarser predictions. This coarse-to-fine factorization improves efficiency by concentrating computation at coarser scales, where uncertainty is greatest, while requiring fewer denoising steps at finer scales.
(a) SAR generates resolution scales autoregressively from coarser to finer. (b) A SAR model consists of a condition encoder, an autoregressive module, and a flow-matching sampler.
A SAR model consists of three specialized components: a condition encoder (which provides global geometric and physical context to all nodes), an autoregressive module (which integrates coarser-scale predictions to condition the next scale), and a flow-matching sampler (which generates the field at the next scale accounting for global spatial dependencies).
Unlike diffusion GNNs, which apply the same number of denoising steps across all scales via local message passing, SAR allocates fewer steps to finer scales — making it feasible to use global attention at high resolution without prohibitive cost.
Diffusion GNNs apply uniform denoising steps across all scales via local message passing. SAR uses fewer steps at finer scales, enabling the use of attention and an autoregressive module for upsampling.
Across unsteady-flow benchmarks of varying complexity, SAR attains substantially lower distributional error and higher per-sample accuracy than state-of-the-art diffusion models based on multi-scale GNNs, while matching or surpassing a flow-matching Transolver (a linear-time transformer) yet running 2–7× faster depending on the task.
Speed/distributional-accuracy trade-off on EllipseFlow datasets. SAR with scale-adaptive denoising steps (red) is 3–7× faster than a flow-matching Transolver at comparable accuracy.
SAR also provides reliable estimates of key statistical flow quantities such as turbulent kinetic energy (TKE) and Reynolds shear stress (RSS). On the challenging 3D turbulent Wing task, SAR accurately captures the pressure variance on unseen wing geometries while running faster than a full-resolution Transolver.
(a) Standard deviation of surface pressure on an unseen wing geometry from the ground truth, the truncated training distribution, a flow-matching Transolver, and SAR. (b) Standard-deviation accuracy vs. inference cost for both models.
For more results and detailed methods, check our paper.
Python 3.10 or higher and PyTorch 2.4 or higher are required. We recommend installing sar in a virtual environment, e.g., using Anaconda or Miniconda. It can be installed from the current directory by running:
pip install -e .Once sar has been installed, it can be imported in Python as follows:
import sarsar includes the following models:
- Scale-Autoregressive Model (
sar.nn.SAR) - Flow-Matching Transolver (
sar.nn.FlowMatchingTransolver, used as a baseline)
Details are available in the paper.
All datasets used in our paper can be loaded via the sar.datasets module. The benchmarks are:
-
Ellipse task: Infer pressure on the surface of an ellipse in 2D laminar flow (
$Re \in [500, 1000]$ ). Each simulation has 101 time-steps. The training and testing datasets are:- EllipseInDist
- EllipseLowRe
- EllipseHighRe
- EllipseThin
- EllipseThick
- EllipseAoA10
-
EllipseFlow task: Infer the full velocity and pressure fields around an ellipse in 2D laminar flow (
$Re \in [500, 1000]$ ). Each simulation has 101 time-steps. The training and testing datasets are:- uvpAroundEllipseInDist
- uvpAroundEllipseLowRe
- uvpAroundEllipseHighRe
- uvpAroundEllipseThin
- uvpAroundEllipseThick
- uvpAroundEllipseAoA10
-
Wing task: Infer pressure on the surface of a 3D wing in turbulent flow. Wing geometry varies in thickness, taper ratio, sweep angle, and twist angle. Training simulations have 251 time-steps; test simulations have 2501 time-steps. The training and testing datasets are:
- pOnWingTrain (Training dataset)
- pOnWingTrainFullDist
- pOnWingInDist
We recommend having a look at the training scripts and Jupyter notebooks in the examples/ folder, covering the Ellipse, EllipseFlow, and Wing benchmarks.



