Open-Source · MIT License

Neural Weather
Prediction for Everyone

WeatherGraph brings Graph Neural Network weather forecasting to standard research hardware — from a laptop GPU to a cloud workstation — with a production-ready C++ inference core and a Python scientific API researchers already know.

View on GitHub Quick Start →
78 Atmospheric Channels
0.1° Target Resolution
10⁻⁵ Accuracy Tolerance
6 Data Source Adapters

Capabilities

Built for research-grade deployments

Every component is designed to run on hardware already available in research labs and field offices — without sacrificing scientific rigor.

Zero-Copy Inference

Direct memory mapping between Python numpy/xarray and the C++ ONNX core via pybind11 Buffer Protocol — no redundant data copies on the critical path.

🧠

Multi-Accelerator Support

CUDA, TensorRT, ROCm, and OpenVINO execution providers supported out of the box. Switch between CPU and GPU with a single parameter.

🗺️

Exact Spatial Tiling

Graph-aware tiling via bundle manifests enables 0.1° global inference on machines that cannot hold the full graph in memory. Mathematically exact — no approximations.

📡

Multi-Source Data Ingestion

Built-in adapters for ERA5, ECMWF Open Data, Copernicus CDS, NOAA GFS, and Open-Meteo. Pluggable architecture for custom sources.

💾

Streaming Export

Step-by-step export to NetCDF4, Zarr, and NPZ. Long multi-day rollouts write directly to disk without materializing the full trajectory in RAM.

🔬

Reproducible Science

Verified against reference JAX/PyTorch implementations at atol=10⁻⁵. Deterministic NaN/Inf handling, validated against historical extreme events.

📦

Out-of-Core Processing

Native Dask integration for processing multi-gigabyte ERA5 archives on memory-constrained machines with controlled footprint.

🖥️

Researcher CLI

weathergraph forecast, inspect, visualize, build-tile-bundle — a complete workflow from initial conditions to interactive map.


Design

Two-layer architecture

Performance-critical inference is handled in C++; scientific orchestration stays in Python where researchers can iterate quickly.

Control Plane · Python
xarray · adapters · rollout · export
Data Plane · C++
ONNX Runtime · zero-copy tensors
↓ pybind11 Buffer Protocol
↓ No copy across the boundary

Data Plane (C++)

  • ONNX Runtime session management with RAII
  • Multi-provider execution: CPU / CUDA / TensorRT / ROCm / OpenVINO
  • C-contiguous buffer validation before inference
  • Optional memory-arena and pattern-reuse controls

Control Plane (Python)

  • WeatherGraphModel scientific API
  • Pluggable DataSourceAdapter registry
  • Autoregressive rollout: predict_one_step · forecast · iter_forecast
  • Exact tile-bundle orchestration for high-resolution runs
  • Structured export to NetCDF4 / Zarr / NPZ

Performance

Estimated inference times

10-step (60-hour) autoregressive forecast at three resolutions. Based on preliminary internal testing; active work is underway to broaden hardware coverage.

Resolution Grid Size RTX 3060 (6 GB) RTX 4060 (8 GB) RTX 4070 (8 GB)
1.0° 181 × 360 ~4 s ~2.5 s ~2 s
0.25° 721 × 1440 ~45 s ~28 s ~22 s
0.1° 1801 × 3600 ~18 min (tiled) ~12 min (tiled) ~9 min (tiled)
Resolution Grid Size i7-12700H (14C) Ryzen 7 7840HS (8C) Apple M2 Pro (12C)
1.0° 181 × 360 ~18 s ~22 s ~15 s
0.25° 721 × 1440 ~8 min ~10 min ~6 min
0.1° 1801 × 3600 ~55 min (tiled) ~70 min (tiled) ~45 min (tiled)

⚡ These are preliminary estimates from internal development testing. Actual performance depends on the model variant, thermal headroom, background system load, and ONNX Runtime version. Tiled mode is required at 0.1° and carries additional tile-stitching overhead. Active engineering work is focused on stabilising 0.1° inference across a broader range of consumer hardware released in the last 5 years.


Getting Started

Up and running in minutes

Install from source, point the model at an ERA5 initial state, and run a 10-day global forecast.

INSTALL

# Install from source git clone https://github.com/Wanderspool/WeatherGraph cd WeatherGraph pip install . # With visualization extras pip install ".[vis]"

CLI FORECAST

weathergraph forecast \ --model-path models/weather_gnn.onnx \ --weights-dir data \ --data-source era5_netcdf \ --input-path initial_state.nc \ --steps 40 \ --output-format zarr \ --output-path forecast_out

PYTHON API

Python import xarray as xr from weathergraph import WeatherGraphModel # Standard CPU inference model = WeatherGraphModel( model_path="models/weather_gnn.onnx", weights_dir="data", intra_op_threads=4, ) # GPU acceleration — one parameter change model = WeatherGraphModel( model_path="models/weather_gnn.onnx", weights_dir="data", execution_provider="cuda", execution_device_id=0, ) ds = xr.open_dataset("initial_state.nc") # 10-day autoregressive rollout (40 × 6h steps) forecast = model.forecast(ds, steps=40) # Memory-efficient streaming to NetCDF4 model.forecast_export(ds, steps=40, output_path="forecast", fmt="netcdf4")

Data Ingestion

Connect to any atmospheric data source

Built-in adapters normalise data from major providers into the WeatherGraph input contract. No preprocessing scripts needed.

🗄️

era5_netcdf

Local ERA5 reanalysis from NetCDF archive (Copernicus CDS or ECMWF download)

No auth
🌐

ecmwf_open

ECMWF Open Data — real-time global forecast, updated twice daily

No auth
🛰️

cds_era5

Copernicus CDS ERA5 reanalysis via API — full historical record from 1940

Free registration
🇺🇸

gfs

NOAA GFS global forecast via AWS Open Data S3 — 6-hourly, worldwide

No auth
📊

open_meteo

Open-Meteo multi-model NWP aggregator (ECMWF IFS, GFS, ICON)

No auth
🔧

custom

Map any file format (NetCDF, GRIB2, Zarr, HDF5) or NumPy array via configurable variable mapping

No auth

Project Status

What's implemented, what's next

WeatherGraph is in active development. Core inference and the operational 0.25° profile are stable; the 0.1° tier is the current engineering focus.

Completed

  • C++ ONNX Runtime backend with zero-copy Python bindings
  • CPU, CUDA, TensorRT, ROCm, OpenVINO execution providers
  • Optional low-memory runtime controls
  • Exact graph-aware spatial tiling
  • Tile-bundle packaging tool
  • Streaming rollout and NetCDF4 / Zarr / NPZ export
  • 6 built-in data-source adapters
  • Researcher-facing CLI
  • Ansible / Terraform / GCP Batch / AWS Batch playbooks
  • Validation suite: accuracy, memory, stability, historical

In Progress

  • Stabilising 0.1° inference on consumer hardware (last 5 years)
  • Published reproducible benchmark suite
  • Automatic tile-bundle generation from arbitrary global ONNX

Out of Scope (Current)

  • Approximate spatial slicing (tiling is exact-only by design)
  • Generic graph-to-grid export for arbitrary node layouts