← Back to work

Barcelona Supercomputing Center · Sep 2025 – Jun 2026

Graph Transformer for Weather Interpolation

PyTorch FSDP Graph Neural Networks ERA5 Slurm MareNostrum 5 Nsight

Atmospheric reanalysis data like ERA5 provides high-quality snapshots of the global atmosphere at discrete timesteps. Interpolating between those snapshots — reconstructing what happened in between — is non-trivial: the atmosphere is non-linear, and naive interpolation breaks down for phenomena like storms and fronts that move and evolve rapidly.

I designed and trained a graph-based transformer from scratch to solve this. The model takes only two anchor states — a start and an end atmospheric snapshot — and learns to reconstruct the full trajectory between them. The key constraint is that the model has no access to any intermediate ground truth during inference; it has to infer the dynamics from the boundary conditions alone.

Storm Daniel track: ERA5 ground truth vs interpolator reconstruction
Storm Daniel (September 2023). Given only the storm's position at two anchor times, the model reconstructs the full track. ERA5 ground truth (teal) vs. the interpolator (orange). The close match shows the model has learned realistic atmospheric dynamics — including the cyclogenesis and tropical transition.

Why the RMSE curves look the way they do

The RMSE curves below have a characteristic arc shape: error is low at the start and end, and peaks somewhere in the middle lead times. This is not a failure — it is the expected behavior of an interpolator. The model is constrained at both endpoints, so the endpoints are easy. The middle is the hardest, because that is where the model has the least information and must infer the most. The shape of the curve is itself evidence that the model is working correctly as an interpolator.

Compared against AIFS — ECMWF's production ML weather model — the interpolator performs competitively across both single-level and pressure-level variables.

RMSE vs lead time, single-level variables: interpolator vs AIFS
RMSE vs. lead time for single-level variables (2m temperature, 10m wind, mean sea level pressure). The dashed blue line is the interpolator; orange is AIFS.
RMSE vs lead time, pressure-level variables: interpolator vs AIFS
RMSE vs. lead time across pressure levels (temperature, specific humidity, wind components). The arc shape is consistent across variables and levels.

Training on MareNostrum 5

The model trained for 9 days across 32 GPUs and 8 nodes on MareNostrum 5, a EuroHPC pre-exascale system. Getting there required building the data pipeline first — terabytes of ERA5 data that had to move fast enough to keep the GPUs busy. That pipeline went from 3 hours to 10 minutes (covered separately in the data pipeline card). The training setup used FSDP for model parallelism, profiled with Nsight to identify inter-node communication bottlenecks.

Early ERA5 output: original vs interpolator wind field comparison
An early version of the model: 10m wind speed over the full globe. Original ERA5 (left) vs. the interpolator's output (right). The global structure is reproduced, with some smoothing in areas with complex local dynamics — expected from an early checkpoint.