Skip to main content

TornadoGCM Logo

TornadoGCM

TornadoGCM is a pure-PyTorch reimplementation of NeuralGCM (Google Research) featuring a novel Precision-Zoned Hybrid Architecture (PZHA) with automated mixed-precision scheduling for GPU-accelerated global weather forecasting.

Disclaimer: This project is an independent research port. It is not affiliated with or endorsed by Google Research or DeepMind. All trademarks belong to their respective owners.


Features

  • Pure PyTorch — full GPU support, DDP/FSDP distributed training, torch.compile compatibility
  • PZHA mixed-precision — four precision zones (Z0 FP64, Z1 TF32, Z2 FP64, Z3 BF16) matched to physical/neural computation roles
  • SDA control plane — Self-adaptive Dynamic Accuracy scheduler automatically adjusts precision zones during training
  • JAX checkpoint loader — load pre-trained NeuralGCM JAX weights directly, no manual conversion script needed
  • Triton acceleration — optional fused spherical-harmonic transform kernels for A100/H100
  • Multiple resolutions — tested configs for 0.7°, 1.4°, and 2.8° grids

Architecture Overview

┌─────────────────────────────────────────────────────────────────────────┐
│                         AtmosphereModel (facade)                        │
├───────────────┬─────────────────────────┬───────────────────────────────┤
│  Encoder      │   NeuralGCMModel (step)  │   Decoder                    │
│  Z3 (BF16)    │  ┌──────────────────┐   │   Z3 (BF16)                  │
│               │  │ Dycore  Z1 (TF32)│   │                              │
│               │  │ Neural  Z3 (BF16)│   │                              │
│               │  │ Fixer   Z2 (FP64)│   │                              │
│               │  └──────────────────┘   │                              │
└───────────────┴─────────────────────────┴───────────────────────────────┘
                              ↕ SDA Controller (precision scheduler)
Zone Role Default dtype
Z0 Conservation math, initialization FP64
Z1 Spectral dycore (SHT, primitive equations) TF32
Z2 Energy/mass/hydrology fixers FP64
Z3 Neural parameterizations (MLP/CNN/Transformer) BF16

Installation

# Core (CPU/GPU)
pip install tornado-gcm

# With data I/O (xarray, zarr)
pip install "tornado-gcm[data]"

# With Triton GPU kernels
pip install "tornado-gcm[gpu]"

# Development
pip install "tornado-gcm[dev]"
pre-commit install

Requirements: Python ≥ 3.9, PyTorch ≥ 2.1, CUDA 11.8+ (for GPU).


Quick Start (5 minutes)

1. Load a pre-trained JAX checkpoint and run a forecast

import torch
from tornado_gcm.model.jax_checkpoint_loader import load_jax_checkpoint
from tornado_gcm.inference.runner import MPInference
from tornado_gcm.precision.sda import SDAConfig

# Load SDA config (choose resolution)
sda_cfg = SDAConfig.from_yaml("configs/sda_neuralgcm_2.8deg_full.yaml")

# Convert JAX weights → PyTorch
model = load_jax_checkpoint("path/to/neuralgcm_checkpoint", device="cuda")

# Build mixed-precision inference runner
runner = MPInference(model=model, device="cuda")

# Run 10-day (40-step × 6h) forecast
# initial_state: a State dataclass on GPU
trajectory = runner.rollout(initial_state, steps=40)

2. CLI

# Inference
tornado-gcm infer \
  --config configs/sda_neuralgcm_1.4deg.yaml \
  --checkpoint model.pt \
  --input era5_20200101.zarr \
  --output forecast.zarr \
  --steps 40

# Benchmark
tornado-gcm benchmark \
  --config configs/sda_neuralgcm_2.8deg_full.yaml \
  --steps 20 \
  --report bench.txt

# Training (requires ERA5 data)
tornado-gcm train \
  --config configs/sda_neuralgcm_1.4deg.yaml \
  --jax-weights neuralgcm_checkpoint \
  --steps 50000 \
  --checkpoint output/run1.pt

Performance

Tested on a single NVIDIA A100 80 GB (CUDA 12.1, PyTorch 2.2):

Resolution Memory (GB) Steps/s vs JAX (TPU v4)
2.8° 8.2 4.1 ~0.9×
1.4° 24.7 1.3 ~0.85×
0.7° 68.4 0.35 ~0.75×

Note: JAX numbers from original paper on TPU v4-8 pod.


Project Structure

tornado_gcm/
├── core/          # Spectral dynamics, coordinates, time integration (Z0/Z1)
├── neural/        # NN parameterizations, encoders/decoders, towers (Z3)
├── model/         # Model assembly, JAX checkpoint loader
├── precision/     # PZHA policy, SDA controller, Triton accelerator
├── training/      # Trainers, losses, evaluation, data loading
├── inference/     # MPInference, SDAInference, production runner
├── distributed/   # DDP / DTensor sharding
├── configs/       # Ready-to-use SDA YAML configs (0.7°/1.4°/2.8°)
└── cli.py         # Click CLI entry point

Attribution

This project is a PyTorch port of NeuralGCM by Kochkov et al.:

Kochkov, D., Yuval, J., Langmore, I., Norgaard, P., Smith, J., Mooers, G., ... & Hoyer, S. (2024). Neural general circulation models for weather and climate. Nature, 632, 1060–1066. https://doi.org/10.1038/s41586-024-07744-y

Original JAX code: https://github.com/google-research/neuralgcm (Apache 2.0)

The PZHA mixed-precision framework, SDA control plane, and PyTorch-specific optimizations are original contributions of this project.


Contributing

See CONTRIBUTING.md.


License

Metadata

Release files for tornado-gcm 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tornado-gcm 0.1.0
File Size Uploaded Provenance
tornado_gcm-0.1.0.tar.gz 303.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tornado-gcm 0.1.0
File Interpreter ABI Platform
tornado_gcm-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 652.0 kB

Release files / tornado_gcm-0.1.0.tar.gz

Download URL tornado_gcm-0.1.0.tar.gz
Size 303.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c55076fec5f579cf9c11d729332875331017859612540679362c19a2c8b03d4b
BLAKE2b-256 checksum
How to use checksums
1892cdcedbb0f827cd8a9b451b5edf55a102c3bd0b82312f4c4046ac22a9bc0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.7

Release files / tornado_gcm-0.1.0-py3-none-any.whl

Download URL tornado_gcm-0.1.0-py3-none-any.whl
Size 348.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1c1871de02cf7bf29ed484ff804f43073e65edec0f02d2612da04d4660ac8ff
BLAKE2b-256 checksum
How to use checksums
f260d0bbf2fb6108f4e0ada1cafc96b1fb2bfa6f0c2ceec01ba4f5b808a5077c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.7

Security for tornado-gcm 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page