RoseNNa: A performant, portable library for neural network inference with application to computational fluid dynamics

07/30/2023
by   Ajay Bati, et al.
0

The rise of neural network-based machine learning ushered in high-level libraries, including TensorFlow and PyTorch, to support their functionality. Computational fluid dynamics (CFD) researchers have benefited from this trend and produced powerful neural networks that promise shorter simulation times. For example, multilayer perceptrons (MLPs) and Long Short Term Memory (LSTM) recurrent-based (RNN) architectures can represent sub-grid physical effects, like turbulence. Implementing neural networks in CFD solvers is challenging because the programming languages used for machine learning and CFD are mostly non-overlapping, We present the roseNNa library, which bridges the gap between neural network inference and CFD. RoseNNa is a non-invasive, lightweight (1000 lines), and performant tool for neural network inference, with focus on the smaller networks used to augment PDE solvers, like those of CFD, which are typically written in C/C++ or Fortran. RoseNNa accomplishes this by automatically converting trained models from typical neural network training packages into a high-performance Fortran library with C and Fortran APIs. This reduces the effort needed to access trained neural networks and maintains performance in the PDE solvers that CFD researchers build and rely upon. Results show that RoseNNa reliably outperforms PyTorch (Python) and libtorch (C++) on MLPs and LSTM RNNs with less than 100 hidden layers and 100 neurons per layer, even after removing the overhead cost of API calls. Speedups range from a factor of about 10 and 2 faster than these established libraries for the smaller and larger ends of the neural network size ranges tested.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
10/25/2022

Comparing neural network training performance between Elixir and Python

With a wide range of libraries focused on the machine learning market, s...
research
04/14/2020

A Fortran-Keras Deep Learning Bridge for Scientific Computing

Implementing artificial neural networks is commonly achieved via high-le...
research
05/17/2017

Frame Stacking and Retaining for Recurrent Neural Network Acoustic Model

Frame stacking is broadly applied in end-to-end neural network training ...
research
05/22/2018

EcoRNN: Fused LSTM RNN Implementation with Data Layout Optimization

Long-Short-Term-Memory Recurrent Neural Network (LSTM RNN) is a state-of...
research
09/11/2020

Applications of Deep Neural Networks

Deep learning is a group of exciting new technologies for neural network...
research
09/14/2023

TensorFlow Chaotic Prediction and Blow Up

Predicting the dynamics of chaotic systems is one of the most challengin...
research
01/24/2023

Implementation of the Critical Wave Groups Method with Computational Fluid Dynamics and Neural Networks

Accurate and efficient prediction of extreme ship responses continues to...

Please sign up or login with your details

Forgot password? Click here to reset