survivalGPU
GPU-accelerated survival analysis — Cox Proportional Hazards (CoxPH) and Weighted Cumulative Exposure (WCE) models, built on PyTorch and KeOps. survivalGPU scales classical survival models to large datasets and to heavy bootstrap resampling by running the core computations on the GPU.
Features
- Cox Proportional Hazards models (
CoxPHSurvivalAnalysis,coxph_numpy), with Breslow and Efron handling of ties. - Weighted Cumulative Exposure (WCE) models (
WCESurvivalAnalysis,wce_numpy) for time-varying exposure effects. - GPU acceleration of the likelihood and its gradients via PyTorch + KeOps, with a CPU fallback.
- Bootstrap resampling and dataset simulation utilities for reproducible experiments.
Installation
pip install survivalgpu
Requirements
- Python >= 3.10
- A C++ compiler:
pykeopsjust-in-time compiles C++/CUDA kernels at runtime, so a working C++ toolchain must be present. For GPU acceleration you also need the CUDA toolkit (nvcc) installed, not just a CUDA-capable GPU. The code runs on CPU without a GPU — the GPU is simply where the speedups come from.
Windows
pykeops compiles C++/CUDA kernels at runtime and is not supported natively on Windows. Windows users have three working options:
- WSL2: Install a Linux distribution through the
Windows Subsystem for Linux,
then run
pip install survivalgpuinside it exactly as you would on Linux. - Docker: KeOps publishes a reference container with a full CUDA + PyTorch +
KeOps stack — and it is already configured with survivalGPU on its
PYTHONPATH, so it is ready to run this package. See the KeOps Dockerfile and the KeOps installation guide.
Quick start
survivalGPU exposes both a scikit-learn-style class interface and a NumPy functional interface:
import numpy as np
from survivalgpu import CoxPHSurvivalAnalysis
# Three (start, stop] intervals, one covariate:
stop = np.array([1, 1, 2], dtype=np.int64)
event = np.array([0, 1, 1], dtype=np.int64)
covariates = np.array([[1.0], [0.0], [4.0]])
model = CoxPHSurvivalAnalysis(ties="efron")
model.fit(covariates, stop, event=event)
print(model.coef_)
Full, runnable examples live in the repository, and the test suite doubles as a usage reference until the documentation is complete.
Development
Clone the repository and install in editable mode with the test dependency group
(requires pip >= 25.1):
git clone https://github.com/jeanfeydy/survivalGPU.git
cd survivalGPU
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
python -m pip install --upgrade pip
pip install -e . --group test
Run the test suite with:
pytest
Citation
If you use survivalGPU in your research, please cite it.
@software{survivalgpu,
author = {Jean Feydy, Antoine Poirot-Bourdain, Alexis van Straaten},
title = {{survivalGPU}: GPU-accelerated survival analysis},
url = {https://github.com/jeanfeydy/survivalGPU},
year = {2026},
}
License
Distributed under the terms of the LGPL-2.1-or-later license. See LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file survivalgpu-0.1.0.tar.gz.
File metadata
- Download URL: survivalgpu-0.1.0.tar.gz
- Upload date:
- Size: 73.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de3141bb758a7fe466a2ace63640cf56650d491097646827148bfaf4af3e000e
|
|
| MD5 |
c4c5f690dde8d4ac682d4b90ff8ff543
|
|
| BLAKE2b-256 |
9546f25b201361be9fb6edf7566d235f1ee21c3e41def0dc9fb97d973bce9afe
|
Provenance
The following attestation bundles were made for survivalgpu-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on jeanfeydy/survivalGPU
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
survivalgpu-0.1.0.tar.gz -
Subject digest:
de3141bb758a7fe466a2ace63640cf56650d491097646827148bfaf4af3e000e - Sigstore transparency entry: 2370953503
- Sigstore integration time:
-
Permalink:
jeanfeydy/survivalGPU@30768e0c6b2b78def4c1afeef7df6396f05ed668 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jeanfeydy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@30768e0c6b2b78def4c1afeef7df6396f05ed668 -
Trigger Event:
release
-
Statement type:
File details
Details for the file survivalgpu-0.1.0-py3-none-any.whl.
File metadata
- Download URL: survivalgpu-0.1.0-py3-none-any.whl
- Upload date:
- Size: 74.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b13fabc41d0de01a7e8ed45e1aa28a3998cb15c4682e54cff74850655ab0c8c
|
|
| MD5 |
12562dc61f164c580dfe7a0d2215ae50
|
|
| BLAKE2b-256 |
ebaf17d3f820d401dc9b1a0c6c42990f927fec39710ed084b1af02a5d49a8448
|
Provenance
The following attestation bundles were made for survivalgpu-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on jeanfeydy/survivalGPU
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
survivalgpu-0.1.0-py3-none-any.whl -
Subject digest:
6b13fabc41d0de01a7e8ed45e1aa28a3998cb15c4682e54cff74850655ab0c8c - Sigstore transparency entry: 2370953581
- Sigstore integration time:
-
Permalink:
jeanfeydy/survivalGPU@30768e0c6b2b78def4c1afeef7df6396f05ed668 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jeanfeydy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@30768e0c6b2b78def4c1afeef7df6396f05ed668 -
Trigger Event:
release
-
Statement type: