Enabling Low-Latency Machine learning on Radiation-Hard FPGAs with hls4ml
Authors: Katya Govorkova, Julian Garcia Pardinas, Vladimir Loncar, Victoria Nguyen, Sebastian Schmitt, Marco Pizzichemi, Loris Martinazzoli, Eluned Anne Smith
Organizations: Massachusetts Institute of Technology (MIT), 77 Massachusetts Ave, Cambridge, MA 02139, USA · Department of Experimental Physics, European Organization for Nuclear Research (CERN), 1211 Geneva 23, Switzerland · University of Milano-Bicocca (Italy), and Department of Experimental Physics, European Organization for Nuclear Research (CERN), 1211 Geneva 23, Switzerland
This paper presents an end-to-end demonstration of a viable, ultra-fast, radiation-hard machine learning (ML) application on FPGAs, which could be used in future high-energy physics experiments. We present a three-fold contribution, with the PicoCal calorimeter, planned for the LHCb Upgrade II experiment, used as a test case. First, we develop a lightweight autoencoder to compress a 32-sample timing readout, representative of that of the PicoCal, into a two-dimensional latent space. Second, we introduce a systematic, hardware-aware quantization strategy and show that the model can be reduced to 10-bit weights with minimal performance loss. Third, as a barrier to the adoption of on-detector ML is the lack of support for radiation-hard FPGAs in the High-Energy Physics community's standard ML synthesis tool, hls4ml, we develop a new backend for this library. This new back-end enables the automatic translation of ML models into High-Level Synthesis (HLS) projects for the Microchip PolarFire family of FPGAs, one of the few commercially available and radiation hard FPGAs. We present the synthesis of the autoencoder on a target PolarFire FPGA, which indicates that a latency of 25 ns can be achieved. We show that the resources utilized are low enough that the model can be placed within the inherently protected logic of the FPGA. Our extension to hls4ml is a significant contribution, paving the way for broader adoption of ML on FPGAs in high-radiation environments.
Figures & tables
Figure 1: Training and validation loss curves for the full-precision autoencoder (in green) and the quantized autoencoder (in pink), discussed fully in Sec. 4 . The y-axis uses a logarithmic scale to emphasize convergence behavior.
Figure 2: Examples of autoencoder reconstruction performance on calorimeter pulse shapes from the test set. Original waveforms (solid blue lines) are compared with their corresponding reconstructions (dashed/dotted lines). In green is the full precision model (AE), in pink is the quantized model that produced the latent space running on the actual hardware (FPGA). The orange line is also produced from a the latent space running on the actual hardware, but uses a more aggressively quantized model (nano-FPGA), discussed in Sec. 4 . Visual agreement is supported by low MSE values across diverse pulse amplitudes, highlighting the robustness of the reconstruction.
Figure 3: Correlation between latent space variables of the full-precision autoencoder and three pulse-level features on the test set: rise time (10%–90% interval), pulse true timestamp, and peak amplitude. Each row corresponds to one latent dimension ( z[0],z[1] ), and each column to one feature. Scatter plots include Pearson’s r and Spearman’s ρ coefficients in the titles. The latent representation is strongly correlated with peak amplitude, while correlations with timing features (rise time and cell time) are weaker.
Figure 4: Residual distributions between CFD-reconstructed timestamps and true simulation times for original and autoencoder-reconstructed pulses (left), and the ratio of their absolute values (right). Reconstruction systematically reduces the timing residual for approximately half of the events.
Figure 5: Histogram of the ratio of absolute differences in 10–90 % rise time: (reconstructed vs. 32-sample original) relative to (32-sample original vs. 1024-sample original).
Figure 6: Timestamp–residual distributions for the timestamps predicted using linear regression. The panel shows the histogram of Δt=t^−ttrue ; the legend reports the mean μ and standard deviation σ . All values are in units of samples.
Figure 7: The impact of quantization on the autoencoder’s reconstruction performance (left). The average Mean Squared Error (MSE) is evaluated on the test dataset for different fixed-point bit widths. The green dashed line shows the MSE for non-quantized model. On the right is the distribution of the test MSE for the full precision model vs quantized to 10 bits.
FPGA setup
Value
II
Latency
fmax [MHz]
LUTs
DFFs
MPF100T
FPGA
4
24
180
7956 ( 7.3% )
5893 ( 5.4% )
nFPGA
3
4
280
3221 ( 3.0% )
2059 ( 1.9% )
MPF300TS
FPGA
4
24
212
7953 ( 2.7% )
5825 ( 1.9% )
nFPGA
3
4
309
3211 ( 1.1% )
1861 ( 0.6% )
Libero MPF300TS
FPGA
4
24
212
5578 ( 1.9% )
6383 ( 2.1% )
Table 1: Post-synthesis resource utilization per channel and performance for the autoencoder model on a Microchip PolarFire MPF100T-FCVG484I and MPF300TS-FCG1152I FPGA. The utilisation is quoted for the nano-FPGA and full FPGA model using the extrapolation from SmartHLS and the Libero Design suite, which is used to program the FPGA. The target clock frequency for every scenario is 160 MHz (6.25 ns period). The initiation interval (II) and latency are given in units of clock cycles. The Libero MPF300TS row indicates the performance numbers obtained by running the algorithm on the actual MPF300TS FPGA, as opposed to via co-simulation.
Figure 8: The floorplan of the nFPGA model. The core functionality includes the encoder, UART communication, and storage of weights and biases. For the encoder logic, separate markers are used to illustrate what operations are performed. N/A collects everything else from LED toggles to reset switches. The floorplan is zoomed in for visualization purposes.
PQuantML is a new open-source, hardware-aware neural network model compression library tailored to end-to-end workflows. Motivated by the need to deploy performant models to environments with strict latency constraints, PQuantML simplifies training of compressed models by providing a unified interface to apply pruning and quantization, either jointly or individually. The library implements multiple pruning methods with different granularities, as well as fixed-point quantization with support for High-Granularity Quantization. We evaluate PQuantML on representative tasks such as the jet substructure classification, so-called jet tagging, an on-edge problem related to real-time LHC data processing. Using various pruning methods with fixed-point quantization, PQuantML achieves substantial parameter and bit-width reductions while maintaining accuracy. The resulting compression is further compared against existing tools, such as QKeras and HGQ.
Roope Niemi, Anastasiia Petrovych, Arghya Ranjan Das +9
European Center for Nuclear Research (CERN), CH-1211 Geneva, Switzerland · Purdue University, West Lafayette, IN 47907, USA · California Institute of Technology, Pasadena, CA 91125, United States +4
Quantum machine learning (QML) algorithms in high energy physics (HEP) can efficiently represent and leverage long-range, high-order correlations in high-dimensional collider data, potentially with fewer parameters and favorable scaling relative to classical models. Deployment of QML in real-time collider applications such as trigger systems requires the ability to emulate and compile quantum circuits classically, then synthesize the resulting quantum gates onto low-latency hardware accelerators, namely field-programmable gate arrays (FPGAs). We present a study of variational quantum autoencoder models for real-time anomaly detection triggers in modern collider experiments. The models achieve performance comparable to state-of-the-art classical approaches and, after FPGA synthesis, satisfy resource usage and timing constraints consistent with trigger applications in future colliders. This work provides one of the first FPGA implementations of QML models for HEP triggers, enabling higher-capability models in today's classical data acquisition pipelines while advancing quantum readiness of collider experiment infrastructure.
Ivan Ge, Sagar Addepalli, Abhilasha Dave +1
Department of Physics, Stanford University, 450 Jane Stanford Way, Stanford, 94305, CA, USA. · SLAC National Accelerator Laboratory, 2575 Sand Hill Road, Menlo Park, 94025, CA, USA.
Spiking Neural Networks (SNNs) provide a naturally temporal machine-learning framework. Their neurons maintain an internal state and propagate information through discrete spikes, enabling low-latency temporal inference. Although SNNs are often associated with asynchronous neuromorphic processors, many scientific real-time inference systems rely on conventional synchronous field-programmable gate arrays (FPGAs) and high-level synthesis (HLS) workflows. In this paper we present an extension of hls4ml that enables clock-driven deployment of SNNs trained in pytorch onto FPGA firmware. We demonstrate the workflow using a dense quantised SNN trained on the Heidelberg Spiking Digits dataset where it achieves inference latencies of approximately 34μs. We validate the generated design through software reference comparisons, HLS C simulation, HLS synthesis, export, and Vivado synthesis reports. This work opens up the hls4ml toolkit to neuromorphic computing, allowing streamlined optimisation, synthesis, and deployment of SNN models for real-time inference.