arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.16976cs.MScs.AIcs.LG
收藏

基于编译器工具库的神经网络切线线性模型和伴随模型实现

Implementation of tangent linear and adjoint models for neural networks based on a compiler library tool

State Key Laboratory of Severe Weather Meteorological Science and Technology (LaSW)(severe weather meteorological science and technology state key laboratory);CMA Earth System Modeling and Prediction Centre (CEMC)(CMA earth system modeling and prediction center)

Sa Xiao, Hao Jing, Honglu Sun, Haoyu Li

AI总结:

本文提出TorchNWP工具库,通过优化接口和二进制转换,实现人工智能组件与传统数值模型的高效耦合,简化四维变分数据同化系统的构建,提升数值天气预测的精度与效率。

摘要:

本文提出了TorchNWP,一种基于LibTorch的编译器工具库,用于高效耦合人工智能组件和传统数值模型。该工具旨在解决运算数值模型在Fortran和基于Python的深度学习框架之间存在的语言兼容性差、耦合灵活性不足和数据传输效率低的问题。基于LibTorch,它优化并设计了一个统一的应用层调用接口,将PyTorch框架下的深度学习模型转换为静态二进制格式,并提供C/C++接口。然后,通过混合Fortran/C/C++编程,使深度学习模型能够在数值模型中部署。将TorchNWP集成到数值模型中只需将其编译为可调用的链接库并在编译和链接阶段链接以生成可执行文件。在此基础上,在C/C++层面实现了基于神经网络的切线线性模型和伴随模型,可以屏蔽神经网络模型的内部结构,简化四维变分数据同化系统的构建。同时,它支持在异构平台上部署,兼容主流神经网络模型,支持不同并行粒度的映射和高效的并行执行。使用该工具需要对原始数值模型进行极少的代码修改,从而减少耦合成本。它可以高效地集成到数值天气预测模型中,如CMA-GFS和MCV,并已应用于深度学习物理参数化方案(如辐射、非地形重力波拖曳)的耦合以及其切线线性模型和伴随模型的开发,显著提高了数值天气预测的精度和效率。

英文摘要:

This paper presents TorchNWP, a compilation library tool for the efficient coupling of artificial intelligence components and traditional numerical models. It aims to address the issues of poor cross-language compatibility, insufficient coupling flexibility, and low data transfer efficiency between operational numerical models developed in Fortran and Python-based deep learning frameworks. Based on LibTorch, it optimizes and designs a unified application-layer calling interface, converts deep learning models under the PyTorch framework into a static binary format, and provides C/C++ interfaces. Then, using hybrid Fortran/C/C++ programming, it enables the deployment of deep learning models within numerical models. Integrating TorchNWP into a numerical model only requires compiling it into a callable link library and linking it during the compilation and linking phase to generate the executable. On this basis, tangent linear and adjoint model based on neural networks are implemented at the C/C++ level, which can shield the internal structure of neural network models and simplify the construction process of four-dimensional variational data assimilation systems. Meanwhile, it supports deployment on heterogeneous platforms, is compatible with mainstream neural network models, and enables mapping of different parallel granularities and efficient parallel execution. Using this tool requires minimal code modifications to the original numerical model, thus reducing coupling costs. It can be efficiently integrated into numerical weather prediction models such as CMA-GFS and MCV, and has been applied to the coupling of deep learning-based physical parameterization schemes (e.g., radiation, non-orographic gravity wave drag) and the development of their tangent linear and adjoint models, significantly improving the accuracy and efficiency of numerical weather prediction.

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

↑