Introduction
In high-energy physics, particle accelerators like those at Fermilab are incredibly complex systems where precision is paramount. A critical challenge in their operation is beam loss—the phenomenon where protons deviate from their intended path and strike the machine's walls. This creates radiation and risks damaging sensitive equipment. To mitigate this, researchers have developed a real-time, FPGA-based edge computing system designed to manage beam loss by "de-blending" signals from the Main Injector (MI) and the Recycler Ring (RR).
The system must process data from hundreds of sensors and make control decisions every 3 milliseconds. Traditional computing architectures like CPUs and GPUs, while powerful, are optimized for high throughput through batch processing. However, for "batch size 1" real-time control, these platforms often fail to meet the strict latency requirements due to data transfer overheads.
Methodology
The proposed solution leverages a deep learning approach deployed on an Intel Arria 10 SoC FPGA. The technical implementation is built upon several key pillars:
Model Architecture
The team utilized a U-Net model (comprising 134,434 parameters) for its robust feature extraction capabilities. The encoder-decoder structure with skip connections allows the model to effectively map sensor readings to specific accelerator components. A simpler Multi-Layer Perceptron (MLP) was also evaluated as a baseline.
hls4ml and Optimization
To bridge the gap between high-level machine learning frameworks and hardware description languages, the researchers used hls4ml. This open-source tool converts models from Keras or TensorFlow into high-level synthesis (HLS) code.
A significant innovation in this work is the use of layer-based quantization. Rather than applying a uniform 16-bit precision, the team calculated the maximum output for each individual layer and assigned custom bit-widths. This approach reduced logic utilization on the FPGA from over 100% to just 31%, while simultaneously maintaining an accuracy of over 99%. Additionally, "reuse factors" were tuned to balance the physical circuit size against inference speed.
Performance and Results
The system was evaluated using real-world data from 260 Beam Loss Monitors (BLMs). The input consists of a 260-element array of sensor readings, and the output provides 520 values—probabilities attributing loss to either the MI or RR for each sensor.
The results demonstrate the clear advantage of FPGAs for this application:
- Latency: The total system latency for the U-Net model is 1.74 ms, well within the 3 ms requirement. The FPGA core itself completes inference in just 1.57 ms.
- Throughput: The system achieves 575 frames per second (fps), significantly exceeding the target of 320 fps.
- Accuracy: The optimized U-Net reached 99.1% accuracy for MI predictions and 99.9% for RR predictions.
- Hardware Efficiency: The design utilized 89% of the logic and 85% of the RAM blocks on the Arria 10, demonstrating highly efficient resource allocation.
Discussion and Future Work
While GPUs are standard for many ML tasks, this research highlights that for real-time control where data arrives continuously in small increments, GPUs perform similarly to CPUs. FPGAs emerge as the superior choice for microsecond-to-millisecond latency requirements.
Despite the success, some limitations remain. The U-Net model nearly exhausts the logic resources of the Arria 10, suggesting that more complex models would require larger hardware or further architectural breakthroughs. Additionally, occasional latency spikes (up to 2.27 ms) were noted, likely due to OS-level task scheduling jitter. Future efforts will focus on creating a more generalized template for edge-ML applications in experimental physics, allowing for easier integration of various IP cores.
Summary updated