google-deepmind/graphcast
DeepMind's GraphCast and GenCast weather prediction models using graph neural networks
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
Under the hood, the system uses 3 feedback loops, 3 data pools, 4 control points to manage its runtime behavior.
A 10-component weather climate with 1 connections. 37 files analyzed. Data flows through 5 distinct pipeline stages.
How Data Flows Through the System
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
- Load ERA5 data — Load weather data from Zarr format with variables like temperature, humidity, wind on regular grids
- Grid to mesh projection — Project grid data to icosahedral mesh nodes using radius queries or triangle interpolation
- Graph message passing — Run deep graph neural networks on typed graphs with mesh connectivity
- Mesh to grid projection — Project mesh predictions back to regular lat-lon grid for output
- Autoregressive rollout — Feed predictions back as inputs for next timestep to generate longer forecasts
System Behavior
How the system operates at runtime — where data accumulates, what loops, what waits, and what controls what.
Data Pools
Historical weather reanalysis data used for training and evaluation
Cached spatial connectivity indices between grid points and mesh vertices
Pre-computed mean and std statistics for normalizing weather variables
Feedback Loops
- Autoregressive Prediction (recursive, reinforcing) — Trigger: Model prediction output. Action: Feed prediction as input to next timestep. Exit: Reach target forecast length.
- Message Passing Iterations (convergence, balancing) — Trigger: Graph neural network forward pass. Action: Update node and edge features through message passing. Exit: Complete specified number of GNN layers.
- Diffusion Sampling Steps (convergence, balancing) — Trigger: Noise level decrease. Action: Denoise predictions and update noise schedule. Exit: Reach minimum noise level.
Delays
- Gradient Checkpointing (async-processing, ~forward pass time) — Memory savings during backpropagation at cost of recomputation
- Mesh Generation (batch-window) — One-time computation cost for creating icosahedral mesh hierarchy
- Spatial Tree Query (batch-window) — KD-tree construction for finding grid-mesh connectivity
Control Points
- noise_level (runtime-toggle) — Controls: Amount of noise added to autoregressive inputs. Default: None
- gradient_checkpointing (feature-flag) — Controls: Whether to use gradient checkpointing for memory efficiency. Default: False
- enabled (feature-flag) — Controls: Whether bfloat16 casting is enabled. Default: True
- splits (threshold) — Controls: Number of mesh subdivision levels. Default: varies
Technology Stack
Core ML framework for neural networks and autodiff
Neural network library built on JAX
Labeled multi-dimensional arrays for weather data
Numerical computing and array operations
Scientific computing, spatial operations, sparse matrices
Triangle mesh processing and geometry
Graph neural networks for JAX
Testing utilities and array assertions for JAX
Key Components
- Predictor (class) — Wraps one-step predictors to make multi-step autoregressive predictions by feeding outputs back as inputs
graphcast/autoregressive.py - GraphCast (class) — Main deterministic weather prediction model using graph neural networks on icosahedral mesh
graphcast/graphcast.py - GenCast (class) — Diffusion-based ensemble weather model that generates probabilistic forecasts
graphcast/gencast.py - DeepTypedGraphNet (class) — Deep graph neural network that runs message passing on typed graphs with different MLPs for each node/edge type
graphcast/deep_typed_graph_net.py - get_hierarchy_of_triangular_meshes_for_sphere (function) — Generates icosahedral mesh hierarchy by iteratively subdividing triangular faces and projecting to unit sphere
graphcast/icosahedral_mesh.py - radius_query_indices (function) — Finds connectivity between regular lat-lon grid points and mesh vertices within specified radius
graphcast/grid_mesh_connectivity.py - weighted_mse_per_level (function) — Computes latitude and pressure-level weighted MSE loss for weather variables
graphcast/losses.py - get_graph_spatial_features (function) — Computes spatial features for graph nodes and edges including positions, relative distances, and encodings
graphcast/model_utils.py - Bfloat16Cast (class) — Wrapper that casts all inputs to bfloat16 and outputs back to target dtype for memory efficiency
graphcast/casting.py - DPMSolverPlusPlus2S (class) — Sampling algorithm for diffusion models using second-order single-step solver with optional stochastic churn
graphcast/dpm_solver_plus_plus_2s.py
Explore the interactive analysis
See the full architecture map, data flow, and code patterns visualization.
Analyze on CodeSeaCompare graphcast
Related Weather Climate Repositories
Frequently Asked Questions
What is graphcast used for?
DeepMind's GraphCast and GenCast weather prediction models using graph neural networks google-deepmind/graphcast is a 10-component weather climate written in Python. Data flows through 5 distinct pipeline stages. The codebase contains 37 files.
How is graphcast architected?
graphcast is organized into 4 architecture layers: Predictor Interface, Model Implementations, Graph Neural Networks, Mesh & Data Utils. Data flows through 5 distinct pipeline stages. This layered structure keeps concerns separated and modules independent.
How does data flow through graphcast?
Data moves 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 This pipeline design reflects a complex multi-stage processing system.
What technologies does graphcast use?
The core stack includes 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), and 2 more. A focused set of dependencies that keeps the build manageable.
What system dynamics does graphcast have?
graphcast exhibits 3 data pools (ERA5 Weather Dataset, Mesh Connectivity Cache), 3 feedback loops, 4 control points, 3 delays. The feedback loops handle recursive and convergence. These runtime behaviors shape how the system responds to load, failures, and configuration changes.
What design patterns does graphcast use?
4 design patterns detected: Predictor Wrapper Pattern, Typed Graph Networks, JAX/XArray Integration, Hierarchical Mesh Processing.
How does graphcast compare to alternatives?
CodeSea has side-by-side architecture comparisons of graphcast with climax, earth2studio. These comparisons show tech stack differences, pipeline design, system behavior, and code patterns. See the comparison pages above for detailed analysis.
Analyzed on March 20, 2026 by CodeSea. Written by Karolina Sarna.