TensorDiffEq: Scalable Multi-GPU Forward and Inverse Solvers for Physics Informed Neural Networks

Levi D. McClenny, Mulugeta Haile, Ulisses Braga-NetoarXiv 2021 · DOI

Abstract

Physics-Informed Neural Networks promise to revolutionize science and engineering practice, by introducing domain-aware deep machine learning models into scientific computation. Several software suites have emerged to make the implementation and usage of these architectures available to the research and industry communities. Here we introduce TensorDiffEq, built on Tensorflow 2.x, which presents an intuitive Keras-like interface for problem domain definition, model definition, and solution of forward and inverse problems using physics-aware deep learning methods. TensorDiffEq takes full advantage of Tensorflow 2.x infrastructure for deployment on multiple GPUs, allowing the implementation of large high-dimensional and complex models. Simultaneously, TensorDiffEq supports the Keras API for custom neural network architecture definitions. In the case of smaller or simpler models, the package allows for rapid deployment on smaller-scale CPU platforms with negligible changes to the implementation scripts. We demonstrate the basic usage and capabilities of TensorDiffEq in solving forward, inverse, and data assimilation problems of varying sizes and levels of complexity.

Introduction

The integration of physical laws into deep learning architectures, known as Physics-Informed Neural Networks (PINNs), has opened new avenues for solving partial differential equations (PDEs) and identifying unknown physical parameters. Traditional numerical methods, such as finite element analysis (FEA) or finite difference methods (FDM), often face significant hurdles when dealing with high-dimensional spaces or complex geometries requiring intricate meshing. PINNs circumvent these issues by utilizing the universal approximation capabilities of neural networks, treating the governing physics as a regularization term within the loss function.

Despite their potential, the adoption of PINNs in large-scale industrial and scientific applications has been slowed by the lack of scalable, easy-to-use software frameworks. Many existing libraries are restricted to single-GPU execution or require extensive boilerplate code that obscures the underlying physics. TensorDiffEq is designed to bridge this gap, offering a high-level, Keras-like interface that scales seamlessly across multi-GPU clusters.

Methodology and Architecture

TensorDiffEq is built atop the TensorFlow 2.x ecosystem, utilizing its robust automatic differentiation and distributed computing capabilities. The framework is structured to provide a balance between ease of use and architectural flexibility.

Keras-like Interface

One of the primary goals of TensorDiffEq is to lower the barrier to entry for scientific researchers. By implementing familiar compile and fit methods, the library allows users to define the spatial and temporal domains, specify boundary conditions, and define the governing PDE residuals using standard TensorFlow syntax. This abstraction allows researchers to focus on the physical problem rather than the intricacies of the optimization loop.

Automatic Differentiation and Physics Loss

The core of the solver relies on reverse-mode automatic differentiation to calculate the derivatives required by the PDE residual. This ensures that the "physics" is exactly represented in the network's loss function. The total loss is typically a weighted sum of the initial condition (IC) loss, boundary condition (BC) loss, and the PDE residual (physics) loss.

Multi-GPU Scalability

To handle high-dimensional or computationally intensive models, TensorDiffEq leverages TensorFlow’s distribution strategies. This allows for data-parallel training across multiple GPUs, significantly reducing training time for complex simulations and enabling the exploration of larger parameter spaces that were previously computationally prohibitive.

Self-Adaptive Solvers

A significant technical contribution of TensorDiffEq is the inclusion of self-adaptive training methods. Standard PINNs often struggle with "stiff" PDEs where the solution contains sharp gradients or localized phenomena. TensorDiffEq implements soft-attention mechanisms that automatically weight the loss function, forcing the network to focus on "difficult" regions of the spatio-temporal domain. This approach has proven critical for achieving convergence in challenging cases like the Allen-Cahn equation.

Applications and Benchmarks

The efficacy of TensorDiffEq has been validated across several benchmark problems common in scientific computing:

  • Viscous Burger’s Equation: A fundamental PDE used to model fluid dynamics and shock waves, serving as a baseline for forward problem solving.
  • Allen-Cahn Equation: A reaction-diffusion equation used in phase separation studies. This equation is notoriously difficult for standard PINNs due to its sharp transitions, but TensorDiffEq’s self-adaptive solvers successfully resolve the dynamics.
  • Inverse Problems and Data Assimilation: Beyond solving known equations, TensorDiffEq is capable of "discovering" unknown physical constants (e.g., diffusivity or mobility coefficients) from sparse, noisy observation data.

Discussion and Future Directions

TensorDiffEq emphasizes the "portability of physics." Because it utilizes the standard Keras model format, trained solvers can be easily exported. This allows for a workflow where models are trained on high-performance computing (HPC) clusters but deployed for real-time inference on edge devices or standard workstations.

While the current iteration of TensorDiffEq provides a robust foundation, future work is focused on expanding the library's capabilities. This includes supporting more complex multi-network architectures, expanding the library of supported boundary conditions (such as Robin or specialized Neumann conditions), and further optimizing the memory footprint for extremely high-dimensional problems.

Conclusion

TensorDiffEq provides a scalable and intuitive platform for the next generation of scientific machine learning. By combining the flexibility of the Keras API with the power of multi-GPU distributed computing, it enables researchers to tackle complex physical systems with minimal boilerplate code, bridging the gap between deep learning research and practical engineering application.

Source Code: https://github.com/tensordiffeq Documentation: https://docs.tensordiffeq.io

Summary updated

Abstract

Physics-Informed Neural Networks promise to revolutionize science and engineering practice, by introducing domain-aware deep machine learning models into scientific computation. Several software suites have emerged to make the implementation and usage of these architectures available to the research and industry communities. Here we introduce\linebreak TensorDiffEq, built on Tensorflow 2.x, which presents an intuitive Keras-like interface for problem domain definition, model definition, and solution of forward and inverse problems using physics-aware deep learning methods. TensorDiffEq takes full advantage of Tensorflow 2.x infrastructure for deployment on multiple GPUs, allowing the implementation of large high-dimensional and complex models. Simultaneously, TensorDiffEq supports the Keras API for custom neural network architecture definitions. In the case of smaller or simpler models, the package allows for rapid deployment on smaller-scale CPU platforms with negligible changes to the implementation scripts. We demonstrate the basic usage and capabilities of TensorDiffEq in solving forward, inverse, and data assimilation problems of varying sizes and levels of complexity. The source code is available at https://github.com/tensordiffeq.
BibTeX
@misc{mcclenny2021tensordiffeq,
  author = {Levi D. McClenny and Mulugeta Haile and Ulisses Braga-Neto},
  title = {{TensorDiffEq: Scalable Multi-GPU Forward and Inverse Solvers for Physics Informed Neural Networks}},
  year = {2021},
  eprint = {2103.16034},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2103.16034},
}

Loading related content...

Figure