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, S. F. Liu, X. Gu, Y. P. Zhang, J. Li, Y. Liu, X. C. Lun, L. Xing, J. G. Chen, Z. Y. Chen, Y. Yu, D. Guo, Z. Y. Yang, H. S. Xie, X. M. Song, Y. J. Shi, EXL-50U Team
TL;DR
This work tackles the challenge of real-time plasmas equilibrium reconstruction by introducing PTEFIT, a physics-based, GPU-accelerated pipeline built on PyTorch and TensorRT to deliver EFIT-like reconstructions at real-time speeds. By modularizing the workflow into Green's function generation, LS solutions, Grad-Shafranov solving, flux-surface processing, and optimization, PTEFIT achieves an average per-slice time of $0.268$ ms at a $129\times129$ grid and maintains consistency with offline EFIT within ~1 cm for LCFS metrics. Real-time control demonstrations show PTEFIT enabling PID regulation of the maximum plasma radius $R_{\max}$ and isoflux feedback, highlighting practical impact for tokamak experiments. The results suggest a scalable framework that leverages mutual ML frameworks for numerical optimization and can generalize to other real-time numerical algorithms in fusion and beyond.
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\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.
