A Novel Numerical Algorithms Optimization Method with Machine Learning Frameworks: Application on Real-time Plasmas Equilibrium Reconstruction in EXL-50U Spherical Torus

G.H. Zheng 1,4 , S.F. Liu 1∗,2 , X. Gu 3† , Y.P. Zhang 3 , J. Li 3 , Y. Liu 3 , X.C. Lun 3 , L. Xing 3 , J.G. Chen 3 , Z.Y. Chen 3 , Y. Yu 3 , D. Guo 3 , Z.Y. Yang 4 , H.S. Xie 3 , X.M. Song 3 , Y.J. Shi 3 and EXL-50U Team 1 School of Physics, Nankai University, Tianjin 300071, People’s Republic of · 2026

Read A Novel Numerical Algorithms Optimization Method with Machine Learning Frameworks: Application on Real-time Plasmas Equilibrium Reconstruction in EXL-50U Spherical Torus by G.H. Zheng 1,4 , S.F. Liu 1∗,2 , X. Gu 3† , Y.P. Zhang 3 , J. Li 3 , Y. Liu 3 , X.C. Lun 3 , L. Xing 3 , J.G. Chen 3 , Z.Y. Chen 3 , Y. Yu 3 , D. Guo 3 , Z.Y. Yang 4 , H.S. Xie 3 , X.M. Song 3 , Y.J. Shi 3 and EXL-50U Team 1 School of Physics, Nankai University, Tianjin 300071, People’s Republic of (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2601-12378.txt.

Introduction

G. H. Zheng, S. F. Liu, and a large team from the EXL-50U project work on fusion plasmas. Their test bed is a spherical torus used in work on controlled fusion. A key need is to rebuild the shape of the plasma as it runs, in real time. That task rests on number crunching that must be both fast and exact.

The team puts forward a new way to speed up such math. They use machine learning frameworks, namely PyTorch and TensorRT, to tune the code. These tools are modular and can tune themselves, which lowers the work of setup. Their test case is a program called PTEFIT. It shows the method can be fast, flexible, and easy to use at once.

Catalog record

CREATORG.H. Zheng 1,4 , S.F. Liu 1∗,2 , X. Gu 3† , Y.P. Zhang 3 , J. Li 3 , Y. Liu 3 , X.C. Lun 3 , L. Xing 3 , J.G. Chen 3 , Z.Y. Chen 3 , Y. Yu 3 , D. Guo 3 , Z.Y. Yang 4 , H.S. Xie 3 , X.M. Song 3 , Y.J. Shi 3 and EXL-50U Team 1 School of Physics, Nankai University, Tianjin 300071, People’s Republic of
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE29 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2601-12378

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

A Novel Numerical Algorithms Optimization Method with Machine Learning Frameworks: Application on Real-time Plasmas Equilibrium Reconstruction in EXL-50U Spherical Torus G.H. Zheng 1,4 , S.F. Liu 1∗,2 , X. Gu 3† , Y.P. Zhang 3 , J. Li 3 , Y. Liu 3 , X.C. Lun 3 , L. Xing 3 , J.G. Chen 3 , Z.Y. Chen 3 , Y. Yu 3 , D. Guo 3 , Z.Y. Yang 4 , H.S. Xie 3 , X.M. Song 3 , Y.J. Shi 3 and EXL-50U Team 1 School of Physics, Nankai University, Tianjin 300071, People’s Republic of China 2 Academy for Advanced Interdisciplinary Studies, Nankai University, Tianjin 300071, People’s Republic of China 3 ENN Science and Technology Development Co., Ltd., Langfang 065001, People’s Republic of China 4 Southwestern Institute of Physics, Chengdu 610041, People’s Republic of China ∗ Email : [email protected] † Email : [email protected] Abstract This work proposes for the first time a novel optimization method for numerical algorithms, which takes advantages of machine learning frameworks PyTorch and TensorRT, leveraging their modularity, low development threshold, and automatic tuning characteristics to achieve a real-time plasmas reconstruction algorithm called PTEFIT as an application in tokamak-based controlled fusion that combines performance, flexibility, and usability. The algorithm has been deployed and routinely operated on the EXL-50U spherical tokamak, with an average inference time of only 0.268ms per time slice at 129 × 129 129\times 129 resolution, and has successfully driven feedback control of the maximum radial position of plasmas and isoflux control. We believe that its design philosophy has sufficient potential to accelerate development and optimization in GPU parallel computing, and is expected to be extended to other numerical algorithms. Keywords: Numerical optimization, Tokamak equilibrium, Real-time reconstruction, Feedback control I Introduction Traditional numerical computation based on the first principle method always leads to unacceptable time complexity. Although with the rapid development of computation hardwares, it is a feasible way to accelerate relevant algorithms in parallel on GPUs, common researchers still struggle against the high threshold in complex optimization strategies on GPU programming. In this case, machine learning is currently considered as the surrogates for high-fidelity, physical based algorithms. Trained machine learning models are almost entirely composed of matrix multiplication operations, whose computational speed can be significantly improved by parallel optimization. Furthermore, current machine learning frameworks have mature optimizations for various operators and easy to use, some of them even support automatic optimization of computational graphs and kernel functions to achieve maximum instruction throughput, cache hit rate, memory access efficiency, and thread utilization. However, although surrogate models often demonstrate computational speeds that meet requirements in most tasks, their black-box characteristics and limited generalization capability seriously affect their reliability and precision in solving scientific problems, and thus cannot yet serve as a mature solution to completely replace traditional numerical algorithms. In fact, from a computational perspective, there is no essential difference between machine learning and numerical simulation. Therefore, we note that the machine learning frameworks’ powerful optimization capabilities and low development threshold are expected to significantly improve the efficiency of numerical computation. As an application, this paper proposes \mathbf{P} yTorch- \mathbf{T} ensorRT-EFIT (PTEFIT), a GPU-parallel numerical algorithm in plasmas equilibrium reconstruction algorithm based on physical principles, constructed and inferred using machine learning frameworks PyTorch ansel_pytorch_2024 and TensorRT noauthor_nvidia_nodate . PTEFIT takes advantages of PyTorch’s modular characteristic in algorithm construction, which enables the algorithm to flexibly handle different configurations encountered in real-time; the constructed PyTorch modules can be automatically converted to TensorRT engine through Open Neural Network Exchange (ONNX) noauthor_github_nodate . The automatic optimization during TensorRT engine building can completely replace manual optimization of GPU parallel computing programs. Ultimately, PTEFIT achieves a computation time of only approximately 0.268 ms for a single time slice at 129\times 129 resolution, \sim 10^{4}\times faster than offline EFIT and about 2\sim 10\times faster than traditional GPU-accelerated reconstruction. For tokamak-based controlled fusion, equilibrium reconstruction refers to the algorithm that solves for the internal state and distribution of plasmas using measurement data provided in real-time by diagnostics under the axisymmetric approximation. The basic principle of equilibrium reconstruction is to solve the Grad-Shafranov (G-S) equation grad_hydromagnetic_1958 ; xie_what_2026 \Delta^{*}\Psi=-\mu_{0}RJ_{\varphi}=-\mu_{0}R^{2}\dfrac{\text{d}P}{\text{d}\Psi}-\mu_{0}^{2}F\dfrac{\text{d}F}{\text{d}\Psi} (1) to obtain the poloidal magnetic flux distribution \Psi from the toroidal current density J_{\varphi} . In the equation, the Laplacian operator \Delta^{*}=R^{2}\nabla\cdot(\nabla/R^{2}) , R denotes the radial distance from the symmetry axis, P and F represent the plasmas pressure and poloidal current, respectively. In experiments, J_{\varphi} is typically pre-divided into several current filaments or parameterized by preset distributions, such that a finite number of quantities can determine its distribution, thereby enabling the solution through constructing a least squares system of equations G_{\text{P}}J_{\varphi}=b-G_{\text{C}}I_{\text{C}}, (2) where G_{\text{P}} is the mutual inductance matrix between the reconstruction region and diagnostic devices; b represents the physical quantities provided by external diagnostics, such as loop flux and poloidal magnetic field; I_{\text{C}} and G_{\text{C}} denote the poloidal field coil currents and their mutual inductance matrices with the diagnostics, respectively. Other quantities such as magnetic field, safety factor, inductance, and beta can be then calculated given \Psi and J_{\varphi} . Equilibrium reconstruction is crucial for tokamak experiments, as it can not only be used to analyze discharge quality and guide optimization strategies for subsequent experiments, but also provide real-time plasmas state during discharge for various feedback controls. EFIT (Equilibrium FITting code) is currently the most popular tokamak equilibrium reconstruction algorithm lao_reconstruction_1985 , and has been widely used in devices such as DIII-D, EAST, START, HL-2A, HL-3, NSTX, KSTAR, C-MOD, JET, MAST, QUEST, and EXL-50U berkery_kinetic_2021 ; lian_east_2017 ; li_kinetic_2013 ; zhang_reconstruction_2025 ; lao_equilibrium_1990 ; obrien_equilibrium_1992 ; lao_ll_mhd_2005 ; sabbagh_equilibrium_2001 ; jinping_equilibrium_2009 ; park_kstar_2011 ; jiang_kinetic_2021 ; appel_equilibrium_2001 ; in_resistive_2000 ; zwingmann_equilibrium_2003 ; li_yg_efit_2011 ; hongda_study_2006 ; xue_equilibrium_2019 ; appel_lc_unified_2006 . EFIT solves the G-S equation by repeatedly performing Picard iterations for each time slice, calculating relevant plasmas parameters after convergence is achieved. Although EFIT can adequately handle offline reconstruction tasks, its computation time for a single time slice is on the order of seconds, making it unsuitable for direct use in real-time feedback control during discharge. Therefore, equilibrium reconstruction is a typical example for those traditional numerical algorithms facing the trouble to balance the computation accuracy and efficiency. There have been several works attempting to optimize the algorithm for improved computational speed, including methods such as reducing grid resolution moret_tokamak_2015 , presetting certain parameters in a specified tokamak that would otherwise be computed in real-time, and implementing parallel computation on GPUs huang_fast_2017 ; huang_gpu-optimized_2020 ; ma_acceleration_2018 . However, each of the aforementioned methods has its own limitations: reducing resolution degrades accuracy to some extent; frozening certain parameters lowers the algorithm’s generality across different devices and configurations; traditional GPU programming requires complex manual tuning to achieve optimal performance, and the optimal configuration also varies with grid resolution, hardware devices, and other factors. In addition to the above works, many studies have also attempted to surrogate equilibrium reconstruction algorithms with deep neural networks bonotto_reconstruction_2024 ; mcclenaghan_augmenting_2024 ; lu_fast_2023 ; joung_deep_2019 ; lao_application_2022 ; madireddy_efit-prime_2024 ; mitrishkin_new_2021 ; joung_gs-deepnet_2023 ; wai_neural_2022 ; wan_machine-learning-based_2023 ; zheng_real-time_2024 ; zheng_efit-mini_2025 ; zhou_physics-informed_2025 ; ding_physics-informed_2025 ; fiorenza_caronte_2025 , but still cannot be applied widely in experiments for its inherent limitations mentioned above. In this case, PTEFIT is developed

Read the complete text