OneForecast

Model Introduction

OneForecast was developed by the team of Prof. Xiaomeng Huang in the Department of Earth System Science at Tsinghua University, in collaboration with multiple institutions. The paper has been accepted by ICML 2025.

Paper: OneForecast: A Universal Framework for Global and Regional Weather Forecasting

https://arxiv.org/abs/2502.00338

Model Description

OneForecast is a universal framework for nested global-regional weather forecasting based on graph neural networks (GNNs). Its core goal is to address the challenges of existing AI weather models in balancing low-resolution global forecasts with high-resolution regional forecasts, as well as issues such as over-smoothing in extreme event forecasting.

Use Cases

Scenario Description
Global Weather Forecast Training Train the single-step OneForecast model using ERA5 HDF5 data.
Local Quick Validation Use synthetic data to verify the data protocol, model construction, training, inference, and result visualization.
Multi-GPU Training Data-parallel training on multiple GPUs/DCUs via PyTorch DDP and torchrun.
ModelScope / OneCode Execution Download as a standalone model package, install the OneScience dependencies, and run.

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/OneForecast --local-dir ./OneForecast
cd OneForecast

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

Synthetic data is only used to verify the data protocol and program flow; it does not represent scientific forecast quality:

python scripts/fake_data.py

Training

Single GPU:

python scripts/train.py

Training starts from random initialization by default and saves the model to data/checkpoint/model_bak.tar.

Multi-GPU:

torchrun --nproc-per-node=4 scripts/train.py

Fine-tuning

Fine-tuning starts from the training checkpoint data/checkpoint/model_bak.tar by default and saves the result to data/checkpoint/model_finetuned.tar:

python scripts/finetune.py

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

Inference loads the training checkpoint data/checkpoint/model_bak.tar by default, uses the test-year data, and writes predictions to outputs/predictions/:

python scripts/inference.py --config conf/config.yaml

Result Visualization

python scripts/result.py

OneScience Official Information

Citation & License

  • This repository is a reproduction of the original OneForecast paper.

中文说明

模型简介

OneForecast 由清华大学地球系统科学系黄小猛教授团队联合多家机构开发。论文已被 ICML 2025 接收。

论文:OneForecast:面向全球和区域天气预报(weather forecasting)的通用框架

https://arxiv.org/abs/2502.00338

模型描述

OneForecast 是基于图神经网络(GNNs)的全球与区域嵌套天气预报通用框架。其核心目标是解决现有 AI 天气模型在兼顾低分辨率全球预报与高分辨率区域预报方面的难题,以及极端事件预报过度平滑等问题。

使用场景

场景 说明
全球天气预报模型训练 使用 ERA5 HDF5 数据训练单步 OneForecast 模型。
本地快速验证 使用合成数据验证数据规范、模型构建、训练、推理(inference)和结果可视化。
多 GPU 训练 通过 PyTorch DDP 和 torchrun 在多个 GPU/DCU 上进行数据并行训练。
在 ModelScope / OneCode 中运行 下载独立模型包,安装 OneScience 依赖后运行。

使用指南

1. OneCode 使用方法

通过 OneCode 在线环境体验智能一键 AI4S 编程。

点击体验智能一键 AI4S 编程

2. 手动安装与使用

硬件要求

  • 建议使用 GPU 或 DCU。
  • CPU 可用于导入和小规模连通性验证,完整训练和推理速度较慢。
  • DCU 用户必须提前安装 DTK。建议使用 DTK 25.04.2 或更高版本,或使用 OneScience 推荐的与所在集群匹配的版本。

下载模型包

hf download OneScience-Group/OneForecast --local-dir ./OneForecast
cd OneForecast

安装运行环境

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

python scripts/train.py

训练默认从随机初始化开始,并将模型保存到 data/checkpoint/model_bak.tar。

多 GPU

torchrun --nproc-per-node=4 scripts/train.py

微调(fine-tuning)

微调默认从训练得到的模型权重(检查点)(checkpoint) data/checkpoint/model_bak.tar 开始,并将结果保存到 data/checkpoint/model_finetuned.tar。

python scripts/finetune.py

训练权重

本仓库在 weights/ 文件夹中提供基于 ERA5 再分析(reanalysis)数据训练得到的权重。权重文件即将上传,预计近期可用。

推理

推理默认加载训练得到的模型权重(检查点) data/checkpoint/model_bak.tar,使用测试年份的数据,并将预测写入 outputs/predictions/。

python scripts/inference.py --config conf/config.yaml

结果可视化

python scripts/result.py

OneScience 官方信息

引用与许可证

  • 本仓库复现了 OneForecast 的原始论文。
Downloads last month
25
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Paper for OneScience-Group/OneForecast