Skip to content

Commit 368fba0

Browse files
rodrigoalmeida94Rodrigo AlmeidaloliverhennighNickGeneva
authored
Add GraphCast 1 degree model (#256)
* Added GraphCast small model * Added install group * Update WB2 data source with needed variables * Added tests and docs --------- Co-authored-by: Rodrigo Almeida <[email protected]> Co-authored-by: Oliver <[email protected]> Co-authored-by: Nicholas Geneva <[email protected]>
1 parent 0d3f9eb commit 368fba0

File tree

15 files changed

+2424
-274
lines changed

15 files changed

+2424
-274
lines changed

.gitlab-ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ pytest:
8686
extends:
8787
- .earth2studio:test:base
8888
- .test:cache
89+
variables:
90+
XLA_PYTHON_CLIENT_ALLOCATOR: platform
91+
XLA_PYTHON_CLIENT_PREALLOCATE: false
92+
# https://docs.jax.dev/en/latest/gpu_memory_allocation.html
8993
rules:
9094
- if: $PIPELINE_TEST_ALL == "true"
9195
when: on_success

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010

1111
### Added
1212

13+
- Added Graphcast 1 degree model
14+
1315
### Changed
1416

1517
### Deprecated

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ install:
55
.PHONY: install-docker
66
install-docker:
77
uv pip install --system --break-system-packages .[all,aifs] --group dev
8-
uv pip install --system --break-system-packages zarr==3.0.7
8+
uv pip install --system --break-system-packages zarr~=3.0
99

1010
.PHONY: setup-ci
1111
setup-ci:

docs/modules/models.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Thus are typically used to generate forecast predictions.
3333
models.px.FCN
3434
models.px.FengWu
3535
models.px.FuXi
36+
models.px.GraphCastSmall
3637
models.px.InterpModAFNO
3738
models.px.Pangu24
3839
models.px.Pangu6

docs/userguide/about/install.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,26 @@ pip install earth2studio[fuxi]
241241
uv add earth2studio --extra fuxi
242242
```
243243

244+
:::
245+
::::
246+
:::::
247+
:::::{tab-item} GraphCast
248+
Notes: Requires JAX with CUDA support and the GraphCast package.
249+
250+
::::{tab-set}
251+
:::{tab-item} pip
252+
253+
```bash
254+
pip install earth2studio[graphcast]
255+
```
256+
257+
:::
258+
:::{tab-item} uv
259+
260+
```bash
261+
uv add earth2studio --extra graphcast
262+
```
263+
244264
:::
245265
::::
246266
:::::

earth2studio/lexicon/arco.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class ARCOLexicon(metaclass=LexiconType):
9494
"msl": "mean_sea_level_pressure::",
9595
"tcwv": "total_column_water_vapour::",
9696
"tp": "total_precipitation::",
97+
"lsm": "land_sea_mask::",
9798
"z": "geopotential_at_surface::",
9899
}
99100
VOCAB.update({f"u{level}": f"u_component_of_wind::{level}" for level in LEVELS})

earth2studio/lexicon/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def __getitem__(cls, val: str) -> tuple[str, Callable]:
4545
"fg10m": "maximum 10 m wind gust since previous post-processing",
4646
"lsm": "land-sea mask",
4747
"zsl": "geopotential at mean sea-level",
48+
"z": "geopotential at surface",
4849
"uvcossza": "cosine of solar zenith angle",
4950
"refc": "Maximum/Composite radar reflectivity (dB)",
5051
"csnow": "categorical snow",

earth2studio/lexicon/wb2.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ class WB2Lexicon(metaclass=LexiconType):
4040
"v10m": "10m_v_component_of_wind::",
4141
"t2m": "2m_temperature::",
4242
"sp": "surface_pressure::",
43+
"lsm": "land_sea_mask::",
44+
"z": "geopotential_at_surface::",
4345
"msl": "mean_sea_level_pressure::",
4446
"sst": "sea_surface_temperature::",
4547
"tcwv": "total_column_water_vapour::",

earth2studio/models/px/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from earth2studio.models.px.fcn import FCN
2525
from earth2studio.models.px.fengwu import FengWu
2626
from earth2studio.models.px.fuxi import FuXi
27+
from earth2studio.models.px.graphcast_small import GraphCastSmall
2728
from earth2studio.models.px.interpmodafno import InterpModAFNO
2829
from earth2studio.models.px.pangu import Pangu3, Pangu6, Pangu24
2930
from earth2studio.models.px.persistence import Persistence

0 commit comments

Comments
 (0)