phenjax: the IMRPhenomT waveform family in JAX for accelerated analyses on CPUs and GPUs

Author(s)

Begnoni, Andrea

Abstract

We present phenjax, a JAX implementation of the precessing time-domain IMRPhenomT family of models for the gravitational wave signal emitted in compact binary coalescence. The code keeps the structure of its reference Python implementation, phenomxpy, and reproduces, on average, its polarizations to a few $\times 10^{-12}$ of the peak strain for all the models, aligned-spin and precessing. The waveform models now take advantage of the JAX construction: compiled once per array shape, vectorized over events (batching), differentiable and executed on CPUs or GPUs with the same source code. Different additional features address the cost of long signals and of heterogeneous populations in a batch. On one NVIDIA H100, for the precessing TPHM model on LISA-mass populations, phenjax is 3 to 6 times faster than phenomxpy when both codes evaluate one event at a time and 20 to 30 times faster when phenjax evaluates the events in batches of 8. We estimate that, for waveform generation, one GPU does the work of 1300 to 2700 cores of a current CPU node at 25 to 45 times less energy per waveform. As a backend of a global-fit LISA massive black hole pipeline, performed on the Sangria dataset, phenjax recovers the same posteriors as the other waveform backends at a lower computational cost. In a comparison with phentax, the wall time was 13 minutes instead of 21.

Figures

Bucketing on five events with various natural lengths (blue). One fixed window (left) extends every event to 8192 samples; power-of-two buckets (right) evaluate the first three events in a $(3, 4096)$ batch and the other two in a $(2, 8192)$ batch. The grey extension is evaluated as a ringdown.
Caption Bucketing on five events with various natural lengths (blue). One fixed window (left) extends every event to 8192 samples; power-of-two buckets (right) evaluate the first three events in a $(3, 4096)$ batch and the other two in a $(2, 8192)$ batch. The grey extension is evaluated as a ringdown.
Structure of one waveform evaluation. The serial part is a chain of scalar operations per event, from the source parameters to the boundaries of the inspiral, intermediate and ringdown regions, and does not depend on the number of samples $N$. The final loop evaluates every sample; under \texttt{vmap}, the formulas of the three regions are evaluated on every sample and only then selected.
Caption Structure of one waveform evaluation. The serial part is a chain of scalar operations per event, from the source parameters to the boundaries of the inspiral, intermediate and ringdown regions, and does not depend on the number of samples $N$. The final loop evaluates every sample; under \texttt{vmap}, the formulas of the three regions are evaluated on every sample and only then selected.
Time of a pass of 64 TPHM-NNLO events at $10^6\,\Msun$ on the H100 against the number of launches of the compiled program, from batch 64 (one launch) to batch 4 (sixteen launches), with the two-term fit of Eq.~\eqref{eq:twoterm}.
Caption Time of a pass of 64 TPHM-NNLO events at $10^6\,\Msun$ on the H100 against the number of launches of the compiled program, from batch 64 (one launch) to batch 4 (sixteen launches), with the two-term fit of Eq.~\eqref{eq:twoterm}.
Time per event against the batch size on a GPU for THM (left) and TPHM NNLO (right), for a short (top) and a long (bottom) LISA population, with the baseline of the model code, the tier~1 region split and its tier~2 mixed-precision form. The labels give the speed-up over the baseline at the largest batch.
Caption Time per event against the batch size on a GPU for THM (left) and TPHM NNLO (right), for a short (top) and a long (bottom) LISA population, with the baseline of the model code, the tier~1 region split and its tier~2 mixed-precision form. The labels give the speed-up over the baseline at the largest batch.
Per-sample cost of THM and TPHM NNLO for the long LISA population ($10^5\,\Msun$, 8 events of 4.04M samples) on five GPU models: the baseline, the tier~1 region split and its tier~2 mixed-precision form, with the speed-up over the baseline of the same GPU.
Caption Per-sample cost of THM and TPHM NNLO for the long LISA population ($10^5\,\Msun$, 8 events of 4.04M samples) on five GPU models: the baseline, the tier~1 region split and its tier~2 mixed-precision form, with the speed-up over the baseline of the same GPU.
Throughput of the 144 cores and of the H200 GPUs for the short (left) and long (right) LISA population, with the baseline (hatched) and the best variant (full) and the sum of two GPUs and 142 cores measured side by side. The axis labels give the number of cores one H200 is worth with the best code on each device. The last bar of each group is the throughput of the whole node, measured with the 142 cores and the two GPUs running at the same time.
Caption Throughput of the 144 cores and of the H200 GPUs for the short (left) and long (right) LISA population, with the baseline (hatched) and the best variant (full) and the sum of two GPUs and 142 cores measured side by side. The axis labels give the number of cores one H200 is worth with the best code on each device. The last bar of each group is the throughput of the whole node, measured with the 142 cores and the two GPUs running at the same time.
Events per second on the CPU node (top) and on the GPU (bottom) for the LISA populations of $10^5$ and $10^7\,\Msun$: 64 events on one fixed window, warm timings; $N$ is the number of samples per waveform of the window. \phenjax{} runs in batches of 8 events with the baseline and with the tier~1 variant, \phenomxpy{} runs one event at a time, \phentax{}, which provides T and THM only, runs in the same batches of 8. The label above each tier~1 bar is its speed-up over \phenomxpy{} on the same device.
Caption Events per second on the CPU node (top) and on the GPU (bottom) for the LISA populations of $10^5$ and $10^7\,\Msun$: 64 events on one fixed window, warm timings; $N$ is the number of samples per waveform of the window. \phenjax{} runs in batches of 8 events with the baseline and with the tier~1 variant, \phenomxpy{} runs one event at a time, \phentax{}, which provides T and THM only, runs in the same batches of 8. The label above each tier~1 bar is its speed-up over \phenomxpy{} on the same device.
Posteriors of the intrinsic parameters of the Sangria MBHB~4 (distance rescaled) injected in the Sangria data without its MBHBs, from GeeMoo runs with the \phenjax{} THM, \phenjax{} TPHM (aligned spins), \phenjax{} TPHM tier~2 and \phentax{} THM backends, same data, priors and seed. The contours enclose 39 and 86\% of the probability and the lines mark the injected values.
Caption Posteriors of the intrinsic parameters of the Sangria MBHB~4 (distance rescaled) injected in the Sangria data without its MBHBs, from GeeMoo runs with the \phenjax{} THM, \phenjax{} TPHM (aligned spins), \phenjax{} TPHM tier~2 and \phentax{} THM backends, same data, priors and seed. The contours enclose 39 and 86\% of the probability and the lines mark the injected values.
References
  • [1] LIGO Scientific Collaboration, Virgo Collaboration, and KAGRA Collaboration, LVK Algorithm Library - LALSuite, Free software (GPL) (2018).
  • [2] M. Maggiore et al., Science case for the Einstein Telescope, JCAP 03, 050, arXiv:1912.02622 [astro-ph.CO].
  • [3] M. Branchesi et al., Science with the Einstein Telescope: a comparison of different designs, JCAP 07, 068, arXiv:2303.15923 [gr-qc].
  • [4] M. Colpi et al. (LISA), LISA definition study report (2024), arXiv:2402.07571 [astro-ph.CO].
  • [5] K. W. K. Wong, M. Isi, and T. D. P. Edwards, Fast gravitational-wave parameter estimation without compromises, Astrophys. J. 958, 129 (2023), arXiv:2302.05333 [astro-ph.IM].
  • [6] K. W. K. Wong, M. Gabrié, and D. Foreman-Mackey, flowMC: Normalizing flow enhanced sampling package for probabilistic inference in JAX, J. Open Source Softw. 8, 5021 (2023), arXiv:2211.06397 [astro-ph.IM].
  • [7] N. Karnesis, M. L. Katz, N. Korsakova, J. R. Gair, and N. Stergioulas, Eryn: a multipurpose sampler for Bayesian inference, Mon. Not. Roy. Astron. Soc. 526, 4814 (2023), arXiv:2303.02164 [astro-ph.IM].
  • [8] M. L. Katz, S. Marsat, A. J. K. Chua, S. Babak, and S. L. Larson, GPU-accelerated massive black hole binary parameter estimation with LISA, Phys. Rev. D 102, 023033 (2020), arXiv:2005.01827 [gr-qc].
  • [9] M. L. Katz, N. Karnesis, N. Korsakova, J. R. Gair, and N. Stergioulas, Efficient GPU-accelerated multisource global fit pipeline for LISA data analysis, Phys. Rev. D 111, 024060 (2025), arXiv:2405.04690 [gr-qc].
  • [10] G. Demasi, G. Capurri, M. Lenti, A. Ricciardone, B. Patricelli, A. Frattale Mascioli, L. Piccari, S. Albuquerque, G. M. Guidi, F. Pannarale, G. Stratta, and W. Del Pozzo, The Sequential Monte Carlo goes NUTS: Boosting gravitational-wave inference, Eur. Phys. J. C 86, 686 (2026), arXiv:2601.02336 [gr-qc].
  • [11] J. Bradbury, R. Frostig, P. Hawkins, M. J. Johnson, C. Leary, D. Maclaurin, G. Necula, A. Paszke, J. VanderPlas, S. Wanderman-Milne, and Q. Zhang, JAX: composable transformations of Python+NumPy programs, http://github.com/jax-ml/jax (2018).
  • [12] F. Iacovelli, M. Mancarella, S. Foffa, and M. Maggiore, GWFAST: A fisher information matrix Python code for third-generation gravitational-wave detectors, Astrophys. J. Supp. 263, 2 (2022), arXiv:2207.06910 [gr-qc].
  • [13] F. Iacovelli, M. Mancarella, S. Foffa, and M. Maggiore, Forecasting the detection capabilities of third-generation gravitational-wave detectors using GWFAST, Astrophys. J. 941, 208 (2022), arXiv:2207.02771 [gr-qc].
  • [14] T. D. P. Edwards, K. W. K. Wong, K. K. H. Lam, A. Coogan, D. Foreman-Mackey, M. Isi, and A. Zimmerman, Differentiable and hardware-accelerated waveforms for gravitational wave data analysis, Phys. Rev. D 110, 064028 (2024), arXiv:2302.05329 [astro-ph.IM].
  • [15] A. Santini, D. Bandopadhyay, and J. Gair, Phentax: A JAX implementation of the IMRPhenomTHM waveform model (2026), arXiv:2611.08596 [gr-qc].
  • [16] A. Begnoni, S. Anselmi, M. Pieroni, A. Renzi, and A. Ricciardone, Detectability and parameter estimation for Einstein Telescope configurations with GWJulia, JCAP 05, 079, arXiv:2506.21530 [astro-ph.IM].
  • [17] H. Estellés, A. Ramos-Buades, S. Husa, C. Garcı́aQuirós, M. Colleoni, L. Haegel, and R. Jaume, Phenomenological time domain model for dominant quadrupole gravitational wave signal of coalescing binary black holes, Phys. Rev. D 103, 124060 (2021), arXiv:2004.08302 [gr-qc].
  • [18] H. Estellés, S. Husa, M. Colleoni, D. Keitel, M. MateuLucena, C. Garcı́a-Quirós, A. Ramos-Buades, and A. Borchers, Time-domain phenomenological model of gravitational-wave subdominant harmonics for quasicircular nonprecessing binary black hole coalescences, Phys. Rev. D 105, 084039 (2022), arXiv:2012.11923 [gr-qc].
  • [19] H. Estellés, M. Colleoni, C. Garcı́a-Quirós, S. Husa, D. Keitel, M. Mateu-Lucena, M. d. L. Planas, and A. Ramos-Buades, New twists in compact binary waveform modeling: A fast time-domain model for precession, Phys. Rev. D 105, 084040 (2022), arXiv:2105.05872 [grqc].
  • [20] P. Schmidt, M. Hannam, and S. Husa, Towards models of gravitational waveforms from generic binaries: A simple approximate mapping between precessing and nonprecessing inspiral signals, Phys. Rev. D 86, 104063 (2012), arXiv:1207.3088 [gr-qc].
  • [21] A. Bohé, S. Marsat, G. Faye, and L. Blanchet, Nextto-next-to-leading order spin-orbit effects in the nearzone metric and precession equations of compact binaries, Class. Quant. Grav. 30, 075017 (2013), arXiv:1212.5520 [gr-qc].
  • [22] K. Chatziioannou, A. Klein, N. Yunes, and N. Cornish, Constructing gravitational waves from generic spinprecessing compact binary inspirals, Phys. Rev. D 95, 104004 (2017), arXiv:1703.03967 [gr-qc].
  • [23] C. Garcı́a-Quirós, S. Tiwari, and S. Babak, GPUaccelerated LISA parameter estimation with full timedomain response, Phys. Rev. D 112, 064017 (2025), arXiv:2501.08261 [gr-qc].
  • [24] S. K. Lam, A. Pitrou, and S. Seibert, Numba: a LLVMbased Python JIT compiler, in Proceedings of the Second Workshop on the LLVM Compiler Infrastructure in HPC (2015) pp. 1–6.
  • [25] R. Okuta, Y. Unno, D. Nishino, S. Hido, and C. Loomis, CuPy: A NumPy-compatible library for NVIDIA GPU calculations, in Proceedings of Workshop on Machine Learning Systems (LearningSys) in the Thirty-first Annual Conference on Neural Information Processing Systems (NIPS) (2017).
  • [26] G. Pratten et al., Computationally efficient models for the dominant and subdominant harmonic modes of precessing binary black holes, Phys. Rev. D 103, 104056 (2021), arXiv:2004.06503 [gr-qc].
  • [27] GW-JAX-Team, ripple: differentiable and hardwareaccelerated waveforms in JAX, https://github.com/ GW-JAX-Team/ripple (2025).
  • [28] T. B. Littenberg and N. J. Cornish, Prototype global analysis of LISA data with multiple source types, Phys. Rev. D 107, 063004 (2023), arXiv:2301.03673 [gr-qc].
  • [29] S. H. Strub, L. Ferraioli, C. Schmelzbach, S. C. Stähler, and D. Giardini, Global analysis of LISA data with Galactic binaries and massive black hole binaries, Phys. Rev. D 110, 024005 (2024), arXiv:2403.15318 [gr-qc].
  • [30] S. Deng, S. Babak, M. Le Jeune, S. Marsat, É. Plagnol, and A. Sartirana, Modular global-fit pipeline for LISA data analysis, Phys. Rev. D 111, 103014 (2025), arXiv:2501.10277 [gr-qc].
  • [31] J. Perret, M. Le Jeune, and S. Babak, mbhb fastlike (jaxmbhb): a JAX likelihood for massive black hole binaries in LISA, https://gitlab.in2p3.fr/lisa-apc/ mbhb_fastlike (2026).
  • [32] Q. Baghi (LDC Working Group), The LISA Data Challenges, in 56th Rencontres de Moriond on Gravitation (2022) arXiv:2204.12142 [gr-qc].
  • [33] LISA Distributed Data Processing Center, Mojito: datasets and software package, https: //mojito-e66317.io.esa.int/ (2024).