Distance-Weighted Graph Neural Networks on FPGAs for Real-Time Particle Reconstruction in High Energy Physics

Yutaro Iiyama, Gianluca Cerminara, Abhijay Gupta, Jan Kieseler, Vladimir Loncar, Maurizio Pierini, Shah Rukh Qasim, Marcel Rieger, Sioni Summers, Gerrit Van Onsem, Kinga Anna Wozniak, Jennifer Ngadiuba, Giuseppe Di Guglielmo, Javier M. Duarte, Philip C. Harris, Dylan S. Rankin, Sergo Jindariani, Mia Liu, Kevin Pedro, Nhan Tran, Edward Kreinar, Zhenbin Wu · DOI

Abstract

Graph neural networks have been shown to achieve excellent performance for several crucial tasks in particle physics, such as charged particle tracking, jet tagging, and clustering. An important domain for the application of these networks is the FGPA-based first layer of real-time data filtering at the CERN Large Hadron Collider, which has strict latency and resource constraints. We discuss how to design distance-weighted graph networks that can be executed with a latency of less than 1$\mu\mathrm{s}$ on an FPGA. To do so, we consider a representative task associated to particle reconstruction and identification in a next-generation calorimeter operating at a particle collider. We use a graph network architecture developed for such purposes, and apply additional simplifications to match the computing constraints of Level-1 trigger systems, including weight quantization. Using the $\mathtt{hls4ml}$ library, we convert the compressed models into firmware to be implemented on an FPGA. Performance of the synthesized models is presented both in terms of inference accuracy and resource usage.

Introduction

At the CERN Large Hadron Collider (LHC), proton beams collide every 25 nanoseconds, generating a massive volume of data that exceeds storage capacities. To manage this, a "trigger" system filters out uninteresting events in real-time. The Level-1 Trigger (L1T), the first layer of this system, is implemented on FPGAs and must process data and make a decision in less than 1 microsecond.

As detector geometries evolve—such as the upcoming High-Granularity Calorimeter (HGCal) at CMS—traditional computer vision techniques like Convolutional Neural Networks (CNNs) struggle with the sparse and irregular nature of the data. Graph Neural Networks (GNNs) are a natural fit for this "point cloud" data. However, GNNs are typically too computationally expensive for the strict latency and resource constraints of L1T hardware. This research addresses the challenge of optimizing a GNN to fit within these sub-microsecond constraints.

The GarNet Architecture and FPGA Optimization

The researchers adapted the GarNet (Distance-Weighted Graph Network) architecture for FPGA deployment using the hls4ml library. GarNet is designed to handle irregular data by learning to aggregate information based on the spatial distance between nodes.

The GarNet architecture stages, showing distance-weighted aggregation and feature transformation.

To meet the L1T requirements, several architectural simplifications were implemented:

  • Linearized Layers: Non-linear activations (like tanh) were removed from internal layers. The model instead relies on the inherent non-linearity of the distance-weighting function ($exp(-d^2)$) to capture complex patterns.
  • Aggregation Strategy: "Max" aggregation was replaced with "mean" aggregation to simplify the hardware data flow.
  • Lookup Tables (LUTs): The exponential distance function was pre-computed and stored in a 12-bit lookup table to avoid expensive on-the-fly calculations.
  • Ternary Quantization: Using QKeras, the model was trained with weights restricted to $\{-1, 0, 1\}$. This allows the FPGA to replace power-hungry multipliers with simple additions and subtractions, significantly saving Digital Signal Processing (DSP) slices.

Dataset and Calorimeter Geometry

The study utilized a simulated 3D imaging calorimeter dataset designed to mimic the irregularities of next-generation detectors.

Calorimeter geometry showing regions of varying granularity.

The detector model consists of a 50-layer tungsten structure featuring both high-granularity and low-granularity regions. The task involves simultaneous classification (identifying electrons vs. pions) and energy regression. The input consists of clusters of up to 128 "hits," each defined by $(x, y, z)$ coordinates and energy deposition, simulated via Geant4 with "pileup" noise included.

Key Results and Performance

The optimized GNN achieved remarkable results on hardware:

  • Latency: The quantized model reached a total latency of 740 ns (148 clock cycles at 200 MHz), well within the 1 $\mu$s L1T limit.
  • Accuracy: Despite heavy quantization, the model achieved an AUC of 0.98 for particle classification, nearly matching the performance of full-precision models.
  • Resource Efficiency: Ternary weights reduced DSP usage by nearly 50%, allowing the design to fit onto a single Xilinx Kintex UltraScale FPGA.
  • Robustness: The distance-weighting mechanism acts as a "soft" attention filter, effectively ignoring "pileup" noise by assigning it low weights, which improves energy regression accuracy compared to traditional methods.

Conclusion and Future Work

This work demonstrates that complex GNNs can be successfully deployed in the most demanding real-time environments of high-energy physics. While the current implementation achieves the required latency, future work will focus on improving the Initiation Interval (II) to handle the full 40 MHz collision rate without extensive time-multiplexing. Additionally, exploring lower-bitwidth quantization for distance parameters could further optimize resource usage.

Summary updated

BibTeX
@inproceedings{iiyama2020distance,
  author = {Yutaro Iiyama and Gianluca Cerminara and Abhijay Gupta and Jan Kieseler and Vladimir Loncar and Maurizio Pierini and Shah Rukh Qasim and Marcel Rieger and Sioni Summers and Gerrit Van Onsem and Kinga Anna Wozniak and Jennifer Ngadiuba and Giuseppe Di Guglielmo and Javier M. Duarte and Philip C. Harris and Dylan S. Rankin and Sergo Jindariani and Mia Liu and Kevin Pedro and Nhan Tran and Edward Kreinar and Zhenbin Wu},
  title = {{Distance-Weighted Graph Neural Networks on FPGAs for Real-Time Particle Reconstruction in High Energy Physics}},
  booktitle = {Frontiers Big Data},
  year = {2020},
  url = {https://openreview.net/forum?id=lim7rCLpQnX},
}
Figure