CFD_Benchmark
Model Overview
CFD_Benchmark is an open-source deep-learning benchmark library for research on neural partial differential equation (PDE) solvers. It extends Tsinghua University's open-source Neural-Solver-Library with Distributed Data Parallel (DDP) training support, additional models, and new datasets, while retaining the original neural-operator and physical-field modeling framework. The library supports neural PDE solver evaluation, deep-learning research for CFD, multi-model performance comparisons, large-scale distributed training experiments, physical simulation dataset development, and algorithm benchmarking.
The library currently supports the following benchmarks:
- Six standard benchmarks from [FNO] and [geo-FNO]
- PDEBench [NeurIPS 2022 Track dataset and benchmark] for autoregressive tasks
- The ShapeNet-Car dataset [TOG 2018] for industrial design benchmarks
- The BubbleML [Multiphase Multiphysics Dataset] for studying multiphysics phase-transition phenomena
Supported Neural Solvers
The following neural PDE solvers are supported:
Transolver - Transolver: A Fast Transformer Solver for PDEs on General Geometries [ICML 2024] [Code]
ONO - Improved Operator Learning by Orthogonal Attention [ICML 2024] [Code]
Factformer - Scalable Transformer for PDE Surrogate Modeling [NeurIPS 2023] [Code]
U-NO - U-NO: U-shaped Neural Operators [TMLR 2023] [Code]
LSM - Solving High-Dimensional PDEs with Latent Spectral Models [ICML 2023] [Code]
GNOT - GNOT: A General Neural Operator Transformer for Operator Learning [ICML 2023] [Code]
F-FNO - Factorized Fourier Neural Operators [ICLR 2023] [Code]
U-FNO - An enhanced Fourier neural operator-based deep-learning model for multiphase flow [Advances in Water Resources 2022] [Code]
Galerkin Transformer - Choose a Transformer: Fourier or Galerkin [NeurIPS 2021] [Code]
MWT - Multiwavelet-based Operator Learning for Differential Equations [NeurIPS 2021] [Code]
FNO - Fourier Neural Operator for Parametric Partial Differential Equations [ICLR 2021] [Code]
Transformer - Attention Is All You Need [NeurIPS 2017] [Code]
GFNO - Group Equivariant Fourier Neural Operators for Partial Differential Equations[2023 Poster][Code]
Several vision architectures also serve as effective baselines for structured-geometry tasks:
- Swin Transformer - Swin Transformer: Hierarchical Vision Transformer using Shifted Windows [ICCV 2021] [Code]
- U-Net - U-Net: Convolutional Networks for Biomedical Image Segmentation [MICCAI 2015] [Code]
Several established geometric deep-learning models are included for design tasks:
- Graph-UNet - Graph U-Nets [ICML 2019] [Code]
- GraphSAGE - Inductive Representation Learning on Large Graphs [NeurIPS 2017] [Code]
- PointNet - PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation [CVPR 2017] [Code]
The library also includes the following graph neural network:
Use Cases
| Use Case | Description |
|---|---|
| Neural PDE solver evaluation | Train, run inference with, and compare models such as FNO, Transolver, GNOT, ONO, and U-NO through a unified workflow |
| Autoregressive physical prediction | Predict the temporal evolution of PDE states step by step using datasets such as PDEBench |
| Multiphysics modeling | Study multiphase flows, multiphysics coupling, and phase-transition phenomena using datasets such as BubbleML |
| ModelScope/OneCode execution | Download the standalone model package, install its dependencies, and run the provided scripts |
Usage
1. OneCode
Use the online OneCode environment for an intelligent, one-click AI for Science (AI4S) programming experience:
Launch OneCode for one-click AI4S programming
2. Manual Setup
Hardware Requirements
- A GPU or DCU is recommended.
- A CPU can be used for import checks and small-scale pipeline validation, but full training and inference will be slow.
- DCU users must install DTK in advance. DTK 25.04.2 or later, or the OneScience-recommended version for the target cluster, is recommended.
Download the Model Package
hf download OneScience-Group/CFD_Benchmark --local-dir ./CFD_Benchmark
cd CFD_Benchmark
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[cfd-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[cfd-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
Training Data
Use the dataset links in the benchmark overview above to download the required data.
The six standard benchmark datasets from [FNO] and [geo-FNO] are available from this link.
The PDEBench [NeurIPS 2022 Track dataset and benchmark], used for benchmarking autoregressive tasks, is available from this link.
The ShapeNet-Car [TOG 2018] benchmark dataset for industrial design tasks is available from [this link].
The BubbleML [Multiphase Multiphysics Dataset], designed for research on multiphysics phase-transition phenomena, is available from [this link].
The OneScience community also provides the cfd_benchmark dataset for training. Download it with the command below and verify that the data path in conf/config.yaml is configured correctly:
hf download --repo-type dataset OneScience-Group/cfd_benchmark --local-dir ./data
Training
python scripts/train.py
Model Weights
This repository will provide weights trained on the OneScience cfd_benchmark dataset in the weights/ directory. The weights will be uploaded soon.
Inference
python scripts/inference.py
Inference loads the trained weights referenced by paths.weight_path and writes the metrics to:
./results/{train.save_name}/metrics.json
Official OneScience Resources
| Platform | OneScience 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 |
Citations and License
- Reference repository: Neural-Solver-Library.
- This repository retains source attribution and has been adapted for automated execution through OneScience and ModelScope.
中文说明
模型概览
CFD_Benchmark 是一个面向神经偏微分方程(PDE)求解器研究的开源深度学习基准库。它扩展了清华大学开源的 Neural-Solver-Library,新增分布式数据并行(DDP)训练支持、模型和数据集,并保留原有的神经算子(neural operator)与物理场建模框架。该库支持神经 PDE 求解器评估、计算流体力学(CFD)深度学习研究、多模型性能比较、大规模分布式训练试验、物理模拟数据集开发及算法基准测试。
该库目前支持以下基准。
- 来自 [FNO] 和 [geo-FNO] 的六个标准基准
- 用于自回归任务的 PDEBench [NeurIPS 2022 赛道数据集与基准]
- 用于工业设计基准的 ShapeNet-Car 数据集 [TOG 2018]
- 用于研究多物理场相变现象的 BubbleML [多相多物理场数据集]
支持的神经求解器
支持以下神经 PDE 求解器。
Transolver - Transolver:面向一般几何域 PDE 的快速 Transformer 求解器 [ICML 2024] [代码]
ONO - 利用正交注意力改进算子学习 [ICML 2024] [代码]
Factformer - 用于 PDE 代理建模的可扩展 Transformer [NeurIPS 2023] [代码]
U-NO - U-NO:U 形神经算子 [TMLR 2023] [代码]
LSM - 使用潜在谱模型求解高维 PDE [ICML 2023] [代码]
GNOT - GNOT:用于算子学习的通用神经算子 Transformer [ICML 2023] [代码]
F-FNO - 因子化傅里叶神经算子 [ICLR 2023] [代码]
U-FNO - 用于多相流的增强型傅里叶神经算子深度学习模型 [Advances in Water Resources 2022] [代码]
Galerkin Transformer - 选择 Transformer:傅里叶或 Galerkin [NeurIPS 2021] [代码]
MWT - 基于多小波的微分方程算子学习 [NeurIPS 2021] [代码]
FNO - 用于参数化偏微分方程的傅里叶神经算子 [ICLR 2021] [代码]
Transformer - 注意力机制就是你所需要的一切 [NeurIPS 2017] [代码]
GFNO - 用于偏微分方程的群等变傅里叶神经算子[2023 年海报][代码]
几种视觉架构也可作为结构化几何任务的有效基线。
- Swin Transformer - Swin Transformer:使用移位窗口的分层视觉 Transformer [ICCV 2021] [代码]
- U-Net - U-Net:用于生物医学图像分割的卷积网络 [MICCAI 2015] [代码]
针对设计任务,库中包含多种成熟的几何深度学习模型。
- Graph-UNet - 图 U-Net [ICML 2019] [代码]
- GraphSAGE - 大规模图上的归纳式表征学习 [NeurIPS 2017] [代码]
- PointNet - PointNet:用于 3D 分类与分割的点集深度学习 [CVPR 2017] [代码]
该库还包含以下图神经网络。
使用场景
| 使用场景 | 说明 |
|---|---|
| 神经 PDE 求解器评估 | 通过统一流程训练、推理(inference)并比较 FNO、Transolver、GNOT、ONO 和 U-NO 等模型 |
| 自回归物理预测 | 使用 PDEBench 等数据集逐步预测 PDE 状态随时间的演变 |
| 多物理场建模 | 使用 BubbleML 等数据集研究多相流、多物理场耦合和相变现象 |
| ModelScope/OneCode 运行 | 下载独立模型包,安装依赖并运行所提供的脚本 |
使用指南
1. OneCode
通过 OneCode 在线环境体验面向科学的人工智能(AI4S)智能一键编程。
2. 手动配置
硬件要求
- 建议使用 GPU 或 DCU。
- CPU 可用于导入检查和小规模流程验证,完整训练和推理速度较慢。
- DCU 用户须提前安装 DTK。建议使用 DTK 25.04.2 或更高版本,或使用 OneScience 推荐的适配目标集群的版本。
下载模型包
hf download OneScience-Group/CFD_Benchmark --local-dir ./CFD_Benchmark
cd CFD_Benchmark
配置运行环境
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[cfd-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[cfd-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
训练数据
通过上述基准概览中的数据集链接下载所需数据。
可通过此链接获取来自 [FNO] 和 [geo-FNO] 的六个标准基准数据集。
用于自回归任务基准测试的 PDEBench [NeurIPS 2022 赛道数据集与基准] 可通过此链接获取。
用于工业设计任务的 ShapeNet-Car [TOG 2018] 基准数据集可通过[此链接]获取。
用于研究多物理场相变现象的 BubbleML [多相多物理场数据集] 可通过[此链接]获取。
OneScience 社区也提供用于训练的 cfd_benchmark 数据集。使用以下命令下载,并确认 conf/config.yaml 中的数据路径配置正确。
hf download --repo-type dataset OneScience-Group/cfd_benchmark --local-dir ./data
训练
python scripts/train.py
模型权重
本仓库将在 weights/ 目录中提供使用 OneScience cfd_benchmark 数据集训练得到的权重。权重即将上传。
推理
python scripts/inference.py
推理加载 paths.weight_path 指定的训练权重,并将指标写入以下位置。
./results/{train.save_name}/metrics.json
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 |
引用与许可证
- 参考仓库 Neural-Solver-Library。
- 本仓库保留来源署名,并经过适配,可通过 OneScience 和 ModelScope 自动运行。
- Downloads last month
- 12