--- license: apache-2.0 language: - en tags: - OneScience - Earth Science - Global Atmospheric Emulation - Neural Operator - Climate Simulation - Physical Constraints frameworks: PyTorch ---
ACE2
# Model Introduction ACE2 autoregressively simulates weather, climate variability, and forced responses at six-hour intervals from global atmospheric states and external forcing such as sea-surface temperature. Hard physical corrections constrain dry-air mass and moisture budgets, supporting fast simulations from weather scales to long-term climate statistics. Paper: ACE2: accurately learning subseasonal to decadal atmospheric variability and forced responses https://doi.org/10.1038/s41612-025-01090-0 # Model Description The method was proposed by teams from the Allen Institute for AI, the Geophysical Fluid Dynamics Laboratory, and collaborating institutions. The paper trains separate models on ERA5 reanalysis and SHiELD historical atmospheric simulations. ACE2 uses a spherical Fourier neural operator to learn global atmospheric transitions with hard dry-air-mass and moisture-budget corrections. The model supports six-hour autoregressive atmospheric emulation and climate-statistics analysis on a one-degree global grid. # Use Cases | Use Case | Description | | :---: | :--- | | Global atmospheric emulation | Run six-hour autoregressive forecasts on a one-degree grid. | | Physically constrained simulation | Validate hard dry-air-mass and global-moisture constraints. | | Local engineering validation | Validate full-grid, 50-channel, eight-level structured synthetic data. | | ModelScope/OneCode execution | Validate data, training, inference, atmospheric metrics, and evaluation. | | Multi-GPU training | Validate distributed training and checkpoint workflows through `torchrun`. | # Usage Instructions ## 1.OneCode [Try intelligent, one-click AI4S programming](https://web-2069360198568017922-iaaj.ksai.scnet.cn:58043/home) ## 2. Download and Installation ```bash hf download OneScience-Group/ACE2 --local-dir ./ACE2 cd ACE2 ``` ### Environment Dependencies **Hardware Requirements** - A GPU or DCU is recommended. - A CPU can be used for connectivity validation with the default small-sample configuration. - DCU users must install DTK in advance. DTK 25.04.2 or later, or the OneScience-recommended version matching the current cluster, is recommended. **DCU Environment** ```bash # Activate DTK and Conda first conda create -n onescience311 python=3.11 -y conda activate onescience311 pip install onescience[earth-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai ``` **GPU Environment** ```bash # 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 pip install onescience[earth-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai ``` ### Training Data This repository uses a small synthetic dataset for engineering validation, including global atmospheric states, external forcing, 50 state channels, eight vertical levels, six-hour temporal relationships, and the real `[N,T,50,180,360]` dimensions. The synthetic data retain the paper's grid, channels, levels, and temporal specification while reducing samples, model scale, and epochs; the 50-channel ledger is an engineering interpretation of the main text. These data validate SFNO, hard corrections, training, inference, and evaluation only and do not represent official ERA5 or SHiELD distributions and scale. ```bash python scripts/fake_data.py ``` ### Training For single-GPU training, use: ```bash python scripts/train.py ``` For multi-GPU training, use: ```bash torchrun --nproc_per_node=8 --nnodes=1 --rdzv_id=1000 --rdzv_backend=c10d --max_restarts=0 --master_addr="localhost" --master_port=29500 scripts/train.py ``` Training uses a two-step six-hour autoregressive MSE objective followed by hard dry-air-mass and moisture corrections. The default reduces SFNO width, spectral modes, and epochs without reducing data dimensions or the two-step target. Training artifacts are saved to: ```text result/checkpoints/ace2.pt result/training/metrics.json ``` ### Trained Weights The paper provides an official ACE2-ERA5 checkpoint at https://doi.org/10.57967/hf/5377. It is not bundled under `weight/`, and this compact model does not claim checkpoint compatibility. ### Inference ```bash python scripts/inference.py ``` Inference loads the local checkpoint and takes an initial global atmospheric state plus time-varying external forcing. It autoregressively generates atmospheric states at six-, twelve-, and eighteen-hour leads and applies physical correction after every step. Outputs retain 50 channels, the `180×360` grid, and lead-time ordering. Inference results are saved to: ```text result/output/predictions.npz ``` ### Evaluation and Visualization ```bash python scripts/result.py ``` Evaluation computes latitude-weighted RMSE, global-mean R², persistence skill, and dry-mass and moisture-closure errors. It saves structured model, baseline, and conservation results and generates a comparison of forecast errors and conservation residuals. Synthetic-data results validate engineering only and do not represent formal paper performance. Evaluation results are saved to: ```text result/evaluation/metrics.json result/evaluation/comparison.png ``` # Official OneScience 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 and License This repository is an independent engineering reproduction of the public ACE2 specifications, with code licensed under the Apache License 2.0. The original paper is licensed under CC BY 4.0; the paper, official model weights, ERA5 data, and SHiELD data remain subject to the licenses and terms of their respective projects. --- # 中文说明 ## 模型简介 ACE2 根据全球大气状态和海表温度等外部强迫,以六小时间隔自回归模拟天气、气候变率和受迫响应。通过硬性物理校正约束干空气质量和水分收支,支持从天气尺度到长期气候统计的快速模拟。 论文:ACE2:准确学习次季节(subseasonal)至年代际尺度的大气变率和受迫响应 https://doi.org/10.1038/s41612-025-01090-0 ## 模型描述 该方法由艾伦人工智能研究所、地球物理流体动力学实验室及合作机构的团队提出。论文分别采用 ERA5 再分析(reanalysis)数据和 SHiELD 历史大气模拟数据训练模型。ACE2 使用球面傅里叶神经算子(spherical Fourier neural operator)学习全球大气状态转移,并对干空气质量和水分收支施加硬性校正。模型支持在一度全球网格上进行六小时间隔的自回归大气模拟和气候统计分析。 ## 使用场景 | 使用场景 | 说明 | | :---: | :--- | | 全球大气模拟 | 在一度网格上运行六小时间隔的自回归预报。 | | 物理约束模拟 | 验证干空气质量和全球水分的硬约束。 | | 本地工程验证 | 验证包含完整网格、50 个通道和八个层级的结构化合成数据。 | | ModelScope/OneCode 运行 | 验证数据、训练、推理(inference)、大气指标和评估。 | | 多 GPU 训练 | 通过 `torchrun` 验证分布式训练和模型权重(检查点)(checkpoint)工作流。 | ## 使用指南 ### 1.OneCode [体验智能一键 AI4S 编程](https://web-2069360198568017922-iaaj.ksai.scnet.cn:58043/home) ### 2. 下载与安装 ```bash hf download OneScience-Group/ACE2 --local-dir ./ACE2 cd ACE2 ``` #### 环境依赖 **硬件要求** - 建议使用 GPU 或 DCU。 - 可使用 CPU 在默认小样本配置下进行连通性验证。 - DCU 用户必须提前安装 DTK。建议使用 DTK 25.04.2 或更高版本,或使用 OneScience 推荐的与当前集群匹配的版本。 **DCU 环境** ```bash # Activate DTK and Conda first conda create -n onescience311 python=3.11 -y conda activate onescience311 pip install onescience[earth-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai ``` **GPU 环境** ```bash # 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 pip install onescience[earth-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai ``` #### 训练数据 本仓库使用小型合成数据集进行工程验证,包含全球大气状态、外部强迫、50 个状态通道、八个垂直层、六小时间隔的时序关系以及实际的 `[N,T,50,180,360]` 维度。合成数据保留论文中的网格、通道、层级及时间设置,缩减了样本数量、模型规模和训练轮次。50 个通道的清单是对论文正文的工程化解读。这些数据仅用于验证 SFNO、硬性校正、训练、推理和评估,无法代表官方 ERA5 或 SHiELD 的分布和规模。 ```bash python scripts/fake_data.py ``` #### 训练 单 GPU 训练 ```bash python scripts/train.py ``` 多 GPU 训练 ```bash torchrun --nproc_per_node=8 --nnodes=1 --rdzv_id=1000 --rdzv_backend=c10d --max_restarts=0 --master_addr="localhost" --master_port=29500 scripts/train.py ``` 训练采用两步六小时间隔的自回归 MSE 目标,随后对干空气质量和水分进行硬性校正。默认配置缩减 SFNO 宽度、频谱模态和训练轮次,保留数据维度和两步目标。训练产物保存到以下位置。 ```text result/checkpoints/ace2.pt result/training/metrics.json ``` #### 训练权重 论文在 https://doi.org/10.57967/hf/5377 提供了官方 ACE2-ERA5 模型权重(检查点)。`weight/` 下未附带该权重,且此紧凑模型未声称与该权重兼容。 #### 推理 ```bash python scripts/inference.py ``` 推理加载本地模型权重(检查点),以初始全球大气状态和随时间变化的外部强迫为输入。模型以自回归方式生成六、十二和十八小时预报时效的大气状态,并在每一步后进行物理校正。输出保留 50 个通道、`180×360` 网格和预报时效顺序。推理结果保存到以下位置。 ```text result/output/predictions.npz ``` #### 评估与可视化 ```bash python scripts/result.py ``` 评估计算纬度加权的 RMSE、全球平均 R²、持续性预报技巧,以及干空气质量和水分的闭合误差。评估保存结构化的模型、基线和守恒结果,并比较预报误差和守恒残差。合成数据结果仅用于工程验证,无法代表论文中的正式性能。评估结果保存到以下位置。 ```text result/evaluation/metrics.json result/evaluation/comparison.png ``` ## 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 | ## 引用与许可证 本仓库是对公开 ACE2 规范的独立工程复现,代码采用 Apache License 2.0 许可。 原始论文采用 CC BY 4.0 许可。论文、官方模型权重、ERA5 数据及 SHiELD 数据仍受各自项目的许可证和条款约束。