StormCast
Model Introduction
StormCast is a generative regional weather forecasting model proposed by NVIDIA, targeting high-resolution nowcasting of mesoscale convective weather.
Paper: StormCast: A Machine Learning Method for Meso-β-Scale Convection-resolving Weather Forecasting
https://arxiv.org/abs/2408.10958
Model Description
StormCast constrains the evolution of regional states with large-scale weather backgrounds, and uses a generative diffusion approach to supplement the fine-scale structures that deterministic forecasts struggle to represent.
Use Cases
| Scenario | Description |
|---|---|
| Two-Stage Weather Forecast Training | Train a deterministic regression model and a conditional residual diffusion model in sequence. |
| Local Quick Validation | Use synthetic data to verify data loading, model training, inference, and inference result visualization. |
| ModelScope / OneCode Execution | Download as a standalone model package, install dependencies, and run scripts directly. |
| Multi-GPU Training | Launch multi-process training via torchrun. |
Usage Guide
1. OneCode Usage
Experience intelligent one-click AI4S programming through the OneCode online environment:
Click to Experience Intelligent One-Click AI4S Programming
2. Manual Installation and Usage
Hardware Requirements
- Training and inference require a GPU or DCU recognized by PyTorch; CPU can be used to generate synthetic data and verify configuration, but cannot run the current training and inference scripts.
- Multi-GPU training uses the NCCL backend. Please make sure the device driver, communication libraries, and PyTorch version are compatible.
- DCU users must install DTK in advance. DTK 25.04.2 or above, or the OneScience recommended version matching your cluster, is recommended.
Download the Model Package
hf download OneScience-Group/StormCast --local-dir ./StormCast
cd StormCast
Install the Runtime Environment
DCU Environment
# Please activate DTK and CONDA first
conda create -n onescience311 python=3.11 -y
conda activate onescience311
# uv installation is supported
pip install onescience[earth-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
GPU Environment
# Please activate CONDA first
conda create -n onescience311 python=3.11 -y libstdcxx-ng=12 libgcc-ng=12 gcc_linux-64=12 gxx_linux-64=12
conda activate onescience311
# uv installation is supported
pip install onescience[earth-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
Training Data Introduction
The OneScience community provides ERA5 data for training (due to file size limits, the current repository contains a slice of the full dataset). Users can download it with the command below and confirm that the data path in conf/config.yaml is set correctly:
hf download --repo-type dataset OneScience-Group/ERA5 --local-dir ./data
Generate Synthetic Data for Pipeline Validation
python scripts/fake_data.py
Synthetic data is only used to verify the data protocol and program flow; it does not represent the model's scientific forecasting capability.
Training
Single GPU:
# Train the deterministic regression model; weights are saved to data/checkpoint/regression/model_bak.pt by default
python scripts/train.py --stage regression
# Train the residual diffusion model; weights are saved to data/checkpoint/diffusion/model_bak.pt by default
python scripts/train.py --stage diffusion
Multi-GPU
# Train the deterministic regression model
torchrun --nproc_per_node=2 scripts/train.py --stage regression
# Train the residual diffusion model
torchrun --nproc_per_node=2 scripts/train.py --stage diffusion
Training Weights
This repository provides weights trained on ERA5 reanalysis data in the weights/ folder. The weight files will be uploaded soon and are expected to be available in the near future.
Inference
Run autoregressive prediction with the default configuration and the two sets of weights saved during training:
python scripts/inference.py
Evaluation and Visualization
python scripts/result.py
Plots are saved to outputs/inference/plots/ by default.
OneScience Official Information
| Platform | OneScience Main Repository | Skills Repository |
|---|---|---|
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |
Citation & License
- This repository is a reproduction of the original StormCast paper.
中文说明
模型简介
StormCast 是 NVIDIA 提出的生成式区域天气预报(weather forecasting)模型,面向中尺度对流性天气的高分辨率临近预报(nowcasting)。
论文《StormCast:一种用于显式解析中尺度 β 对流的天气预报机器学习方法》
https://arxiv.org/abs/2408.10958
模型描述
StormCast 通过大尺度天气背景约束区域状态演变,并采用生成式扩散方法补充确定性预报难以表示的精细尺度结构。
使用场景
| 场景 | 说明 |
|---|---|
| 两阶段天气预报模型训练 | 依次训练确定性回归模型和条件残差扩散模型。 |
| 本地快速验证 | 使用合成数据验证数据加载、模型训练、推理(inference)和推理结果的可视化。 |
| 在 ModelScope / OneCode 中运行 | 下载独立模型包,安装依赖后直接运行脚本。 |
| 多 GPU 训练 | 通过 torchrun 启动多进程训练。 |
使用指南
1. OneCode 使用方法
通过 OneCode 在线环境体验智能一键 AI4S 编程。
2. 手动安装与使用
硬件要求
- 训练和推理需要 PyTorch 识别的 GPU 或 DCU。CPU 可用于生成合成数据和验证配置,但无法运行当前的训练和推理脚本。
- 多 GPU 训练使用 NCCL 后端。请确保设备驱动程序、通信库和 PyTorch 版本兼容。
- DCU 用户必须提前安装 DTK。建议使用 DTK 25.04.2 或更高版本,或 OneScience 推荐的与所在集群匹配的版本。
下载模型包
hf download OneScience-Group/StormCast --local-dir ./StormCast
cd StormCast
安装运行环境
DCU 环境
# Please activate DTK and CONDA first
conda create -n onescience311 python=3.11 -y
conda activate onescience311
# uv installation is supported
pip install onescience[earth-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
GPU 环境
# Please activate CONDA first
conda create -n onescience311 python=3.11 -y libstdcxx-ng=12 libgcc-ng=12 gcc_linux-64=12 gxx_linux-64=12
conda activate onescience311
# uv installation is supported
pip install onescience[earth-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
训练数据简介
OneScience 社区提供用于训练的 ERA5 数据(受文件大小限制,当前仓库仅包含完整数据集的一部分)。用户可以通过以下命令下载数据,并确认 conf/config.yaml 中的数据路径设置正确。
hf download --repo-type dataset OneScience-Group/ERA5 --local-dir ./data
生成用于验证流程的合成数据
python scripts/fake_data.py
合成数据仅用于验证数据协议和程序流程,无法代表模型的科学预报能力。
训练
单 GPU
# Train the deterministic regression model; weights are saved to data/checkpoint/regression/model_bak.pt by default
python scripts/train.py --stage regression
# Train the residual diffusion model; weights are saved to data/checkpoint/diffusion/model_bak.pt by default
python scripts/train.py --stage diffusion
多 GPU
# Train the deterministic regression model
torchrun --nproc_per_node=2 scripts/train.py --stage regression
# Train the residual diffusion model
torchrun --nproc_per_node=2 scripts/train.py --stage diffusion
训练权重
本仓库在 weights/ 文件夹中提供基于 ERA5 再分析(reanalysis)数据训练得到的权重。权重文件即将上传,预计近期可用。
推理
使用默认配置和训练期间保存的两组权重运行自回归预测。
python scripts/inference.py
评估与可视化
python scripts/result.py
图表默认保存到 outputs/inference/plots/。
OneScience 官方信息
| 平台 | OneScience 主仓库 | Skills 仓库 |
|---|---|---|
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |
引用与许可证
- 本仓库是对 StormCast 原始论文的复现。
- Downloads last month
- 25