Ai2_Climate_Emulator
Model Introduction
The AI2 Climate Emulator (ACE) is a global atmospheric state emulator proposed by the Allen Institute for AI (AI2).
Paper: ACE: A fast, scalable foundation model for the atmosphere
https://arxiv.org/abs/2310.02074
Model Description
This project implements the spherical Fourier neural operator (SFNO) forward graph with PyTorch and torch_harmonics. It takes the atmospheric state and external forcings at the current six-hour time step as input, predicts the state at the next time step, and can generate multi-step climate or weather fields autoregressively.
Use Cases
| Scenario | Description |
|---|---|
| Global atmospheric state simulation | Train a one-step ACE model with FV3GFS data following the 40/44-channel protocol. |
| Local quick validation | Generate synthetic NPZ files with scripts/fake_data.py to check the training, inference, and result-visualization pipeline. |
| ModelScope / OneCode execution | Download the standalone model package, install dependencies, and run the scripts directly. |
| Multi-GPU training | Launch PyTorch DDP with 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
- A GPU or DCU is recommended.
- CPU can be used for import and small-scale connectivity verification; full training and inference will be slow.
- 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/Ai2_Climate_Emulator --local-dir ./Ai2_Climate_Emulator
cd Ai2_Climate_Emulator
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 ACE paper uses an ensemble of 11 FV3GFS initial conditions: 10 members for training and one member for validation. The simulations are written at six-hour intervals and regridded to a Gaussian latitude-longitude grid. The original FV3GFS files and NOAA fregrid are not included in this model package; users must prepare and convert them to the NPZ format required by the project:
inputs: [N, 40, H, W]
targets: [N, 44, H, W]
When real data is unavailable, generate synthetic data for pipeline validation:
python scripts/fake_data.py
Training
Single GPU:
python scripts/train.py
Multi-GPU:
torchrun --nproc_per_node=8 scripts/train.py
Training checkpoints are written to data/checkpoint/model_bak.pt by default.
Training Weights
This repository provides weights trained on FV3GFS data in the weight/ folder. The weight files will be uploaded soon and are expected to be available in the near future.
Inference
python scripts/inference.py
Inference results are saved to output/infer/rollout.npz by default.
Evaluation and Visualization
python scripts/result.py
Area-weighted RMSE, global mean bias, and PNG figures are written to output/pic/ by default.
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 ACE model.
中文说明
模型简介
AI2 Climate Emulator(ACE)是由艾伦人工智能研究所(AI2)提出的全球大气状态模拟器。
论文:ACE:一种快速、可扩展的大气基础模型
https://arxiv.org/abs/2310.02074
模型描述
本项目使用 PyTorch 和 torch_harmonics 实现球面傅里叶神经算子(spherical Fourier neural operator,SFNO)的前向计算图。模型以当前六小时时间步的大气状态和外部强迫为输入,预测下一时间步的状态,并可通过自回归生成多步气候场或天气场。
使用场景
| 场景 | 说明 |
|---|---|
| 全球大气状态模拟 | 按照 40/44 通道规范,使用 FV3GFS 数据训练单步 ACE 模型。 |
| 本地快速验证 | 用 scripts/fake_data.py 生成合成 NPZ 文件,检查训练、推理(inference)和结果可视化流程。 |
| 在 ModelScope / OneCode 中运行 | 下载独立模型包,安装依赖后直接运行脚本。 |
| 多 GPU 训练 | 通过 torchrun 启动 PyTorch DDP。 |
使用指南
1. OneCode 使用方法
通过 OneCode 在线环境体验智能一键 AI4S 编程。
2. 手动安装与使用
硬件要求
- 建议使用 GPU 或 DCU。
- CPU 可用于导入和小规模连通性验证,完整训练和推理速度较慢。
- DCU 用户必须提前安装 DTK。建议使用 DTK 25.04.2 或更高版本,或使用 OneScience 推荐的与所在集群匹配的版本。
下载模型包
hf download OneScience-Group/Ai2_Climate_Emulator --local-dir ./Ai2_Climate_Emulator
cd Ai2_Climate_Emulator
安装运行环境
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
训练数据简介
ACE 论文使用由 11 个 FV3GFS 初始条件组成的集合,训练使用 10 个成员,验证使用一个成员。模拟结果每隔六小时写入,并重新映射到高斯经纬度网格。本模型包未附带原始 FV3GFS 文件和 NOAA fregrid,用户需要自行准备并转换成项目要求的 NPZ 格式。
inputs: [N, 40, H, W]
targets: [N, 44, H, W]
缺少真实数据时,可以生成合成数据验证流程。
python scripts/fake_data.py
训练
单 GPU
python scripts/train.py
多 GPU
torchrun --nproc_per_node=8 scripts/train.py
训练的模型权重(检查点)(checkpoint)默认写入 data/checkpoint/model_bak.pt。
训练权重
本仓库在 weight/ 文件夹中提供基于 FV3GFS 数据训练得到的权重。权重文件即将上传,预计近期可用。
推理
python scripts/inference.py
推理结果默认保存到 output/infer/rollout.npz。
评估与可视化
python scripts/result.py
面积加权 RMSE、全球平均偏差和 PNG 图像默认写入 output/pic/。
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 |
引用与许可证
- 本仓库复现了 ACE 模型。
- Downloads last month
- 23