arXiv:2610.38475cs.MSOct 2026

Manuscript Offprint

arXiv:2610.38475

survivalGPU: Scalable Survival Analysis for R and Python

Antoine Poirot-Bourdain, Alexis Van Straaten, Emmanuel Bacry, Anne-Sophie Jannot, Jean Feydy

Antoine Poirot-Bourdain

CNRS, INRIA, INSERM Université Paris-Dauphine PSL Université Paris Cité

Alexis Van Straaten

AP-HP, INRIA, INSERM Université Paris Cité

Emmanuel Bacry

CNRS Université Paris-Dauphine PSL

Anne-Sophie Jannot

AP-HP, INRIA, INSERM Université Paris Cité

Jean Feydy

INRIA, INSERM Université Paris Cité

Abstract

This paper introduces survivalGPU, a high-performance Python and R package designed to accelerate survival analysis computations using graphics processing units (GPUs). While the Cox proportional hazards model remains a cornerstone of survival analysis, it can impose substantial computational burdens when applied to large longitudinal data sets. To address this limitation, survivalGPU implements Cox proportional hazards models and weighted cumulative exposure (WCE) models in Python, using PyTorch and KeOps for efficient back-end computation, with interfaces in both Python and R. Numerical validation shows that survivalGPU reproduces the results of reference implementations within the tolerances expected for the selected floating-point precision, with relative errors below 10−210^{-2} in float32 and below 10−510^{-5} in float64. Benchmark experiments demonstrate substantial speedups. For Cox models, coxphGPU() was 5.6×5.6\times faster than coxph() from the survival package on 1,000,000 patients, and 14.0×14.0\times faster based on runtimes extrapolated to 1,000 bootstrap replicates on 100,000 patients. Gains were larger for WCE models: wceGPU() was 920.7×920.7\times faster than WCE() from the WCE package on 100,000 patients, and 1,321.4×1,321.4\times faster based on runtimes extrapolated to 1,000 bootstrap replicates. These results show that survivalGPU makes flexible time-dependent survival modeling and bootstrap-based estimation of confidence intervals feasible for large-scale pharmacoepidemiological applications.

Keywords: R, Python, survival analysis, WCE, Cox model, GPU computing, bootstraps.

1. Introduction

Scalable survival analysis. Survival analysis is used to analyze time-to-event data. The Cox proportional hazards model (Cox 1972) is one of the most widely used models for survival analysis and can be extended to handle time-dependent covariates. The weighted cumulative exposure (WCE) model (Sylvestre and Abrahamowicz 2009) extends this framework to time-dependent exposures by summarizing past exposures through a time-lagged weight function that captures the cumulative impact of historical exposure. This approach is particularly useful in longitudinal pharmacoepidemiological research (Pazzagli, Linder, Zhang, Vago, Stang, Myers, Andersen, and Bahmanyar 2018; Sapir-Pichhadze, Laprise, Beauchamp, Kaouache, Zhang, Della Vecchia, Azoulay, Franco, Abrahamowicz, and Nicolau 2024; Dayan, Beauchamp, Kountourides, Pilote, and Abrahamowicz 2026).

Despite their widespread utility, traditional implementations of the Cox model and its extensions face substantial barriers when applied to modern, large-scale databases. These computational bottlenecks arise from two primary sources:

  • Algorithmic complexity. Methods incorporating time-dependent covariates typically rely on a counting-process representation, in which each individual contributes one or more rows corresponding to intervals where covariate values remain unchanged. If nn denotes the total number of such rows, repeated risk-set evaluations may scale as O(n2)\mathcal{O}(n^2) in standard implementations (Yang, Schuemie, Ji, and Suchard 2024). Consequently, cohorts with hundreds of thousands of individuals can yield even larger numbers of follow-up intervals, making serial CPU implementations prohibitively time-consuming.

  • Iterative computational demands. To address high-dimensional covariate spaces, tune model specifications, and quantify uncertainty, practitioners increasingly rely on regularization, cross-validation, and resampling-based procedures such as bootstrapping (Efron 1979). Interpretation techniques such as Shapley values (Sundararajan and Najmi 2020) can also require many repeated model evaluations. These procedures multiply the computational burden by several orders of magnitude.

Existing packages. Survival analysis software in R and Python has traditionally relied on CPU-based execution. In R, the survival package (Therneau 2024) serves as the de facto standard, providing the foundation for domain-specific extensions such as the WCE package (Sylvestre, Beauchamp, Kyle, and Abrahamowicz 2024), which implements the weighted cumulative exposure model. The Python ecosystem offers robust alternatives, including scikit-survival (Pölsterl 2020), lifelines (Davidson-Pilon 2019), statsmodels (Seabold and Perktold 2010), and tick (Bacry, Bompaire, Gaïffas, and Poulsen 2018). While some of these libraries are highly optimized, they are primarily CPU-oriented and do not directly target GPU-accelerated fitting of Cox and WCE models.

Recent efforts to leverage massively parallel graphics processing units (GPUs) for survival analysis have followed two distinct architectural trajectories:

  • Low-level CUDA/C++ implementations. Optimized implementations such as CUDA_Cox (Andalibi, Christophe, Laukkarinen, and Mikkonen 2016), xgboost (Barnwal, Cho, and Hocking 2022), and Cyclops (Yang et al. 2024) use compiled backends or specialized optimization routines to improve scalability. While these tools can achieve

high performance, their rigid architecture may make it difficult for researchers to modify the underlying objective functions or incorporate custom penalties.

  • Deep learning frameworks. Libraries such as pycox (Kvamme 2024) and TorchSurv (Monod, Krusche, Cao, Sahiner, Petrick, Ohlssen, and Coroller 2024) use the high-level PyTorch framework (Paszke, Gross, Chintala, Chanan, Yang, DeVito, Lin, Desmaison, Antiga, and Lerer 2017). They trade some degree of low-level optimization for the flexibility of automatic differentiation and seamless integration into modern machine learning pipelines.

In this context, there remains a need for a solution that bridges these two worlds: a package that provides the computational efficiency of an optimized GPU backend while maintaining the familiar syntax and statistical rigor of reference packages such as R's survival.

Contributions. To address this challenge, we introduce survivalGPU, a high-performance package for large-scale survival analysis with the following key features:

  • Model support. We implement Cox and WCE models with native support for bootstrap estimation.

  • Accessible interfaces. We provide user-friendly interfaces for both R and Python.

  • Modular and efficient GPU backend. We use PyTorch for automatic differentiation and tensor-based optimization, and KeOps (Charlier, Feydy, Glaunès, Collin, and Durif 2021) for memory-efficient estimation of the WCE-derived time-dependent covariates. This architecture provides substantial computational gains while remaining extensible through pure Python.

  • Reliability. We show numerical agreement with reference implementations within precision-specific relative tolerances in both float32 and float64.

  • Performance. Benchmark experiments demonstrate substantial speedups. For Cox models, at n=1,000,000n = 1,000,000, coxphGPU() required 2.75 seconds on the GPU, compared with 15.35 seconds for coxph() from the survival package, corresponding to a 5.6×5.6\times speedup. With B=1,000B = 1,000 bootstrap replicates on n=100,000n = 100,000 patients, coxphGPU() required 71.64 seconds (1.19 minutes), compared with 1,004.62 seconds (16.74 minutes) for the extrapolated survival runtime, corresponding to a 14.0×14.0\times speedup. Gains were larger for WCE models: at n=100,000n = 100,000, wceGPU() required 9.83 seconds, compared with 9,050.72 seconds (2.51 hours) for WCE() from the WCE package, corresponding to a 920.7×920.7\times speedup. With B=1,000B = 1,000 bootstrap replicates, wceGPU() required 5,021.78 seconds (1.39 hours), compared with an extrapolated runtime of 6,635,933.69 seconds (76.80 days) for WCE(), corresponding to a 1,321.4×1,321.4\times speedup.

Our work is motivated by the emergence of nation-scale medico-administrative databases, such as the Système National des Données de Santé (SNDS) in France, which have transformed clinical research by enabling longitudinal studies on millions of patients (Maillard, Bun, Laanani, Verga-Gérard, Leroy, Gault, Estellat, Noize, Kaguelidou, Sommet, Lapeyre-Mestre, Fourrier-Réglat, Weill, Quantin, and Tubach 2024; Cairat, Severi, Huybrechts, and Fournier 2025; Wyplosz, Fernandes, Sultan, Roche, Roubille, Loubet, Fougère, Moulin, Duhot, Vainchtock,

Raguideau, Lortet-Tieulent, Blanc, Moïsi, and Goussiaume 2022; Soeiro, Uras, Jouanjus, Lapeyre-Mestre, and Micallef 2025).

The remainder of the paper is organized as follows. Section 2 introduces the survival analysis framework, with a focus on the Cox proportional hazards model and its WCE extension. Section 3 describes the implementation of survivalGPU, including the use of torch and KeOps for accelerated computation. Section 4 presents the Python and R interfaces. Section 5 reports the implementation validation in both float32 and float64, and Section 6 presents the benchmark study against existing reference implementations using float32. Section 7 provides an empirical illustration of the package. Finally, Section 8 concludes with a discussion of current limitations and future developments.

References (41)