arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2307.16322physics.flu-dyncs.LG
收藏

RoseNNa:一个用于神经网络推理的高性能、可移植库,并应用于计算流体动力学

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

Georgia Institute of Technology(佐治亚理工学院)

Ajay Bati, Spencer H. Bryngelson

AI总结:

本文提出轻量级非侵入式 RoseNNa 库,可将训练好的 MLP/LSTM 模型转为带 C/Fortran API 的高性能 Fortran 代码,便于嵌入 CFD 等 PDE 求解器,推理速度最高较 PyTorch/libtorch 提升约10倍。

摘要:

基于神经网络的机器学习的兴起催生了包括 TensorFlow 和 PyTorch 在内的高级库,以支持其功能。计算流体动力学(CFD)研究人员已从这一趋势中受益,并开发出了有望缩短仿真时间的强大神经网络。例如,多层感知器(MLP)和基于长短期记忆(LSTM)的循环神经网络(RNN)架构可以表示湍流等亚网格物理效应。在 CFD 求解器中实现神经网络具有挑战性,因为机器学习和 CFD 所使用的编程语言基本互不重叠。我们提出了 roseNNa 库,它弥合了神经网络推理与 CFD 之间的差距。RoseNNa 是一种非侵入式、轻量级(1000 行代码)且高性能的神经网络推理工具,重点关注用于增强 PDE 求解器(例如通常用 C/C++ 或 Fortran 编写的 CFD 求解器)的较小网络。RoseNNa 通过将典型神经网络训练包中的已训练模型自动转换为带有 C 和 Fortran API 的高性能 Fortran 库来实现这一点。这减少了访问已训练神经网络所需的工作量,并在 CFD 研究人员构建和依赖的 PDE 求解器中保持性能。结果表明,即使在去除 API 调用的开销成本之后,RoseNNa 在隐藏层少于 100 层且每层神经元数为 100 的 MLP 和 LSTM RNN 上,也始终优于 PyTorch(Python)和 libtorch(C++)。在所测试的神经网络尺寸范围的较小端和较大端,相对于这些成熟库,加速比分别约为 10 倍和 2 倍。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑