Skip to main content

CuBIE

CUDA batch integration engine for python

docs CUDA tests Python Tests codecov PyPI - Version test build

A batch integration system for numerically integarating many systems of ODEs in parallel, for when elegant solutions fail and you would like to simulate 1,000,000 systems, fast. Cubie is a tool that performs the equivalent of MATLABs ODE functions (ode45 and the like), Scipy's solve_ivp function, or some of the functions in Julia's SciML/OrdinaryDiffEq. This package was designed to simulate a large electrophysiological model as part of a likelihood-free inference method (eventually, package [cubism]), but the machinery is domain-agnostic.

This library uses Numba to JIT-compile CUDA kernels, allowing you the speed of compiled CUDA code without the headache of writing CUDA code. It is designed to have a reasonably MATLAB- or SciPy-like interface, so that you can get up and running without having to figure out the intricacies of the internal mechanics.

The batch solving interface is not yet completely stable, and some parameters/arguments are likely to change further through to v1.0. The core (per-parameter-set) machinery is reasonably stable. As of v0.0.7, you can:

  • Set up and solve large parameter/initial condition sweeps of a system defined by a set of ODEs, entered either as:
    • A string or list of strings containing the equations of the system
    • A CellML model (tested on a subset of models in the CellML library so far)
  • Use any of a large set of explicit or implicit runge-kutta or rosenbrock methods to integrate the problem.
  • Extract the solution for any variable or observable at any time point, or extract summary statistics only to speed things up.
  • Provide forcing terms by including a function of t in your equations, or by providing an array of values for the system to interpolate.
  • Select from a handful of step-size control algorithms when using an adaptive-step algorithm like RK45 or RadauIIA5.

Roadmap:

  • v0.1.0:
    • Documentation to match the API, organised in the sane way that a robot does not.
    • User guide brought up-to-date with API, tracing an example through a few integration scenarios.
    • Accept a python function as a system definition, to match Scipy and MATLAB interfaces.

Documentation:

https://ccam80.github.io/cubie/

Installation:

We recommend that you use a python virtual environment to install Cubie - some dependencies are pinned to a specific version, so installing it in it's own environment will avoid downgrading your system-wide packages and interfering with other projects.

python -m venv cubie_env
./cubie_env/Scripts/activate # Windows
# source cubie_env/bin/activate # Linux/Mac
pip install cubie[cuda12]  # CUDA 12 toolkit
# pip install cubie[cuda13]  # CUDA 13 toolkit

Then, when you fire up your Cubie project, run

source cubie_env/bin/activate

Or set up your IDE to use the python.exe in cubie_env/Scripts/activate (Windows) or cubie_env/bin/activate (Linux/Mac) as the project's interpreter so you don't have to worry about it.

System Requirements:

  • Python 3.10 or later
  • Up-to-date NVIDIA driver
  • NVIDIA GPU with compute capability 6.0 or higher (i.e. GTX10-series or newer)

Python Requirements

  • Python >= 3.10
  • NumPy>=2.0
  • Numba
  • Numba-CUDA
  • attrs
  • SymPy >= 1.13.0

Optional Dependencies

Install these using pip install cubie[optional]

  • Pandas: For DataFrame output support
  • Matplotlib: For plotting support. Only used to plot an interpolated driver function for sanity-checks (see :doc:Drivers <user_guide/drivers>), but generally useful for visualizing results.

Contributing:

Pull requests are very, very welcome! Please open an issue if you would like to discuss a feature or bug before doing a bunch of work on it, as I may have already partially implemented it or at least figured out where it might fit.

Project Goals:

  • Make an engine and interface for batch integration that is close enough to MATLAB or SciPy that a Python beginner can get integrating with the documentation alone in an hour or two. This also means staying Windows-compatible.
  • Perform integrations of 10 or more parallel systems faster than MATLAB or SciPy can
  • Enable extraction of summary variables only (rather than saving time-domain outputs) to facilitate use in algorithms like likelihood-free inference.
  • Be extensible enough that users can add their own systems and algorithms without needing to go near the core machinery.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cubie-0.1.1.tar.gz (477.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cubie-0.1.1-py3-none-any.whl (538.7 kB view details)

Uploaded Python 3

File details

Details for the file cubie-0.1.1.tar.gz.

File metadata

  • Download URL: cubie-0.1.1.tar.gz
  • Upload date:
  • Size: 477.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cubie-0.1.1.tar.gz
Algorithm Hash digest
SHA256 06c2309358b3c3a236d144e519991a8defd89a1add84dc3eaf34f863e3fd9db4
MD5 4ea23bed8afc2d8fc2d375c6cc773853
BLAKE2b-256 bb8fc5ff232902eabd1d1529b852f6c6977b192f436757f4ca75678b1e59620d

See more details on using hashes here.

Provenance

The following attestation bundles were made for cubie-0.1.1.tar.gz:

Publisher: pypi.yml on ccam80/cubie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cubie-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cubie-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 538.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cubie-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 65e0f62b42008dd0cf26b377a62f26914162f86a115ece3f4e2d2c80a00979fa
MD5 cc87656a9521c8b54c1ab68d70d19079
BLAKE2b-256 8a913d4a284aa6e333111418f32b3991249a3cc4b35bc28263abe3a34f667dcc

See more details on using hashes here.

Provenance

The following attestation bundles were made for cubie-0.1.1-py3-none-any.whl:

Publisher: pypi.yml on ccam80/cubie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.13.0

2 files

0.12.0

2 files

0.11.1

2 files

0.11.0

2 files

0.10.1

2 files

0.10.0

2 files

0.9.0

2 files

0.8.1

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page