Table of Contents
Fetching ...

MoreFit: A More Optimised, Rapid and Efficient Fit

Christoph Langenbruch

TL;DR

MoreFit tackles the computational bottlenecks of unbinned maximum likelihood fits in high-energy physics by introducing computation graphs that are compiled just-in-time and executed on heterogeneous backends via OpenCL and LLVM. The framework enables analytic derivatives through symbolic differentiation, automatic buffering of parameter- and event-dependent terms, and automatic optimisation to reduce redundant calculations, significantly speeding up both the fit and generation of pseudoexperiments. Benchmark results against RooFit and zfit demonstrate substantial speedups on CPU and GPU, including orders-of-magnitude improvements in some scenarios, underscoring the value of parallelism and automatic optimisations for large-scale parameter inference. By relying on open standards and a lightweight C++ design, MoreFit aims for broad usability and future expansion to more PDFs, acceptance corrections, and potentially binned fits, enabling more robust and scalable statistical analyses in particle physics.

Abstract

Parameter estimation via unbinned maximum likelihood fits is a central technique in particle physics. This article introduces MoreFit, which aims to provide a more optimised, rapid and efficient fitting solution for unbinned maximum likelihood fits. MoreFit is developed with a focus on parallelism and relies on computation graphs that are compiled just-in-time. Several novel automatic optimisation techniques are employed on the computation graphs that significantly increase performance compared to conventional approaches. MoreFit can make efficient use of a wide range of heterogeneous platforms through its compute backends that rely on open standards. It provides an OpenCL backend for execution on GPUs of all major vendors, and a backend based on LLVM and Clang for single- or multithreaded execution on CPUs, which in addition allows for SIMD vectorisation. MoreFit is benchmarked against several other fitting frameworks and shows very promising performance, illustrating the power of the approach.

MoreFit: A More Optimised, Rapid and Efficient Fit

TL;DR

MoreFit tackles the computational bottlenecks of unbinned maximum likelihood fits in high-energy physics by introducing computation graphs that are compiled just-in-time and executed on heterogeneous backends via OpenCL and LLVM. The framework enables analytic derivatives through symbolic differentiation, automatic buffering of parameter- and event-dependent terms, and automatic optimisation to reduce redundant calculations, significantly speeding up both the fit and generation of pseudoexperiments. Benchmark results against RooFit and zfit demonstrate substantial speedups on CPU and GPU, including orders-of-magnitude improvements in some scenarios, underscoring the value of parallelism and automatic optimisations for large-scale parameter inference. By relying on open standards and a lightweight C++ design, MoreFit aims for broad usability and future expansion to more PDFs, acceptance corrections, and potentially binned fits, enabling more robust and scalable statistical analyses in particle physics.

Abstract

Parameter estimation via unbinned maximum likelihood fits is a central technique in particle physics. This article introduces MoreFit, which aims to provide a more optimised, rapid and efficient fitting solution for unbinned maximum likelihood fits. MoreFit is developed with a focus on parallelism and relies on computation graphs that are compiled just-in-time. Several novel automatic optimisation techniques are employed on the computation graphs that significantly increase performance compared to conventional approaches. MoreFit can make efficient use of a wide range of heterogeneous platforms through its compute backends that rely on open standards. It provides an OpenCL backend for execution on GPUs of all major vendors, and a backend based on LLVM and Clang for single- or multithreaded execution on CPUs, which in addition allows for SIMD vectorisation. MoreFit is benchmarked against several other fitting frameworks and shows very promising performance, illustrating the power of the approach.
Paper Structure (17 sections, 4 equations, 7 figures, 5 tables)

This paper contains 17 sections, 4 equations, 7 figures, 5 tables.

Figures (7)

  • Figure 1: Computation graph for a simple normalised exponential PDF. Note that the graph is slightly simplified for illustration purposes, as MoreFit by default also handles the special case $\alpha=0$.
  • Figure 2: Unoptimised computation graph for the logarithm of the model given by Eq. \ref{['eq:massmodel']}. Terms depending only on parameters (and not on the event) can be calculated once per parameter set on the host and reused. These terms are automatically identified by MoreFit and are highlighted above in light red with different hatching styles. For unbinned maximum likelihood fits they include the normalisation integrals.
  • Figure 3: (a) Computation graph used in the generation for the model corresponding to Eq. \ref{['eq:massmodel']}. All terms depending on parameters are constants in the generation and can thus be evaluated in advance, resulting in a much reduced computation graph size compared to Fig. \ref{['fig:probgraph']} and a smaller and faster kernel. (b) Computation graph for the generation of the decay angles discussed in Sec. \ref{['sec:angularfit']}. In the generation, $F_{\rm L}$ is set to $0.6$ and all other angular observables are set to zero. As a result, only the first four terms in Eq. \ref{['eq:angulardecayrate']} remain and the generation is flat in the angle $\phi$.
  • Figure 4: Distribution for pseudodata corresponding to 100 000 events, overlaid with the fitted PDF.
  • Figure 5: Time in $\mathrm{ms}$ per pseudoexperiment for a simple mass fit for different numbers of events ranging from $10^3$ to $10^6$. Different colours indicate the different fitting frameworks RooFit (red), zfit (green) and MoreFit (blue). The different frameworks are compared in (a) using numerical derivatives. In (b) the performance between MoreFit using numerical (blue) and analytic (purple) gradient and Hessian matrix is compared. Solid lines denote the use of the GPU, dashed (dotted) lines the use of the CPU with 1 thread (16 threads).
  • ...and 2 more figures