1 of 37

Learning Controllable Adaptive Simulation for Multi-resolution Physics

1

Tailin Wu*(吴泰霖), Takashi Maruyama*, Qingqing Zhao*, Gordon Wetzstein, Jure Leskovec

Stanford University

ICLR 2023, notable-top-25%

*equal contribution

2 of 37

Outline

2

  1. Background: multi-resolution physics simulation and prior methods
  2. Method: Learning Controllable Adaptive Simulation for Multi-resolution Physics (LAMP)
  3. Experiments

3 of 37

Simulation is a core task in science

3

4 of 37

Problem definition and significance

4

Problem definition: Simulate a multi-resolution system in a accurate and efficient way.

Significance: Many physical systems in science and engineering are multi-resolution: parts of the system is highly dynamic and need to resolve to fine-grained resolution, while other parts are more static.

Weather prediction

Galaxy formation

Laser-plasma particle acceleration

5 of 37

Preliminaries: classical solvers and limitations

5

Classical solvers:

Based on Partial Differential Equations (PDEs)

  • Pros: (1) Based on first principles and interpretable, (2) accurate, (3) have error guarantee.
  • Challenges: Slow and computational expensive, due to

(1) Small time interval to ensure numerical stability, or use implicit method.

(2) For multi-resolution systems, typically need to resolve to the lowest resolution

Pros and challenges:

Discretize the PDE, then use finite difference, finite element, finite volume, etc. to evolve the system.

mesh

grid

discrete time index

discrete cell id

6 of 37

Preliminaries: Deep learning-based surrogate models

6

Recently, deep learning based surrogate modeling has emerged as attractive alternative to replace or complement classical solvers. They:

  • Offer speedup via:
    • Larger spatial resolution
    • Larger time intervals
    • Use explicit forward

7 of 37

Limitation of today’s method for multi-resolution physics:

1. Deep learning-based surrogate models: prior works mainly focus on learning the evolution with low prediction error, without directly optimizing the computational cost

  • Almost all works are learning the evolution model on a fixed grid or mesh
  • A few exceptions, e.g. MeshGraphNet [1] learn the remeshing using supervision from the solver, where the solver’s label is heuristics based on geometric feature (second derivative) of mesh coordinates.

7

[1] Pfaff, Tobias, et al. "Learning mesh-based simulation with graph networks." arXiv preprint arXiv:2010.03409 (2020).

8 of 37

Architectural backbone: MeshGraphNets [1]

8

[1] Pfaff et al. ICLR 2021

9 of 37

Limitation of today’s method for multi-resolution physics:

9

2. Classical solvers:

  • Many solvers are based on fixed grid/mesh
  • Adaptive Mesh Refinement (AMR) can adaptively update the local spatial resolution. Since it is based on classical solvers, it shares similar drawbacks (e.g. slow), and it is based on heuristics without directly optimizing the computational cost

10 of 37

Our contribution

10

We introduced the first deep learning-based surrogate model, which jointly learns the evolution and optimize computational cost.

(Wu et al., ICLR 2023, spotlight)

Key component is a GNN-based reinforcement learning (RL) agent, which learns to coarsen or refine the mesh, to achieve a controllable tradeoff between prediction error and computational cost.

11 of 37

Architecture

11

The policy network predicts the number of edges to refine or coarsen , and which edges to refine or coarsen .

: evolution model, evolving the system while keeping the mesh topology

: policy, which locally refines or coarsens the mesh

12 of 37

Architecture

12

The policy network predicts the number of edges to refine or coarsen , and which edges to refine or coarsen .

: evolution model, evolving the system while keeping the mesh topology

: policy, which locally refines or coarsens the mesh

13 of 37

Architecture

13

The policy network predicts the number of edges to refine or coarsen , and which edges to refine or coarsen .

: evolution model, evolving the system while keeping the mesh topology

: policy, which locally refines or coarsens the mesh

14 of 37

Architecture

14

The policy network predicts the number of edges to refine or coarsen , and which edges to refine or coarsen .

: evolution model, evolving the system while keeping the mesh topology

: policy, which locally refines or coarsens the mesh

15 of 37

Action space: refinement and coarsening

15

(1) Refining an edge

(2) Coarsening an edge

There are also constraints that need to be satisfied, e.g. if two edges are on the same face, they cannot be both refined or coarsened.

16 of 37

Learning the evolution model

The loss is based on the multi-step prediction error of the evolution model, compared with the ground-truth.

16

17 of 37

Learning the policy

17

for S steps

18 of 37

Learning the policy : reward

18

Reward:

Reward is based on the improvement of both error and computational cost.

    • Error is the multi-step prediction error
    • Computational cost is measured by number of vertices in the mesh

[1] Sutton, et al. NIPS 1999

is also an input to the policy

for S steps

for S steps

19 of 37

Learning the policy : actor objective

19

Objective for the actor :

advantage

log prob. for taking

the action

entropy regularizer

sg: stop gradient

REINFORCE

20 of 37

Learning the policy : critic objective

20

Objective for the critic (value function) :

value target

Here for the value target, we do not use a bootstrapped version of which assumes infinite horizons. Instead we use the reward defined as improvement error and computation within S steps of rollout.

21 of 37

Experiment 1

(1) Burgers’ equation (from the benchmark in [1])

21

[1] Brandstetter, Johannes, Daniel Worrall, and Max Welling. "Message passing neural PDE solvers." ICLR 2022

22 of 37

Experiment 1

Example rollout:

22

  • Refines more near the shock front, and coarsens more in static regions
  • With larger that focuses more on reducing computation, it refines less and coarsens more

Added cells

removed cells

23 of 37

Experiment 1

Example rollout:

23

  • Refines more near the shock front, and coarsens more in static regions
  • With larger that focuses more on reducing computation, it refines less and coarsens more

24 of 37

24

25 of 37

25

Result table:

Compared to state-of-the-art (FNO, MP-PDE) models and strong baselines, our model achieves large error reduction (average of 33.4%)

Ours

26 of 37

26

Result table:

Compared to ablation LAMP (no remeshing), our full model can reduce error (49.1%), by only modest increase computational cost.

Ours

27 of 37

Experiment 1

27

Fig. 3 shows the average error and # nodes over full test trajectories. We see that

With increasing , LAMP is able to reduce # nodes, with only slight increase in error.

28 of 37

Experiment 1

28

Fig. 3 shows the average error and # nodes over full test trajectories. We see that

With increasing , LAMP improves the Pareto frontier over other models

29 of 37

Experiment 2: results

29

30 of 37

Experiment 2: example visualization

30

ground-truth (fine-grained)

MeshGraphNets + GT remeshing

MSE: 5.91e-4

31 of 37

Experiment 2: example visualization

31

LAMP + heuristic remeshing

ground-truth (fine-grained)

MSE: 6.38e-4

32 of 37

Experiment 2: example visualization

32

LAMP + no remeshing

ground-truth (fine-grained)

MSE: 6.13e-4

33 of 37

Experiment 2: example visualization

33

ground-truth (fine-grained)

LAMP

MSE: 5.80e-4

34 of 37

34

Other examples:

35 of 37

Summary

  1. Multi-resolution is a key characteristics in physical simulations.
    1. Challenge: how simulate accurately and efficiently
  2. We introduced LAMP, the first deep learning-based surrogate model (LAMP) which jointly learns the evolution and optimizes:

35

36 of 37

Summary

3. Experiments in 1D PDE and mesh-based simulation demonstrate LAMP’s capability,

outperform previous state-of-the-art.

36

Paper:

Code:

37 of 37

Future opportunities

37

  1. Larger simulations

2. Inverse design

Up to millions to billions of nodes

Welcome collaborations (email Tailin Wu, tailin@cs.stanford.edu)!