No description available.
Google DeepMind GraphCast and GenCast
This package contains example code to run and train the weather models used in the research papers GraphCast and GenCast.
It also provides pretrained model weights, normalization statistics and example input data on Google Cloud Bucket.
Full model training requires downloading the ERA5 dataset, available from ECMWF. This can best be accessed as Zarr from Weatherbench2's ERA5 data.
Data for operational fine-tuning can similarly be accessed at Weatherbench2's HRES 0th frame data.
These datasets may be governed by separate terms and conditions or license provisions. Your use of such third-party materials is subject to any such terms and you should check that you can comply with any applicable restrictions or terms and conditions before use.
Overview of files common to models
-
autoregressive.py: Wrapper used to run (and train) the one-step predictions
-
checkpoint.py: Utils to serialize and deserialize trees. -
data_utils.py: Utils for data preprocessing. -
deeptypedgraph_net.py: General purpose deep graph neural network (GNN)
TypedGraph's where both inputs and outputs are flat
vectors of features for each of the nodes and edges.
-
gridmeshconnectivity.py: Tools for converting between regular grids on a
-
icosahedral_mesh.py: Definition of an icosahedral multi-mesh. -
losses.py: Loss computations, including latitude-weighting. -
mlp.py: Utils for building MLPs with norm conditioning layers. -
model_utils.py: Utilities to produce flat node and edge vector features
-
normalization.py: Wrapper used to normalize inputs according to historical
-
predictor_base.py: Defines the interface of the predictor, which models
-
rollout.py: Similar toautoregressive.pybut used only at inference time
-
typed_graph.py: Definition ofTypedGraph's. -
typedgraphnet.py: Implementation of simple graph neural network
TypedGraph's that can be combined to build
deeper models.
-
xarray_jax.py: A wrapper to let JAX work withxarrays. -
xarraytree.py: An implementation of tree.mapstructure that works with
xarrays.
GenCast: Diffusion-based ensemble forecasting for medium-range weather
This package provides four pretrained models:
-
GenCast 0p25deg <2019, GenCast model at 0.25deg resolution with 13
GenCast: Diffusion-based ensemble forecasting for medium-range weather
(https://arxiv.org/abs/2312.15796)
-
GenCast 0p25deg Operational <2022, GenCast model at 0.25deg resolution, with 13 pressure levels and a 6
-
GenCast 1p0deg <2019, GenCast model at 1deg resolution, with 13 pressure
GenCast 1p0deg Mini <2019, GenCast model at 1deg resolution, with 13 pressure levels and a
The best starting point is to open gencastminidemo.ipynb in Colaboratory, which gives an example of loading data, generating random weights or loading a GenCast 1p0deg Mini <2019 snapshot, generating predictions, computing the loss and computing gradients. The one-step implementation of GenCast architecture is provided in gencast.py and the relevant data, weights and statistics are in the gencast/ subdir of the Google Cloud Bucket.
Instructions for running GenCast on Google Cloud compute
cloudvm_setup.md contains detailed instructions on launching a Google Cloud TPU VM. This provides a means of running models (1-3) in the separate gencastdemocloudvm.ipynb through Colaboratory.
The document also provides instructions for running GenCast on a GPU. This requires using a different attention implementation.
Brief description of relevant library files
-
denoiser.py: The GenCast denoiser for one step predictions. -
denoisers_base.py: Defines the interface of the denoiser. -
dpmsolverplusplus2s.py: Sampler using DPM-Solver++ 2S from [1]. -
gencast.py: Combines the GenCast model architecture, wrapped as a
-
nan_cleaning.py: Wraps a predictor to allow it to work with data
-
samplers_base.py: Defines the interface of the sampler. -
samplers_utils.py: Utility methods for the sampler. -
sparse_transformer.py: General purpose sparse transformer that
TypedGraph's where both inputs and outputs are flat vectors of
features for each of the nodes and edges. predictor.py uses one of these
for the mesh GNN.
-
sparsetransformerutils.py: Utility methods for the sparse
-
transformer.py: Wraps the mesh transformer, swapping the leading
[1] DPM-Solver++: Fast Solver for Guided Sampling of Diffusion Probabilistic Models, https://arxiv.org/abs/2211.01095
GraphCast: Learning skillful medium-range global weather forecasting
This package provides three pretrained models:
-
GraphCast, the high-resolution model used in the GraphCast paper (0.25 degree
-
GraphCast_small, a smaller, low-resolution version of GraphCast (1 degree
-
GraphCast_operational, a high-resolution model (0.25 degree resolution, 13
The best starting point is to open graphcastdemo.ipynb in Colaboratory, which gives an example of loading data, generating random weights or load a pre-trained snapshot, generating predictions, computing the loss and computing gradients. The one-step implementation of GraphCast architecture, is provided in graphcast.py and the relevant data, weights and statistics are in the graphcast/ subdir of the Google Cloud Bucket.
WARNING: For backwards compatibility, we have also left GraphCast data in the top level of the bucket. These will eventually be deleted in favour of the graphcast/ subdir.
Brief description of relevant library files:
-
casting.py: Wrapper used around GraphCast to make it work using
-
graphcast.py: The main GraphCast model architecture for one-step of
-
solar_radiation.py: Computes Top-Of-the-Atmosphere (TOA) incident solar
Dependencies.
Chex, Dask, Dinosaur, Haiku, JAX, JAXline, Jraph, Numpy, Pandas, Python, SciPy, Tree, Trimesh, XArray and XArray-TensorStore.
License and Disclaimers
The Colab notebooks and the associated code are licensed under the Apache License, Version 2.0. You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0.
The model weights are made available for use under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0). You may obtain a copy of the License at: https://creativecommons.org/licenses/by-nc-sa/4.0/.
This is not an officially supported Google product.
Unless required by applicable law or agreed to in writing, all software and materials distributed here under the Apache 2.0 or CC-BY-NC-SA 4.0 licenses are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the licenses for the specific language governing permissions and limitations under those licenses.
GenCast and GraphCast are part of an experimental research project. You are solely responsible for determining the appropriateness of using or distributing GenCast, GraphCast or any outputs generated and assume all risks associated with your use or distribution of GenCast, GraphCast and outputs and your exercise of rights and permissions granted by Google to you under the relevant License. Use discretion before relying on, publishing, downloading or otherwise using GenCast, GraphCast or any outputs generated. GenCast, GraphCast or any outputs generated (i) are not based on data published by; (ii) have not been produced in collaboration with; and (iii) have not been endorsed by any government meteorological agency or department and in no way replaces official alerts, warnings or notices published by such agencies.
Copyright 2024 DeepMind Technologies Limited.
Citations
If you use this work, consider citing our papers (blog post, Science, arXiv, arxiv GenCast):
@article{lam2023learning,
title={Learning skillful medium-range global weather forecasting},
author={Lam, Remi and Sanchez-Gonzalez, Alvaro and Willson, Matthew and Wirnsberger, Peter and Fortunato, Meire and Alet, Ferran and Ravuri, Suman and Ewalds, Timo and Eaton-Rosen, Zach and Hu, Weihua and others},
journal={Science},
volume={382},
number={6677},
pages={1416--1421},
year={2023},
publisher={American Association for the Advancement of Science}
}
@article{price2023gencast,
title={GenCast: Diffusion-based ensemble forecasting for medium-range weather},
author={Price, Ilan and Sanchez-Gonzalez, Alvaro and Alet, Ferran and Andersson, Tom R and El-Kadi, Andrew and Masters, Dominic and Ewalds, Timo and Stott, Jacklynn and Mohamed, Shakir and Battaglia, Peter and Lam, Remi and Willson, Matthew},
journal={arXiv preprint arXiv:2312.15796},
year={2023}
}
Acknowledgements
The (i) GenCast and GraphCast communicate with and/or reference with the following separate libraries and packages and the colab notebooks include a few examples of ECMWFโs ERA5 and HRES data that can be used as input to the models. Data and products of the European Centre for Medium-range Weather Forecasts (ECMWF), as modified by Google. Modified Copernicus Climate Change Service information 2023. Neither the European Commission nor ECMWF is responsible for any use that may be made of the Copernicus information or data it contains. ECMWF HRES datasets Copyright statement: Copyright "ยฉ 2023 European Centre for Medium-Range Weather Forecasts (ECMWF)". Source: www.ecmwf.int License Statement: ECMWF open data is published under a Creative Commons Attribution 4.0 International (CC BY 4.0). https://creativecommons.org/licenses/by/4.0/ Disclaimer: ECMWF does not accept any liability whatsoever for any error or omission in the data, their availability, or for any loss or damage arising from their use.
Use of the third-party materials referred to above may be governed by separate terms and conditions or license provisions. Your use of the third-party materials is subject to any such terms and you should check that you can comply with any applicable restrictions or terms and conditions before use.
Contact
For feedback and questions, contact us at gencast@google.com. Any information collected via email will be used in accordance with Google's privacy policy.