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.
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.
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
ERA5 Weather Dataset
Historical weather reanalysis data used for training and evaluation
Type: file-store
Mesh Connectivity Cache
Cached spatial connectivity indices between grid points and mesh vertices
Type: in-memory
Normalization Statistics
Pre-computed mean and std statistics for normalizing weather variables
Type: file-store
Feedback Loops
Autoregressive Prediction
Trigger: Model prediction output → Feed prediction as input to next timestep (exits when: Reach target forecast length)
Type: recursive
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
Diffusion Sampling Steps
Trigger: Noise level decrease → Denoise predictions and update noise schedule (exits when: Reach minimum noise level)
Type: convergence
Control Points
noise_level
gradient_checkpointing
enabled
splits
Delays
Gradient Checkpointing
Duration: forward pass time
Mesh Generation
Spatial Tree Query
Technology Choices
graphcast is built with 8 key technologies. Each serves a specific role in the system.
Key Components
- Predictor (class): Wraps one-step predictors to make multi-step autoregressive predictions by feeding outputs back as inputs
- GraphCast (class): Main deterministic weather prediction model using graph neural networks on icosahedral mesh
- GenCast (class): Diffusion-based ensemble weather model that generates probabilistic forecasts
- DeepTypedGraphNet (class): Deep graph neural network that runs message passing on typed graphs with different MLPs for each node/edge type
- get_hierarchy_of_triangular_meshes_for_sphere (function): Generates icosahedral mesh hierarchy by iteratively subdividing triangular faces and projecting to unit sphere
- radius_query_indices (function): Finds connectivity between regular lat-lon grid points and mesh vertices within specified radius
- weighted_mse_per_level (function): Computes latitude and pressure-level weighted MSE loss for weather variables
- get_graph_spatial_features (function): Computes spatial features for graph nodes and edges including positions, relative distances, and encodings
- Bfloat16Cast (class): Wrapper that casts all inputs to bfloat16 and outputs back to target dtype for memory efficiency
- DPMSolverPlusPlus2S (class): Sampling algorithm for diffusion models using second-order single-step solver with optional stochastic churn
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
Full Analysis
Interactive architecture map for graphcast
graphcast vs climax
Side-by-side architecture comparison
graphcast vs earth2studio
Side-by-side architecture comparison
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.