Stormer
Model Overview
Stormer was jointly developed by researchers at Argonne National Laboratory and the University of California, Los Angeles (UCLA). Its core paper was published at NeurIPS 2024, a leading conference in artificial intelligence.
Paper: Scaling Transformer Neural Networks for Skillful and Reliable Medium-Range Weather Forecasting
https://arxiv.org/abs/2312.03876
Model Description
Stormer uses a standard Vision Transformer architecture and provides a streamlined deep learning model for medium-range weather forecasting.
Use Cases
| Use Case | Description |
|---|---|
| Weather forecasting training | Train Stormer on ERA5 data in HDF5 format. |
| Quick local validation | Use synthetic data to validate data loading, model training and inference, and visualization of inference results. |
| ModelScope/OneCode execution | Download the standalone model package, install its dependencies, and run the included scripts directly. |
| Multi-GPU training | Launch multi-process training with torchrun. |
Usage
1. Using OneCode
Use the OneCode online environment for an intelligent, one-click AI4S development experience:
Try one-click AI4S development with OneCode
2. Manual Setup
Hardware Requirements
- A GPU or DCU is recommended.
- A CPU can be used for import checks and connectivity validation with a minimal configuration, but full training and inference will be slow.
- DCU users must install DTK in advance. DTK 25.04.2 or later is recommended; alternatively, use the OneScience-recommended version compatible with your cluster.
Download the Model Package
hf download OneScience-Group/Stormer --local-dir ./Stormer
cd Stormer
Set Up the Runtime Environment
DCU Environment
# Activate DTK and conda first.
conda create -n onescience311 python=3.11 -y
conda activate onescience311
# Installation with uv is also supported.
pip install onescience[earth-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
GPU Environment
# 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
# Installation with uv is also supported.
pip install onescience[earth-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
Training Data
The OneScience community provides ERA5 data for training. Because of file-size constraints, the repository currently contains a self-contained data slice. Download the data with the following command and ensure that the data path in conf/config.yaml is configured correctly:
hf download --repo-type dataset OneScience-Group/ERA5 --local-dir ./data
Training
Single GPU:
python scripts/train.py
Multiple GPUs:
torchrun --nproc_per_node=8 scripts/train.py
Training saves the model_bak.pth checkpoint under data/checkpoints/.
Pre-trained Weights
This repository will provide weights trained on ERA5 reanalysis data in the weights/ directory. The weight files are being prepared and will be uploaded soon.
Inference
python scripts/inference.py
By default, inference loads data/checkpoints/model_bak.pth, and results are saved to result/output/.
Evaluation and Visualization
python scripts/result.py
Official OneScience Resources
| 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 and License
- This repository is a reproduction of the original Stormer paper.
中文说明
模型概述
Stormer 由阿贡国家实验室和加利福尼亚大学洛杉矶分校(UCLA)的研究人员共同开发。核心论文发表于人工智能领域的顶级会议 NeurIPS 2024。
论文《扩展 Transformer 神经网络以实现准确可靠的中期天气预报(Medium-Range Weather Forecasting)》
https://arxiv.org/abs/2312.03876
模型描述
Stormer 使用标准的 Vision Transformer 架构,提供简明的中期天气预报深度学习模型。
使用场景
| 使用场景 | 说明 |
|---|---|
| 天气预报(Weather forecasting)模型训练 | 使用 HDF5 格式的 ERA5 数据训练 Stormer。 |
| 本地快速验证 | 使用合成数据验证数据加载、模型训练与推理(inference)及推理结果的可视化。 |
| 在 ModelScope/OneCode 中运行 | 下载独立模型包,安装依赖后直接运行随附脚本。 |
| 多 GPU 训练 | 使用 torchrun 启动多进程训练。 |
使用方法
1. 使用 OneCode
通过 OneCode 在线环境体验智能一键 AI4S 开发。
2. 手动配置
硬件要求
- 建议使用 GPU 或 DCU。
- CPU 可用于以最小配置进行导入检查和连通性验证,但完整训练和推理的速度较慢。
- DCU 用户必须提前安装 DTK。建议使用 DTK 25.04.2 或更高版本,也可以使用 OneScience 推荐的与所在集群兼容的版本。
下载模型包
hf download OneScience-Group/Stormer --local-dir ./Stormer
cd Stormer
配置运行环境
DCU 环境
# Activate DTK and conda first.
conda create -n onescience311 python=3.11 -y
conda activate onescience311
# Installation with uv is also supported.
pip install onescience[earth-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
GPU 环境
# 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
# Installation with uv is also 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
训练
单 GPU
python scripts/train.py
多 GPU
torchrun --nproc_per_node=8 scripts/train.py
训练将 model_bak.pth 模型权重(检查点)(checkpoint)保存到 data/checkpoints/ 下。
预训练权重
本仓库将在 weights/ 目录中提供基于 ERA5 再分析(reanalysis)数据训练得到的权重。权重文件正在准备中,即将上传。
推理
python scripts/inference.py
推理默认加载 data/checkpoints/model_bak.pth,结果保存到 result/output/。
评估与可视化
python scripts/result.py
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 |
引用与许可证
- 本仓库是对 Stormer 原始论文的复现。
- Downloads last month
- 10