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

📅 2026-03-17
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the challenges of coupling Fortran-based numerical models with Python deep learning frameworks, particularly low data transfer efficiency and integration complexity. To overcome these issues, the authors propose TorchNWP, a compilation library that leverages LibTorch to statically compile PyTorch models into C/C++ interfaces, enabling efficient embedding via mixed Fortran/C/C++ programming. The framework innovatively supports automatic generation of tangent linear and adjoint models of neural networks at the C/C++ layer, abstracting internal model structures and thereby simplifying the implementation of four-dimensional variational data assimilation systems. Additionally, it facilitates deployment on heterogeneous platforms and supports multi-granularity parallelism. The approach has been successfully integrated into operational numerical weather prediction systems such as CMA-GFS and MCV, significantly improving forecast accuracy and computational efficiency in radiation and non-orographic gravity wave drag parameterizations.

Technology Category

Machine Learning: Hardware-aware MLNatural Language Processing: Learning & Optimization for NLPCognitive Modeling & Cognitive Systems: Neural Spike Coding

Application Category

Systems and Infrastructure for Web, Mobile and WoT: Applied ML and AI for Web-based mobile applicationsGraph Algorithms and Modeling for the Web: Graph neural networks and deep learning approaches for Web-related graphsUser Modeling, Personalization and Recommendation: Federated recommendation systems and personalization
📝 Abstract
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.
Problem

Research questions and friction points this paper is trying to address.

cross-language compatibility
coupling flexibility
data transfer efficiency
numerical weather prediction
deep learning integration
Innovation

Methods, ideas, or system contributions that make the work stand out.

tangent linear model
adjoint model
compiler library
neural network coupling
numerical weather prediction
🔎 Similar Papers
💼 Related Jobs
No related jobs found.
S
Sa Xiao
State Key Laboratory of Severe Weather Meteorological Science and Technology (LaSW), Beijing, China; CMA Earth System Modeling and Prediction Centre (CEMC), Beijing, China
H
Hao Jing
State Key Laboratory of Severe Weather Meteorological Science and Technology (LaSW), Beijing, China; CMA Earth System Modeling and Prediction Centre (CEMC), Beijing, China
H
Honglu Sun
State Key Laboratory of Severe Weather Meteorological Science and Technology (LaSW), Beijing, China; CMA Earth System Modeling and Prediction Centre (CEMC), Beijing, China
H
Haoyu Li
State Key Laboratory of Severe Weather Meteorological Science and Technology (LaSW), Beijing, China; CMA Earth System Modeling and Prediction Centre (CEMC), Beijing, China