How GraphCast Works

Traditional weather forecasting runs physics simulations on supercomputers. GraphCast replaces the simulation with a graph neural network that predicts the next weather state from the current one — and does it in under a minute on a single TPU.

6,561 stars Python 10 components 5-stage pipeline

What graphcast Does

DeepMind's GraphCast and GenCast weather prediction models using graph neural networks

This package implements GraphCast (deterministic) and GenCast (ensemble) weather forecasting models that use graph neural networks on icosahedral meshes. The models predict atmospheric and surface weather variables by processing ERA5 data on regular grids, projecting to triangular mesh representations, running message passing, and projecting back to grids.

Architecture Overview

graphcast is organized into 4 layers, with 10 components and 1 connections between them.

Predictor Interface
Abstract predictor base and various wrapper predictors for autoregressive, normalization, casting
Model Implementations
GraphCast deterministic model and GenCast diffusion model with their specific architectures
Graph Neural Networks
Graph network building blocks operating on typed graphs with node and edge message passing
Mesh & Data Utils
Icosahedral mesh generation, grid-mesh connectivity, and data preprocessing utilities

How Data Flows Through graphcast

Weather data flows from regular lat-lon grids through icosahedral mesh representations where graph neural networks perform message passing, then back to grids for predictions

1Load ERA5 data

Load weather data from Zarr format with variables like temperature, humidity, wind on regular grids

2Grid to mesh projection

Project grid data to icosahedral mesh nodes using radius queries or triangle interpolation

3Graph message passing

Run deep graph neural networks on typed graphs with mesh connectivity

4Mesh to grid projection

Project mesh predictions back to regular lat-lon grid for output

5Autoregressive rollout

Feed predictions back as inputs for next timestep to generate longer forecasts

System Dynamics

Beyond the pipeline, graphcast has runtime behaviors that shape how it responds to load, failures, and configuration changes.

Data Pools

Pool

ERA5 Weather Dataset

Historical weather reanalysis data used for training and evaluation

Type: file-store

Pool

Mesh Connectivity Cache

Cached spatial connectivity indices between grid points and mesh vertices

Type: in-memory

Pool

Normalization Statistics

Pre-computed mean and std statistics for normalizing weather variables

Type: file-store

Feedback Loops

Loop

Autoregressive Prediction

Trigger: Model prediction output → Feed prediction as input to next timestep (exits when: Reach target forecast length)

Type: recursive

Loop

Message Passing Iterations

Trigger: Graph neural network forward pass → Update node and edge features through message passing (exits when: Complete specified number of GNN layers)

Type: convergence

Loop

Diffusion Sampling Steps

Trigger: Noise level decrease → Denoise predictions and update noise schedule (exits when: Reach minimum noise level)

Type: convergence

Control Points

Control

noise_level

Control

gradient_checkpointing

Control

enabled

Control

splits

Delays

Delay

Gradient Checkpointing

Duration: forward pass time

Delay

Mesh Generation

Delay

Spatial Tree Query

Technology Choices

graphcast is built with 8 key technologies. Each serves a specific role in the system.

JAX
Core ML framework for neural networks and autodiff
Haiku
Neural network library built on JAX
XArray
Labeled multi-dimensional arrays for weather data
NumPy
Numerical computing and array operations
SciPy
Scientific computing, spatial operations, sparse matrices
Trimesh
Triangle mesh processing and geometry
Jraph
Graph neural networks for JAX
Chex
Testing utilities and array assertions for JAX

Key Components

Who Should Read This

ML researchers interested in scientific applications, climate scientists, or engineers working with weather prediction systems.

This analysis was generated by CodeSea from the google-deepmind/graphcast source code. For the full interactive visualization — including pipeline graph, architecture diagram, and system behavior map — see the complete analysis.

Explore Further

Frequently Asked Questions

What is graphcast?

DeepMind's GraphCast and GenCast weather prediction models using graph neural networks

How does graphcast's pipeline work?

graphcast processes data through 5 stages: Load ERA5 data, Grid to mesh projection, Graph message passing, Mesh to grid projection, Autoregressive rollout. Weather data flows from regular lat-lon grids through icosahedral mesh representations where graph neural networks perform message passing, then back to grids for predictions

What tech stack does graphcast use?

graphcast is built with JAX (Core ML framework for neural networks and autodiff), Haiku (Neural network library built on JAX), XArray (Labeled multi-dimensional arrays for weather data), NumPy (Numerical computing and array operations), SciPy (Scientific computing, spatial operations, sparse matrices), and 3 more technologies.

How does graphcast handle errors and scaling?

graphcast uses 3 feedback loops, 4 control points, 3 data pools to manage its runtime behavior. These mechanisms handle error recovery, load distribution, and configuration changes.

How does graphcast compare to climax?

CodeSea has detailed side-by-side architecture comparisons of graphcast with climax, earth2studio. These cover tech stack differences, pipeline design, and system behavior.

Visualize graphcast yourself

See the interactive pipeline graph, architecture diagram, and system behavior map.

See Full Analysis