How yellowshippo/fluxgnn-icml2024 works
1. This repository is a research codebase for PDE solving with graph neural networks. It is organized around two problem families: convection–diffusion and mixture. The main architectural idea is config-driven training/evaluation of multiple solver families against shared datasets.
2. The core model stack lives under fluxgnn/. This package contains the FluxGNN implementation itself (fluxgnn.py), PDE/problem-specific wrappers (navier_stokes.py, poisson.py, mixture.py), finite-volume support (torch_fv.py, fv_data.py), and shared infrastructure for datasets, settings, and utility code. In practice, this is the “engine” that loads data, builds the solver, and runs inference/training.
3. fluxgnn/dataset.py and fluxgnn/setting.py define the boundary between data/configuration and the model code. The repo is heavily YAML-driven: experiment behavior, dataset paths, and model hyperparameters are supplied through inputs/**.yml, and these settings flow into the FluxGNN experiment runner.
4. The experiments/ directory is for postprocessing and experiment orchestration rather than model definition. run.py appears to be the execution entrypoint, stats.py computes aggregate metrics/results, and generate_vtu.py exports outputs to VTU for visualization in mesh-based tools. This separates simulation runtime from analysis and visualization.
5. Baseline methods are isolated from FluxGNN in their own top-level package penn/, which contains train.py and eval.py. That separation suggests a distinct training/evaluation pipeline for the PENN baseline, even though it shares datasets and experiment inputs with the main model family.
6. The inputs/ tree is the experiment matrix. It contains many YAML files grouped by task and solver family (convection_diffusion/fluxgnn, mixture/fluxgnn, mixture/fv, mixture/penn). The architecture is therefore not hardcoded around one experiment; it is parameterized by input files that select the solver, replication settings, and finite-volume/baseline variants.
7. Data is externally supplied and stored under data/. The README shows three distinct roles there: raw/primary training data, intermediate/preprocessed forms for baseline methods, and pretrained models. For the mixture task, the split into raw, interim, preprocessed, transformed, and taller indicates that different solver families consume different representations of the same underlying simulation data.
8. Pretrained weights are treated as first-class runtime assets, not as source code. The repository expects them in data/pretrained/**, which means evaluation can run without retraining and architecture diagrams should show an explicit model-artifact store feeding inference.
9. The repository includes a vendored or linked external component path via lib/siml and a git submodule MP-Neural-PDE-Solvers. That strongly suggests some baseline/utility code is maintained outside this repo and integrated as an external dependency boundary rather than being rewritten here.
10. Makefile is the main user-facing command layer. The README’s train/eval commands map to make targets such as cd_fluxgnn_train, mixture_penn_eval, and mixture_fvm_eval, so the operational workflow is: choose a task/solver target, load the matching YAML config, then dispatch into the corresponding Python package.
11. The test layout mirrors the two main problem domains: tests/cd and tests/mixture. This reinforces that the repository’s architecture is split primarily by PDE family, with shared solver infrastructure reused across both.
12. At a high level, the data flow is: external datasets enter data/, config files under inputs/ select a solver and task, Python packages under fluxgnn/ or penn/ run training/evaluation, and experiments/ plus pretrained assets support analysis and reproducible evaluation. The main boundaries are between shared infrastructure, solver-specific code, baseline code, and data/model artifacts.
Main entry points: fluxgnn.py FluxGNN · experiment.py Experiment · penn PENN · Makefile Makefile
Components 21
Core solver stack
Shared FluxGNN engine and PDE-specific wrappers.
- Experiment · Central experiment orchestration and config plumbing.
fluxgnn/experiment.py - FluxGNN · Main graph neural PDE solver implementation.
fluxgnn/fluxgnn.py - Dataset · Dataset loading and preparation boundary for shared tasks.
fluxgnn/dataset.py - Setting · Typed settings and experiment configuration handling.
fluxgnn/setting.py - FV support · Finite-volume data and operator helpers used by solver variants.
fluxgnn/torch_fv.py - FV data · Finite-volume specific data structures and transforms.
fluxgnn/fv_data.py - PDE wrappers · Problem-specific wrappers for Navier-Stokes and Poisson style tasks.
fluxgnn/navier_stokes.py - Mixture · Mixture-task model wrapper and task-specific wiring.
fluxgnn/mixture.py
Run orchestration
Entry points and experiment execution layer.
- Makefile · User-facing targets for training, evaluation, and task dispatch.
Makefile - Experiments · Run scripts, stats, and export utilities for analysis and visualization.
experiments - PENN · Separate baseline training and evaluation pipeline.
penn
Inputs
YAML experiment matrix and task-specific settings.
- Inputs · Task and solver YAML configurations selecting experiments and hyperparameters.
inputs - CD configs · Convection–diffusion experiment definitions.
inputs/convection_diffusion - Mixture configs · Mixture-task experiment definitions for FluxGNN, FV, and PENN.
inputs/mixture
Data and artifacts
External datasets, preprocessing outputs, and pretrained weights.
- Data · External datasets and runtime artifacts.
data - Sample data · Small bundled dataset for local runs and tests.
data/sample_data - Pretrained · First-class runtime asset store for pretrained weights.
data
External deps
Vendored or submodule-based dependency boundaries.
Tests
Domain-focused smoke and regression coverage.
- CD tests · Convection–diffusion validation coverage.
tests/cd - Mixture tests · Mixture-task validation coverage.
tests/mixture
Connections 23
- Makefile → Experiment: dispatches · Invokes the main training/evaluation runner with a chosen target.
- Makefile → PENN: targets · Provides baseline train/eval targets.
- Makefile → Experiments: postprocess · Runs stats and export utilities through command targets.
- Inputs → Experiment: configures · YAML experiment definitions feed the shared runner.
- CD configs → FluxGNN: selects · Convection–diffusion configs select the FluxGNN solver family.
- Mixture configs → FluxGNN: selects · Mixture FluxGNN configs parameterize the main solver.
- Mixture configs → PENN: selects · Mixture PENN configs drive the baseline pipeline.
- Dataset → Data: loads · Dataset code reads the shared data store and task assets.
- Setting → Inputs: parses · Settings are populated from YAML experiment files.
- Experiment → Dataset: uses · Coordinates dataset loading before solver execution.
- Experiment → Setting: uses · Consumes settings to build and run experiments.
- Experiment → FluxGNN: runs · Constructs and executes the FluxGNN solver stack.
- FluxGNN → FV support: uses · Solver relies on finite-volume operations for PDE handling.
- FV support → FV data: reads · Finite-volume support is paired with FV-specific data structures.
- PDE wrappers → FluxGNN: wraps · PDE-specific wrappers extend the core solver.
- Mixture → FluxGNN: wraps · Mixture task wiring sits on top of the shared engine.
- Experiments → Data: analyzes · Postprocessing reads run outputs and produced artifacts.
- Experiments → Pretrained: exports · Can emit or consume model artifacts for evaluation workflows.
- PENN → Data: trains on · Baseline pipeline shares the external data and transformed assets.
- PENN → siml: depends on · Baseline code relies on the vendored external library boundary.
- PENN → MP-Neural: integrates · Uses the external PDE solver submodule as a dependency.
- CD tests → CD configs: covers · Domain tests mirror the convection–diffusion configuration set.
- Mixture tests → Mixture configs: covers · Domain tests mirror the mixture configuration set.