Skip to main content

DustPy-GPU

dustpy-gpu is a GPU-enabled fork of DustPy, a Python package for simulating gas and dust evolution in protoplanetary disks.

Designed as a drop-in replacement, it retains the upstream dustpy import name and original API, so migrating existing scripts requires minimal changes (mainly backend selection, see below).

Installation

To avoid package conflicts, please install this drop-in replacement in a fresh virtual environment:

python -m venv .venv && source .venv/bin/activate
python -m pip install --upgrade pip

# For GPU runs: Install CuPy matching your CUDA version (e.g., CUDA 13)
python -m pip install cupy-cuda13x

# Install dustpy-gpu (automatically installs the required simframe-gpu fork)
python -m pip install git+https://github.com/astroboylrx/dustpy-gpu.git

Backends

Select your backend when initializing a simulation:

import dustpy

sim_cpu = dustpy.Simulation(backend="numpy") # Default (preserves upstream behavior)
sim_gpu = dustpy.Simulation(backend="cupy")
sim_auto = dustpy.Simulation(backend="auto") # Uses CuPy if available, else NumPy

When using the cupy backend, remember to convert CuPy arrays back to NumPy with cupy.asnumpy() for plotting or analysis. For those new to CuPy, we recommend checking out the Basics of CuPy.

Multiple backends can be used together in a single script if run sequentially, but concurrent execution is not supported due to process-global bindings.

Documentation

Most official tutorials from the upstream DustPy documentation have been adapted for the GPU backend. These examples, alongside the validation benchmarks, are available in gpu_examples.

Parity and benchmarks

Users should expect numerical and scientific parity, though not strictly identical arrays across long or repeated GPU runs.

  • NumPy Backend: Reproduces upstream DustPy results bitwise.
  • CuPy Backend: Agrees with NumPy to strict FP64 tolerances initially. Long-run differences remain quite small and non-accumulating. Official examples (ice lines, planetary gaps, planetesimal formation, etc.) are visually indistinguishable.
  • GPU Determinism: CuPy runs are not bitwise deterministic. The use of an iterative solver (sparse GMRES) — necessitated because CuPy's direct sparse solver API currently falls back to the CPU — combined with parallel GPU accumulation, can produce tiny run-to-run differences.

For detailed comparisons and performance results, see the parity and benchmark notebook.

Download files

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

Source Distribution

dustpy_gpu-1.0.9.1.tar.gz (22.2 MB view details)

Uploaded Source

File details

Details for the file dustpy_gpu-1.0.9.1.tar.gz.

File metadata

  • Download URL: dustpy_gpu-1.0.9.1.tar.gz
  • Upload date:
  • Size: 22.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for dustpy_gpu-1.0.9.1.tar.gz
Algorithm Hash digest
SHA256 99f8a3c27f010c10f33963ba648c0d300ee8a7b55e40ab6545b21fffcd9e2f92
MD5 cfd3014e2d7329d702ff994015692951
BLAKE2b-256 2d160a5d9528228bce9a3bbc437517aa32c114eddfe072020c5f035086faa8d7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page