MadSpace -- Event Generation for the Era of GPUs and ML

arXiv:2602.06895 · hep-ph · Submitted 2026-02-06 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: High Energy Physics: Phenomenology. The day in particle phenomenology: models, signatures and constraints.

Kai: We're looking at the paper: "MadSpace -- Event Generation for the Era of GPUs and ML".

Title and authors: Kai: So we're looking at "MadSpace -- Event Generation for the Era of GPUs and ML". It sounds like they're trying to solve a big problem with how fast we can make these simulated events.

Mira: Yeah, it’s about making the simulation pipeline faster, specifically because traditional methods are becoming a bottleneck for future data sets. The authors are Theo Heimel, Olivier Mattelaer and Ramon Winterhalder.

Lev: From my side, I'm thinking about how much overhead these new methods add to actually running things on real hardware. If you have a complex compute graph, that graph execution model they use needs to be super efficient for both CPUs and GPUs simultaneously.

Kai: Exactly. They’re using this whole compute-graph idea to tie everything together—phase space construction, adaptive sampling, and even unweighting of events in one place. It's about unifying those steps so you don't have to manage separate pieces of code for each part of the process.

Mira: And that unification is key because it lets them plug in different methods later, like neural importance sampling or specific mappings, without rewriting the whole simulation chain every time you want to test something new.

Lev: That modularity is good for development, but on a GPU implementation, every component needs to be designed with massive parallelism in mind so that those batches of events don't just sit there waiting for the next step.

Kai: Right. It moves the heavy lifting from sequential steps to parallel graph execution, which is a big shift from how most older generators are structured.

The paper's summary: Mira: They’re tackling the core issue that at leading order, evaluating cross sections and generating unweighted events just boils down to calculating integrals over phase space points, which isn't feasible analytically.

Kai: So they introduce a way to map those points from a unit hypercube onto the actual physical phase space using an invertible mapping. That mapping then gives you a sampling density that helps you optimize how you sample those events for Monte Carlo integration.

Lev: I see the math here, it mentions the Jacobian determinant of that inverse mapping which is what controls the variance of your new integrand, and they say this variance is minimized when you use an ideal mapping.

Kai: They aren't just talking about one mapping; they have several—things like recursive decomposition based on scattering and decay blocks, and analytic mappings for things like resonances, such as the Breit–Wigner mapping for finite-width particles.

Mira: The summary emphasizes that this framework integrates phase-space construction, adaptive sampling routines like VEGAS or normalizing flows, PDF convolutions, and matrix element evaluation into a single compute graph.

Lev: That single graph execution model is what I care about—it enforces that separation between the physics logic and the hardware implementation so you can swap out numerical solvers without breaking the whole thing.

Kai: It also includes an interface called UMAMI, which lets you call matrix elements from CUDACPP plugins without needing process-specific code generation at integration time. That’s a big deal for flexibility on real hardware.

The paper's improvements: Kai: They suggest a couple of key improvements to make it even better, starting with how they handle mappings. Specifically, the FastRambo mapping replaces the numerically expensive polynomial inversion step in RamboOnDiet with a fully analytical rational quadratic transformation.

Mira: That trades perfect flatness for more numerical stability and higher throughput when you use vectorized hardware, which is important because in practice, perfect flatness is rarely what limits performance anymore.

Lev: I agree, stability trumps perfect mathematical accuracy when you’re running simulations that need to finish in a reasonable amount of time on a real cluster. It sounds like they’ve optimized the mapping for speed over theoretical purity here.

Kai: They also suggest a systematic study of neural importance sampling, looking at training strategies and scaling it up to higher-multiplicity final states. That means making the ML sampling methods more robust for more complex physics scenarios.

Mira: And beyond that, they’re looking at differentiability, which would let you compute gradients of weighted observables directly with respect to theory parameters like masses or couplings.

Lev: That’s where it gets interesting for parameter estimation; being able to get gradients at the generator level means you can profile things much more efficiently than running a whole new simulation just to check one parameter.

Kai: They also mention adding support for more phase-space mappings, like sector decompositions related to FKS theory, which lets you handle more complex physics structures beyond the simplest leading order calculations.

Conclusion: Mira: So what we’re looking at with this paper, "MadSpace -- Event Generation for the Era of GPUs and ML," is a C++ library that builds a unified compute graph for event generation that runs natively on both CPUs and GPUs using CUDA or HIP.

Kai: It aims to take those complex steps—from phase space mapping to adaptive sampling—and put them in one place, making end-to-end on-device workflows possible without messy host-device transfers.

Lev: For me, the biggest practical win is that the compute graph structure means we can swap out how the math is solved for sampling or mapping without having to rebuild the entire simulation pipeline from scratch.

Kai: It also provides tools like UMAMI to make calling matrix elements flexible for different hardware, which opens up ways to run these simulations end-to-end on dedicated hardware.

Mira: Overall, this framework gives us a solid building block that handles traditional Monte Carlo integration alongside modern ML approaches within the same infrastructure.

Lev: It’s a tool that helps address the bottleneck where simulation speed limits how much data we can collect at future colliders.

Université catholique de Louvain · Università degli Studi di Milano · INFN Sezione di Milano

hep-ph

Submitted: 2026-02-06

Updated: 2026-11-17

Comments: 43 pages, 11 figures

Project page: https://imlwg.github.io/HEPML-LivingReview

License: http://creativecommons.org/licenses/by/4.0/

Importance score: 92/100

The gist: MadSpace is a new modular phase-space and event-generation library written in C++ with native GPU support via CUDA and HIP that provides a unified compute-graph-based framework for phase-space…

Key concepts

Compute Graph Execution Model
This model structures the simulation like a deep learning framework (e.g., TensorFlow). It strictly separates the physics logic from the hardware implementation, allowing operations to be executed in parallel across CPUs and GPUs without needing to modify global program states, which simplifies correctness and reproducibility.
UMAMI Interface
This interface provides a flexible way to call matrix element code used for both phase-space integration and event generation. It supports end-to-end GPU workflows, meaning events can be generated entirely on the GPU without requiring slow data transfers between the main computer memory (host) and the graphics card (device).

Terminology

Summary

MadSpace is a new modular phase-space and event-generation library written in C++ with native GPU support via CUDA and HIP that provides a unified compute-graph-based framework for phase-space construction, adaptive and neural importance sampling, and event unweighting <ref:2602. p. 0

Where the paper says it

SciPost Physics Codebases Submission MadSpace – Event Generation for the Era of GPUs and ML Theo Heimel1 , Olivier Mattelaer1 , and Ramon Winterhalder2 1 CP3, Université catholique de Louvain, Louvain-la-Neuve, Belgium 2 TIFLab, Università degli Studi di Milano & INFN Sezione di Milano, Italy July 23, 2026 Abstract MadSpace is a new modular phase-space and event-generation library written in C++ with native GPU support via CUDA and HIP. It provides a unified compute-graph-based framework for phase-space construction, adaptive and neural importance sampling, and event unweighting.

06895#pg2> It is designed from the ground up to run efficiently on both CPUs and GPUs while supporting end-to-end on-device workflows <ref:2602. p. 1
Where the paper says it

A fully featured and modular GPU-based phase-space generator — supporting standard techniques such as multi-channel integration and Rambo-style mappings [64–66] — is missing in the MadGraph ecosystem. In this paper, we present MadSpace, a new modular and hardware-optimized phase-space and event-generation library written in C++ including CUDA and HIP kernels, designed from the ground up to run efficiently on both CPUs and GPUs.

06895#pg4> The framework aims to provide a fully GPU-enhanced simulation pipeline by integrating phase-space construction, adaptive sampling, PDF convolutions, and matrix element evaluation into a single compute graph <ref:2602. p. 0
Where the paper says it

SciPost Physics Codebases Submission MadSpace – Event Generation for the Era of GPUs and ML Theo Heimel1 , Olivier Mattelaer1 , and Ramon Winterhalder2 1 CP3, Université catholique de Louvain, Louvain-la-Neuve, Belgium 2 TIFLab, Università degli Studi di Milano & INFN Sezione di Milano, Italy July 23, 2026 Abstract MadSpace is a new modular phase-space and event-generation library written in C++ with native GPU support via CUDA and HIP. It provides a unified compute-graph-based framework for phase-space construction, adaptive and neural importance sampling, and event unweighting.

06895#pg2>

Phase-Space Construction and Mappings

The paper details the implementation of various phase-space mappings inspired by Feynman diagram topologies to locally flatten dominant variations of the integrand <ref:2602.06895#pg6> These mappings include a recursive decomposition into elementary scattering and decay building blocks, organized as a sequence of building blocks <ref:2602. p. 4

Where the paper says it

An alternative parametrization of the final-state kinematics in terms of transverse momenta, rapidities, and azimuthal angles, following the Chili [45] approach is also available in MadSpace. 2 Recursive phase-space decomposition The channel mappings employed in MadSpace are based on the recursive decomposition of the tree-level n-body phase space, organized as a sequence of elementary scattering and decay building blocks.

06895#pg5> Analytic phase-space mappings are used to reflect dominant structures like resonances, such as the Breit–Wigner mapping for finite-width resonances <ref:2602. p. 5
Where the paper says it

1 Analytic phase-space mappings Analytic phase-space mappings define invertible transformations from uniformly distributed random numbers r ∈ [0, 1] to physical phase-space variables x ∈ Φ, together with the associated Jacobian densities. They are used to reflect dominant structures of the integrand, such as resonances, thresholds, soft or collinear enhancements, or phase-space boundaries, and are reused across multiple phase-space building blocks to locally flatten the dominant variations of the integrand.

06895#pg8> The construction of these mappings is guided by physics insight into the analytic structure of scattering amplitudes <ref:2602. p. 4
Where the paper says it

In MadSpace, we implement all phase-space transformations as fully invertible maps and thus retain the flexibility to realize both multi-channel strategies within a common framework. The construction of the channel mappings Gi is guided by physics insight into the analytic structure of scattering amplitudes, such as resonant propagators, soft and collinear limits, and small momentum-transfer regions.

06895#pg4> Furthermore, recursive phase-space decomposition organizes the n-body phase space as a sequence of elementary scattering and decay building blocks <ref:2602. p. 4
Where the paper says it

An alternative parametrization of the final-state kinematics in terms of transverse momenta, rapidities, and azimuthal angles, following the Chili [45] approach is also available in MadSpace. 2 Recursive phase-space decomposition The channel mappings employed in MadSpace are based on the recursive decomposition of the tree-level n-body phase space, organized as a sequence of elementary scattering and decay building blocks.

06895#pg5>

Adaptive Sampling and Integration Strategies

MadSpace supports adaptive sampling routines natively on GPUs, including VEGAS [42, 67, 68] and normalizing flows <ref:2602.06895#pg2> For neural importance sampling, MadSpace employs normalizing flows based on rational-quadratic spline transformations <ref:2602. p. 0

Where the paper says it

It provides a unified compute-graph-based framework for phase-space construction, adaptive and neural importance sampling, and event unweighting. It includes a wide range of mappings, from the standard MadGraph multi-channel phase space to optimized normalizing flows with analytic inverse transformations.

06895#pg2> The compute-graph execution model allows adaptive samplers to be implemented as interchangeable graph components that transform uniformly distributed random numbers into sampling distributions optimized for the target integrand <ref:2602. p. 0
Where the paper says it

It provides a unified compute-graph-based framework for phase-space construction, adaptive and neural importance sampling, and event unweighting. It includes a wide range of mappings, from the standard MadGraph multi-channel phase space to optimized normalizing flows with analytic inverse transformations.

06895#pg2> The framework also supports multi-channel integration strategies, distinguishing between global and local multi-channeling approaches <ref:2602. p. 2
Where the paper says it

1 Global vs. local multi-channeling In the standard multi-channel approach [74,75], we start by introducing several channel mappings Gi : Ui = [0, 1] d → Φ denoted as r → x = Gi (r), to obtain individual densities gi (x) = ∂ G −1 i (x) ∂ x with Z Φ dx gi (x) = 1 for i = 1, .

06895#pg4>

Framework Architecture and Interface

The technical implementation follows a compute-graph execution model inspired by deep learning frameworks like TensorFlow or PyTorch <ref:2602.06895#pg2> This approach enforces a strict separation between physics-specific logic and the hardware-dependent numerical implementation <ref:2602.06895#pg2> The framework includes the UMAMI interface to provide a unified matrix element interface for calling matrix elements from CUDACPP plugin without requiring process-specific code generation at integration time <ref:2602. p. 0

Where the paper says it

2 Features 20 3. 3 UMAMI – A unified matrix element interface 23 3.

06895#pg2> The Python interface uses the DLPack protocol to enable seamless integration with machine learning libraries such as PyTorch <ref:2602. p. 0
Where the paper says it

All components operate on batches of events and support end-to-end on-device workflows. A high-level Python interface enables seamless integration with machinelearning libraries such as PyTorch.

06895#pg2>

Performance and Validation

Validation involves checking the mathematical consistency of phase-space construction by computing exact checks of phase-space volumes and inverse mappings <ref:2602.06895#pg4> Performance studies show that MadSpace achieves substantial speedups in regimes where traditional generators are dominated by phase-space overhead, reaching up to 10M weighted events per second on the GPU <ref:2602.06895#pg2> The framework demonstrates agreement with baseline distributions from MG5aMC for both weighted and unweighted event generation within statistical uncertainty <ref:2602. p. 0

Where the paper says it

2 Generated phase-space distributions 28 4. 3 Event-generation throughput 30 5 Conclusion and outlook 33 References 35 1 arXiv:2602.

06895#pg4> The binary intermediate format, based on the npy format, leads to significantly faster load times and facilitates direct access to generated parton-level events with Python <ref:2602.06895#pg4>

Future Directions

Future extensions include a systematic study of neural importance sampling in MadSpace, including training strategies and scaling to higher-multiplicity final states <ref:2602.06895#pg2> A second major direction is differentiability, enabling gradient computation of weighted observables with respect to theory parameters like masses and couplings <ref:2602.06895#pg4> The modular structure allows for adding support for more phase-space mappings or extensions beyond LO computations, such as FKS-related sector decompositions <ref:2602. p. 1

Where the paper says it

Its initial deployment will target LO computations, with NLO functionality scheduled for later releases. Beyond these applications, MadSpace is designed to support ML-driven acceleration strategies and differentiable simulation frameworks.

06895#pg4> The UMAMI interface is designed with future NLO ingredients in mind to accommodate additional inputs and outputs without requiring process-specific code generation at integration time <ref:2602.06895#pg4>

Conclusion

MadSpace establishes a core framework for parton-level phase-space integration and event generation that is scalable, hardware portable, and extensible towards modern sampling and inference techniques <ref:2602.06895#pg2> It provides a unified execution model that can accommodate traditional Monte Carlo integration, adaptive importance sampling, and fully ML-driven approaches within the same infrastructure <ref:2602. p. 0

Where the paper says it

SciPost Physics Codebases Submission MadSpace – Event Generation for the Era of GPUs and ML Theo Heimel1 , Olivier Mattelaer1 , and Ramon Winterhalder2 1 CP3, Université catholique de Louvain, Louvain-la-Neuve, Belgium 2 TIFLab, Università degli Studi di Milano & INFN Sezione di Milano, Italy July 23, 2026 Abstract MadSpace is a new modular phase-space and event-generation library written in C++ with native GPU support via CUDA and HIP. It provides a unified compute-graph-based framework for phase-space construction, adaptive and neural importance sampling, and event unweighting.

06895#pg2> The paper demonstrates that MadSpace achieves substantial speedups in regimes where traditional generators are dominated by phase-space overhead on both CPU and GPU architectures <ref:2602. p. 1
Where the paper says it

Similarly, developments within the MadGraph4GPU effort have demonstrated significant speedups for matrix-element calculations on GPUs [59–62] and event reweighting [63], but have so far solely relied on CPU-based sampling and integration methods. A fully featured and modular GPU-based phase-space generator — supporting standard techniques such as multi-channel integration and Rambo-style mappings [64–66] — is missing in the MadGraph ecosystem.

06895#pg4> The design enables end-to-end on-device workflows where random-number generation, mappings, PDF evaluation, cuts, weighted histograms and matrix-element kernels operate without unnecessary host–device transfers <ref:2602. p. 0
Where the paper says it

All components operate on batches of events and support end-to-end on-device workflows. A high-level Python interface enables seamless integration with machinelearning libraries such as PyTorch.

06895#pg2> The framework is intended to be a building block for the emerging ecosystem of hardware-accelerated and ML-enhanced simulation tools <ref:2602.

Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.

Improvements for AI systems

  1. Compute graph-based execution allows for a strict separation between physics logic and numerical execution, enabling parallel execution on CPUs and GPUs without modifying global program states. This functional design naturally enables parallel execution and simplifies reasoning about correctness and reproducibility.

  2. The UMAMI interface provides a flexible way of calling matrix-element code that can be used both for phase-space integration and for event generation within MadSpace, supporting end-to-end GPU-resident event generation workflows without explicit host–device data transfers.

  3. Support for differentiable event generation allows gradients of weighted observables or likelihood surrogates with respect to theory parameters (masses, couplings, PDF parameters, scale choices) to be computed efficiently, enabling gradient-based parameter estimation and profiling directly at the level of the generator.

  4. The FastRambo mapping replaces the numerically expensive polynomial inversion step in RamboOnDiet with a fully analytical rational quadratic transformation while retaining strict invertibility. This trades exact flatness for increased numerical stability and high throughput on vectorized hardware, which is essential for modern workflows where perfect flatness is rarely the limiting factor.

Abstract

MadSpace is a new modular phase-space and event-generation library written in C++ with native GPU support via CUDA and HIP. It provides a unified compute-graph-based framework for phase-space construction, adaptive and neural importance sampling, and event unweighting. It includes a wide range of mappings, from the standard MadGraph multi-channel phase space to optimized normalizing flows with analytic inverse transformations. All components operate on batches of events and support end-to-end on-device workflows. A high-level Python interface enables seamless integration with machine-learning libraries such as PyTorch.

Sources

Related papers