25–28 Sept 2023
Imperial College London
Europe/London timezone

Real-Time Instability Tracking with Deep Learning on FPGAs in Magnetic Confinement Fusion Devices

26 Sept 2023, 15:15
15m
Blackett Laboratory, Lecture Theatre 1 (Imperial College London)

Blackett Laboratory, Lecture Theatre 1

Imperial College London

Blackett Laboratory
Standard Talk Contributed Talks Contributed Talks

Speaker

Ryan Forelli (Lehigh University)

Description

The Tokamak magnetic confinement fusion device is one leading concept design for future fusion reactors which require extremely careful control of plasma parameters and magnetic fields to prevent fatal instabilities. Magneto-hydrodynamic (MHD) instabilities occur when plasma confinement becomes unstable as a result of distorted non-axisymmetric magnetic field lines. These ``mode'' instabilities often lead to contact with the chamber wall, confinement loss, and damage to the reactor. Therefore, active control and suppression of these instabilities on microsecond time scales \cite{R1} is required and will be critical to the reliability of future fusion reactors. We address this need by applying deep learning methods to develop a novel real-time FPGA (Field Programmable Gate Array)-accelerated instability tracking feedback control system for the HBT-EP Tokamak.
Enabling active control requires real-time mode tracking capabilities where knowledge of the amplitude and phase of these instabilities affects corrections in magnetic confinement and plasma parameters. In microsecond latency applications such as this, convolutional neural networks (CNNs) deployed to hardware accelerators such as FPGAs provide a robust solution. The emission mechanism produces short plasma discharges resulting in a highly nonlinear system making CNNs an ideal choice for modeling a function which yields the sine and cosine components of the MHD instability. The predicted amplitude and phase are subsequently calculated for comparison with measurements obtained from over two-hundred magnetic sensors which provide a ground truth. Among tested algorithms, the CNN was most accurate at predicting the instability’s sine and cosine components.
Optical input is supplied to the CNN from a Phantom S710 high-speed streaming camera aimed through a viewport aligned tangent to the Tokamak chamber (see figure 1). Typically a dedicated PCIe frame grabber is paired with cameras in high throughput applications such as this to convert raw camera data to pixel values. Using hls4ml, we compile a high-level synthesis representation of the CNN and synthesize to a register-transfer level (RTL) design using the Xilinx development suite \cite{R3}. Our latency requirements mean data transfer to a second PCIe accelerator is not a viable solution. Therefore, we deploy our neural network to the available portion of the frame grabbers FPGA, all but eliminating PCIe and DMA overhead. We write these predictions serially over high-speed RS422 outputs to digital-to-analog converters, and finally, to the Tokamak's magnetic coil control system.
To achieve our target latency within strict resource constraints while meeting timing constraints, we optimize our model by applying the following optimizations: tuning strategy by layer, tuning reuse factor by layer, post-training quantization, pruning, ReLU merging, batching, physical optimization looping, and more. Finally, we benchmark our CNN implementation at <10us empirically by timing the assertions of the CNNs axi-stream interface control signals; with an overall latency including exposure and readout of 20us. We also pipeline computation with readout to achieve >100kfps throughput.
Ultimately, this work aims to enable active control and suppression of MHD instabilities in magnetic confinement fusion devices such as the Tokamak and future fusion reactors.

Figure 1: https://drive.google.com/file/d/12XKTKWd1FGyMMIKngMPXvcCYvVFDB0Ba/view?usp=sharing

Primary authors

Ryan Forelli (Lehigh University) Yumou Wei (Columbia University)

Co-authors

Chris Hansen (Columbia University) Christian Herwig (Fermi National Accelerator Lab. (US)) Giuseppe Di Guglielmo (Fermilab) Jeff Levesque (Columbia University) Jonathan Eisch (Fermi National Accelerator Laboratory) Joshua Agar Jovan Mitrevski (Fermi National Accelerator Lab. (US)) Nhan Tran (Fermi National Accelerator Lab. (US))

Presentation materials