[Paper Review] Speeding up Madgraph5 aMC@NLO through CPU vectorization and GPU offloading: towards a first alpha release
This paper presents a major performance overhaul of Madgraph5_aMC@NLO by accelerating matrix element calculations through CPU vectorization (AVX512) and GPU offloading (CUDA, SYCL), achieving up to 16x speedup on vector CPUs and significant gains on GPUs. The work enables full integration into the MadEvent framework, with a first alpha release targeted for Q2 2023, supporting LHC-level QCD processes with full physics fidelity and improved throughput.
The matrix element (ME) calculation in any Monte Carlo physics event generator is an ideal fit for implementing data parallelism with lockstep processing on GPUs and vector CPUs. For complex physics processes where the ME calculation is the computational bottleneck of event generation workflows, this can lead to large overall speedups by efficiently exploiting these hardware architectures, which are now largely underutilized in HEP. In this paper, we present the status of our work on the reengineering of the Madgraph5_aMC@NLO event generator at the time of the ACAT2022 conference. The progress achieved since our previous publication in the ICHEP2022 proceedings is discussed, for our implementations of the ME calculations in vectorized C++, in CUDA and in the SYCL framework, as well as in their integration into the existing MadEvent framework. The outlook towards a first alpha release of the software supporting QCD LO processes usable by the LHC experiments is also discussed.
Motivation & Objective
- To address the underutilization of modern HPC hardware—especially vector CPUs and GPUs—in High Energy Physics (HEP) workloads, particularly in Monte Carlo event generation.
- To redesign the matrix element (ME) calculation in Madgraph5_aMC@NLO to exploit data parallelism and lockstep execution on vectorized CPUs and GPUs.
- To integrate high-performance ME implementations (CUDA, SYCL, vectorized C++) into the existing MadEvent framework without altering its Fortran-based outer shell.
- To enable full LHC-compatible event generation with unweighted samples, including stochastic helicity and color choices, for production use.
- To deliver a first alpha release of the accelerated framework by Q2 2023, supporting QCD LO processes with identical physics output and drastically reduced computational cost.
Proposed method
- Reimplementing the matrix element calculation using vectorized C++ with AVX512 intrinsics to achieve theoretical SIMD speedups of up to x16 in single precision and x8 in double precision on modern CPUs.
- Porting the ME calculation to CUDA for NVIDIA GPUs, achieving 100% branch efficiency and lockstep processing for maximum GPU utilization.
- Implementing a portable ME kernel using SYCL and the sycl::vec abstraction, enabling execution on heterogeneous architectures including AMD and Intel GPUs.
- Integrating the new data-parallel ME kernels into the existing MadEvent framework, replacing only the scalar Fortran ME module while preserving the rest of the workflow.
- Optimizing the serial components of MadEvent (e.g., random number generation, unweighting, I/O) to mitigate their performance bottleneck after ME acceleration.
- Introducing a mixed-precision mode to balance accuracy and performance, using single and double precision selectively across the ME computation.
![Figure 1: Total combined throughput for the $gg\!\rightarrow\!t\bar{t}gg$ process using 1, 2, 4 or 8 copies of our standalone application (see Ref. [ 1 ] ), as a function of the CUDA grid size (number of blocks per grid times number of threads per block — ”gt00256” indicates that the latter is fixed](https://ar5iv.labs.arxiv.org/html/2303.18244/assets/fig/bmkcuda.png)
Experimental results
Research questions
- RQ1Can matrix element calculations in Madgraph5_aMC@NLO be accelerated via CPU vectorization and GPU offloading while preserving physics accuracy and interface compatibility?
- RQ2To what extent can data parallelism and lockstep execution be achieved in the ME calculation, and what performance gains are possible on modern vector CPUs and GPUs?
- RQ3How can performance portability frameworks like SYCL enable cross-architecture deployment of high-performance ME kernels without sacrificing efficiency?
- RQ4What impact does the stochastic selection of helicity and color states have on lockstep processing and overall performance in GPU and vector CPU execution?
- RQ5What are the key performance bottlenecks in the MadEvent framework after ME acceleration, and how can they be mitigated to enable a production-ready alpha release?
Key findings
- The vectorized C++ implementation on a single AVX512-capable CPU core achieves theoretical speedups of up to x16 in single precision and x8 in double precision.
- The CUDA implementation achieves 100% branch efficiency on NVIDIA GPUs, enabling near-ideal lockstep execution and significant speedups over scalar Fortran.
- The SYCL-based ME kernel is fully integrated into MadEvent and successfully offloads ME calculations to AMD and Intel GPUs, enabling full LHC-compatible event generation on non-NVIDIA hardware.
- A prototype vectorized SYCL implementation for CPUs shows performance comparable to or exceeding that of gcc-compiled CUDA/C++ builds, likely due to the use of the Intel icx compiler with aggressive inlining and vectorization.
- The integration of event-by-event random helicity and color selection—previously the final missing piece—has been completed, enabling full unweighted event generation with correct physics output.
- Performance comparisons show that icx-compiled builds of the CUDA/C++ kernel outperform gcc builds by more than a factor of 2 in some cases, especially with AVX512 and aggressive inlining.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.