OneScience-Group/MeshGraphNet
<p align="center"> <strong> <span style="font-size: 30px;">MeshGraphNet</span> </strong> </p>
Model Overview
MeshGraphNets is a graph neural network developed by DeepMind for mesh-based physical simulation. It rapidly predicts the dynamics of complex physical systems, including fluids, structures, and cloth.
Paper: Learning Mesh-Based Simulation with Graph Networks https://arxiv.org/abs/2010.03409
Model Description
MeshGraphNets uses an encoder–processor–decoder graph-network architecture trained on trajectories from fluid, structural, and cloth simulations to perform long-horizon dynamical simulation of complex physical systems.
Use Cases
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.
- 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/MeshGraphNet --local-dir ./MeshGraphNet
cd MeshGraphNet 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.aiGPU 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.aiTraining Data
The OneScience community provides the cylinder_flow dataset for training. Download it with the command below and verify that the data path in config/config.yaml is configured correctly:
hf download --repo-type dataset OneScience-Group/cylinder_flow --local-dir ./dataTraining
Single GPU:
python scripts/train.pyMultiple GPUs:
torchrun --nproc_per_node=8 --nnodes=1 --rdzv_id=1000 --rdzv_backend=c10d --max_restarts=0 --master_addr="localhost" --master_port=29500 scripts/train.pyTraining saves .pth files under weight/checkpoints.
Model Weights
This repository will provide weights trained on the cylinder_flow dataset in the weights/ directory. The weights will be uploaded soon.
Inference
python scripts/inference.pyInference results are saved to result/output/.
Evaluation and Visualization
python scripts/result.pyOfficial OneScience Resources
Citations and License
- Original MeshGraphNet paper: Learning Mesh-Based Simulation with Graph Networks.
- This repository retains source attribution and has been adapted for automated execution through OneScience and ModelScope.
