Installation#

pip install prophys

That is all. prophys installs as a ready-to-run package for Linux, macOS and Windows on x86_64 and arm64, with its optimized native kernels included. There is nothing to compile and no additional tooling to set up.

With optional extras:

pip install "prophys[viz]"          # matplotlib plotting helpers (prophys.plot)
pip install "prophys[geo]"          # shapely/pyproj GeoJSON import
pip install "prophys[inference]"    # NumPyro bridge for NUTS/SVI
pip install "prophys[surrogates]"   # XGBoost, LightGBM and PyTorch importers of pretrained models

Requirements: Python 3.11 or newer. JAX and Optax are installed automatically as dependencies.

Licensing and the free tier#

Small models run immediately, with no license file. A model that declares at most 250 structural objects in total (points, polygon vertices, segments, raster cells, …) computes freely, which covers the documentation’s own examples, teaching use and prototyping. Larger models require a license:

export PROPHYS_LICENSE=/path/to/prophys.lic

See License for exactly what counts towards the 250-object limit (structural model size) and what does not (Monte-Carlo sample counts, observation counts, training iterations).

Verifying the installation#

import prophys as prp
import jax.numpy as jnp

site = prp.Frame("site")
a = prp.PointList(jnp.array([[0.0, 0.0]]), site)
b = prp.PointList(jnp.array([[3.0, 4.0]]), site)
print(a.closest_distance(b).evaluate())  # -> [5.]

print(prp.license_status())  # (False, '', 'no license configured ...') on the free tier

GPU#

The GPU build of prophys runs its native kernels on NVIDIA GPUs as well, so a model whose arrays live on a GPU runs there without code changes. The standard package from PyPI contains the CPU kernels only. With it, arrays on a GPU fail with a clear platform error instead of silently falling back to the CPU. The GPU build is currently available from RhineQC on request.

The GPU kernels are designed to give the same results as the CPU kernels. On the tested hardware listed below, the parity test suite found forward results identical to the CPU bit for bit, so a model calibrated on a laptop reproduces on a GPU server.

Requirements

  • Linux on x86_64.

  • An NVIDIA driver that supports CUDA 12.9 or newer.

  • JAX with its CUDA 12 plugin, for example pip install "jax[cuda12]".

Compatible GPUs

The GPU build contains compiled code for these NVIDIA GPU generations, which start without any compilation step:

Compute capability

Example GPUs

8.0

A100, A30

8.6

A40, A10, GeForce RTX 30 series

8.9

L40S, L4, GeForce RTX 40 series

9.0

H100, H200

Newer generations (compute capability 10.0 and above) are expected to run through the portable code that the build also contains. The NVIDIA driver then compiles it on first use, which can take up to about half an hour, and caches the result for later runs. This path has not been tested yet.

GPUs with compute capability below 8.0 (for example V100 or T4) and GPUs from other vendors (AMD, Intel, Apple) are not supported.

Tested hardware

NVIDIA A40 (compute capability 8.6). Other listed GPUs are built for but not yet tested. This list describes the current build and may change between releases.

NVIDIA, CUDA, GeForce and the NVIDIA product names above are trademarks or registered trademarks of NVIDIA Corporation. AMD, Intel and Apple are trademarks of their respective owners. They are named only to describe compatibility, which does not imply endorsement by or affiliation with any of these companies.

Surrogate runtime#

Exported surrogates can be evaluated without Python through the prophys runtime library, a small shared library with a C interface. See Runtime Library.