SEEDS

Model Introduction

SEEDS is a generative weather model released by Google in March 2024. The name stands for Scalable Ensemble Envelope Diffusion Sampler; the associated paper was published in Science Advances.

Paper: SEEDS: Emulation of Weather Forecast Ensembles with Diffusion Models

https://arxiv.org/abs/2306.14066

Model Description

SEEDS is a conditional diffusion model that uses a small number of numerical weather prediction seed members to efficiently generate large forecast ensembles.

Use Cases

Scenario Description
Ensemble weather forecast research Train a conditional diffusion model on data following the project's cubed-sphere NPZ protocol and generate forecast ensembles.
Local quick validation Use synthetic data to check training, inference, ensemble evaluation, and visualization.
ModelScope / OneCode execution Download the standalone model package, install dependencies, and run the scripts directly.
Multi-GPU training Launch PyTorch DistributedDataParallel 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

  • Training and inference require a GPU or DCU recognized by PyTorch. CPU can be used to generate synthetic data and inspect configuration, but cannot run the current training and inference scripts.
  • Multi-GPU training uses the NCCL backend. Ensure that 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/SEEDS --local-dir ./SEEDS
cd SEEDS

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 SEEDS paper uses GEFS reforecast data for training, operational GEFS members as conditioning inputs, and ERA5 as the evaluation reference. The official data and preprocessing are not bundled with this repository; prepare the NPZ files specified by conf/config.yaml before training.

Generate Synthetic Data

When real data is unavailable, generate a default 6x48x48 cubed-sphere fixture. Synthetic data only validates the program flow and does not represent GEFS, ERA5, or the paper's forecast quality:

python scripts/fake_data.py

Training

Single GPU:

python scripts/train.py

Multi-GPU:

torchrun --nproc_per_node=8 scripts/train.py

The number of epochs is controlled by conf/config.yaml, and the default checkpoint is saved to data/checkpoint/model_bak.pth.

Fine-tuning

To continue from an existing checkpoint, use the explicit fine-tuning flag:

python scripts/train.py --finetune

Training Weights

This repository provides a weight/ directory for checkpoints trained on the official data. The weight files will be uploaded soon and are expected to be available in the near future.

Inference

Inference reads data/checkpoint/model_bak.pth by default and generates ensemble members in batches controlled by sampling.member_batch_size:

python scripts/inference.py

Predictions, targets, and seed members are saved under result/output/.

Evaluation and Visualization

python scripts/result.py

The script computes ensemble-mean RMSE, ACC, and empirical CRPS, saves the corresponding NPY metrics, and generates result/forecast.png. If training loss files are available, it also writes result/loss.png.

Official OneScience Resources

Citation and License

  • This repository is an independent adaptation of the SEEDS paper and is not an official Google product.

中文说明

模型简介

SEEDS 是 Google 于 2024 年三月发布的生成式天气模型。其名称是 Scalable Ensemble Envelope Diffusion Sampler 的缩写,相关论文发表于 Science Advances。

论文《SEEDS:使用扩散模型模拟集合天气预报(ensemble forecast)》

https://arxiv.org/abs/2306.14066

模型描述

SEEDS 是一种条件扩散模型,使用少量数值天气预报种子成员高效生成大规模集合预报。

使用场景

场景 说明
集合天气预报研究 使用遵循项目立方球 NPZ 规约的数据训练条件扩散模型,并生成集合预报。
本地快速验证 使用合成数据检查训练、推理(inference)、集合评估和可视化。
在 ModelScope / OneCode 中运行 下载独立模型包,安装依赖后直接运行脚本。
多 GPU 训练 使用 torchrun 启动 PyTorch DistributedDataParallel。

使用指南

1. 使用 OneCode

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

点击体验智能一键 AI4S 编程

2. 手动安装与使用

硬件要求

  • 训练和推理需要可被 PyTorch 识别的 GPU 或 DCU。CPU 可用于生成合成数据和检查配置,无法运行当前的训练和推理脚本。
  • 多 GPU 训练使用 NCCL 后端。请确保设备驱动、通信库与 PyTorch 版本兼容。
  • DCU 用户须提前安装 DTK。建议使用 DTK 25.04.2 或更高版本,或使用 OneScience 推荐且与所在集群匹配的版本。

下载模型包

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

安装运行环境

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

训练数据简介

SEEDS 论文使用 GEFS 再预报数据训练,以业务 GEFS 成员作为条件输入,并以 ERA5 作为评估参考。本仓库不附带官方数据和预处理流程。训练前请准备 conf/config.yaml 指定的 NPZ 文件。

生成合成数据

无真实数据时,生成默认 6x48x48 立方球测试数据。合成数据仅验证程序流程,不代表 GEFS、ERA5 或论文的预报质量。

python scripts/fake_data.py

训练

单 GPU

python scripts/train.py

多 GPU

torchrun --nproc_per_node=8 scripts/train.py

训练轮数由 conf/config.yaml 控制,默认模型权重(检查点)(checkpoint)保存至 data/checkpoint/model_bak.pth。

微调(fine-tuning)

若从现有模型权重(检查点)继续训练,请显式使用微调标志。

python scripts/train.py --finetune

训练权重

本仓库提供 weight/ 目录,用于存放在官方数据上训练的模型权重(检查点)。权重文件即将上传,预计近期可用。

推理

推理默认读取 data/checkpoint/model_bak.pth,并分批生成集合成员,批大小由 sampling.member_batch_size 控制。

python scripts/inference.py

预测、目标和种子成员均保存至 result/output/ 下。

评估与可视化

python scripts/result.py

脚本计算集合均值 RMSE、ACC 及经验 CRPS,保存对应的 NPY 指标,并生成 result/forecast.png。如果有训练损失文件,脚本还会写入 result/loss.png。

OneScience 官方资源

引用与许可证

  • 本仓库是 SEEDS 论文的独立适配,并非 Google 官方产品。
Downloads last month
30
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Paper for OneScience-Group/SEEDS