Skip to main content

GPU-accelerated Bayesian evidence calculation via radial shooting techniques

Project description

SunBURST

PyPI version Python 3.9+ License: MIT CI

Seeded Universe Navigation — Bayesian Unification via Radial Shooting Techniques

A GPU-accelerated Bayesian evidence calculator achieving machine-precision accuracy through 1024 dimensions with sub-linear scaling.

Features

  • Extreme scalability: O(D^0.67) scaling vs O(exp(D)) for traditional methods
  • GPU acceleration: 1000× speedup over dynesty/PolyChord at matched dimensions
  • High dimensions: Works reliably from 2D to 1024D+
  • Pure Python: No compilation required, NumPy/CuPy compatible
  • Automatic mode detection: Handles multimodal posteriors automatically

Installation

pip install sunburst

For GPU acceleration (optional but recommended):

pip install cupy-cuda11x  # For CUDA 11.x
# or
pip install cupy-cuda12x  # For CUDA 12.x

Quick Start

import numpy as np
from sunburst import compute_evidence

# Define your log-likelihood (must handle batched inputs)
def log_likelihood(x):
    x = np.atleast_2d(x)
    return -0.5 * np.sum(x**2, axis=1)  # Gaussian

# Define parameter bounds
dim = 64
bounds = [(-10, 10)] * dim

# Compute evidence
result = compute_evidence(log_likelihood, bounds)

print(f"log Z = {result.log_evidence:.4f} ± {result.log_evidence_std:.4f}")
print(f"Peaks found: {result.n_peaks}")
print(f"Time: {result.wall_time:.2f}s")

Performance Benchmarks

Tested on RTX 3080 Laptop GPU with n_oscillations=1:

Dimension SunBURST dynesty UltraNest Speedup
2D 0.39s 0.61s 0.87s 1.6-2.2×
8D 0.42s 37s 54s 88-129×
64D 0.71s TIMEOUT TIMEOUT >1200×
256D 2.72s
1024D 14.0s

TIMEOUT = >600s (10 minutes)

SunBURST Scaling

SunBURST completes in seconds where traditional methods timeout.

Built-in Test

Verify your installation:

import sunburst
result = sunburst.test(dim=64)  # Runs Gaussian benchmark

Or from command line:

sunburst --test gaussian --dim 64

Configuration Options

result = compute_evidence(
    log_likelihood,
    bounds,
    n_oscillations=1,     # 1=fast, 3=conservative mode detection
    fast=True,            # Fast Hessian estimation
    return_peaks=True,    # Include peak locations in result
    verbose=False,        # Suppress progress output
    seed=42,              # Reproducibility
)

Result Object

result.log_evidence        # float: Estimated log Z
result.log_evidence_std    # float: Uncertainty estimate
result.n_peaks             # int: Number of modes found
result.peaks               # ndarray: (n_peaks, dim) peak locations
result.hessians            # list: Hessian matrices at peaks
result.log_evidence_per_peak  # ndarray: Evidence contribution per peak
result.wall_time           # float: Total computation time
result.module_times        # dict: Per-stage timing breakdown
result.n_likelihood_calls  # int: Total likelihood evaluations
result.config              # dict: Configuration used

GPU Utilities

from sunburst import gpu_available, gpu_info, get_array_module

if gpu_available():
    print(gpu_info())
    xp = get_array_module()  # Returns cupy if available, else numpy

Architecture

SunBURST uses a 4-stage pipeline, named after Guang Ping Yang Style Tai Chi forms:

  1. CarryTiger (抱虎歸山): Mode detection via ray casting
  2. GreenDragon (青龍出水): Peak refinement with L-BFGS
  3. BendTheBow (彎弓射虎): Evidence calculation via Laplace approximation
  4. GraspBirdsTail (攬雀尾): Optional dimensional reduction

Citation

If you use SunBURST in your research, please cite:

@software{sunburst,
  author = {Wolfson, Ira},
  title = {SunBURST: GPU-accelerated Bayesian Evidence Calculation},
  year = {2026},
  url = {https://github.com/beastraban/sunburst}
}

License

MIT License — see LICENSE for details.

Contributing

Contributions welcome! Please see our contributing guidelines.

Acknowledgments

Module names honor Master Donald Rubbo and the Guang Ping Yang Style Tai Chi (廣平楊式太極拳) tradition.

Project details


Download files

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

Source Distribution

sunburst_bayes-1.0.0.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

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

sunburst_bayes-1.0.0-py3-none-any.whl (120.6 kB view details)

Uploaded Python 3

File details

Details for the file sunburst_bayes-1.0.0.tar.gz.

File metadata

  • Download URL: sunburst_bayes-1.0.0.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for sunburst_bayes-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9e7627554ed23cbe1c5a204eb102ccdec61f55e882f286d6be15bc2052f5bcb3
MD5 2778b0e146b0dc7c69bc0f1b3f23e35a
BLAKE2b-256 036219223c0d72641d3eba77bef72817fe1887ffc0b37d8337e114e14899725b

See more details on using hashes here.

File details

Details for the file sunburst_bayes-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: sunburst_bayes-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 120.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for sunburst_bayes-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7053f52793b6564f6b41b851100fa0d2a3a8042ed9e523ac55f557e4c25fc769
MD5 5a1904b6523e5cf0242860d520db68e0
BLAKE2b-256 e38c81fe3933a5c2ec3ca21429f88298f706148e6da60d03babc02c7815d02cd

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