Skip to main content

A high-performance toolbox for PhiID computation, accelerated by GPU.

Project description

ΩID

PyPI version License Ask DeepWiki

ΩID is a Python package for calculating the integrated information decomposition (ΦID) of time series data. It is designed for high-performance computing, with optional GPU acceleration via CuPy.

Features

  • Backend Agnostic: Seamlessly switch between CPU (NumPy) and GPU (CuPy) for computation.
  • High Performance: Vectorized operations and Numba-optimized functions for significant speedups.
  • Numerical Integrity: Results are numerically consistent with the original phyid implementation within single/double precision tolerances.
  • Multivariate Decomposition: Supports decomposition of systems with multiple source and target variables using the Doublet Lattice approximation.

Installation

ΩID is available on PyPI. You can install it with pip or uv pip.

Standard Installation (CPU only)

pip install omegaid

With GPU support

To install ΩID with GPU support, you need to have a CUDA-enabled GPU and the CUDA toolkit installed. Choose the command that matches your CUDA version.

For CUDA 12.x:

pip install "omegaid[cuda-12x]"

For CUDA 11.x:

pip install "omegaid[cuda-11x]"

Usage

Selecting the Backend

You can select the computation backend by setting the OMEGAID_BACKEND environment variable before running your Python script.

  • For NumPy (default):

    export OMEGAID_BACKEND=numpy
    
  • For CuPy:

    export OMEGAID_BACKEND=cupy
    

If the variable is not set, OmegaID will default to using NumPy.

Example

Here is a simple example of how to use omegaid to calculate the Phi-ID decomposition for a multivariate system.

import numpy as np
from omegaid.core.decomposition import calc_phiid_multivariate
from omegaid.utils.backend import set_backend

# For programmatic control, you can also use set_backend
# set_backend('cupy') 

# Generate some random time series data (4 sources, 2 targets)
n_sources = 4
n_targets = 2
n_samples = 10000
tau = 1
sources = np.random.randn(n_sources, n_samples)
targets = np.random.randn(n_targets, n_samples)

# Calculate Phi-ID using the Doublet Lattice approximation
atoms_res, _ = calc_phiid_multivariate(sources, targets, tau)

# Print a synergistic atom, e.g., between source 0 and target 1
print("Synergy (s0, t1):", atoms_res.get((0, 1), "N/A"))

Performance

The package has been benchmarked for various systems. The results below show the performance against the original phyid (where applicable) and between CPU/GPU backends.

Test Case Implementation Time (s) Speedup
2x2 CCS (100k) omegaid_2x2_cpu 0.1390 1.18x
omegaid_2x2_gpu 0.0947 1.47x
phyid 0.1640 1.00x
2x2 MMI (100k) omegaid_2x2_cpu 0.1168 1.07x
omegaid_2x2_gpu 0.4511 0.26x
phyid 0.1247 1.00x
4x2 CCS (100k) omegaid_4x2_cpu 0.3962 1.00x
omegaid_4x2_gpu 0.1892 2.09x
4x2 MMI (100k) omegaid_4x2_cpu 0.4043 1.00x
omegaid_4x2_gpu 0.2558 1.58x
4x4 MMI (10k) omegaid_4x4_cpu 1.8373 1.00x
omegaid_4x4_gpu 0.8201 2.24x

The results demonstrate that for more complex multivariate systems (e.g., 4x2 and 4x4), the CuPy backend provides a consistent and significant performance advantage due to the fully vectorized implementation. For simpler 2x2 systems, the Numba-optimized NumPy backend remains highly competitive.

License

This project is licensed under the BSD 3-Clause License.

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

omegaid-0.2.5.tar.gz (36.9 kB view details)

Uploaded Source

Built Distribution

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

omegaid-0.2.5-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file omegaid-0.2.5.tar.gz.

File metadata

  • Download URL: omegaid-0.2.5.tar.gz
  • Upload date:
  • Size: 36.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for omegaid-0.2.5.tar.gz
Algorithm Hash digest
SHA256 8e8179f3f1d3a0bd79aec65342c6cc9c7375114fa89415e4c39be9835a1e5c7b
MD5 eeb4959fdbfb2d8fcf1cc2c307f28638
BLAKE2b-256 34dfe5512e4da6cb0b61c404c9e8a72a154c7489f6ca89a814a5224f74b36e22

See more details on using hashes here.

Provenance

The following attestation bundles were made for omegaid-0.2.5.tar.gz:

Publisher: publish-to-pypi.yml on dmf-archive/OmegaID

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

File details

Details for the file omegaid-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: omegaid-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for omegaid-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8077bd698f53aa881c6728bc56d6d20527c0fcb51fd9e4d1a9ed3b052cbee632
MD5 71a736f5fffd722552a5a3b6def85d6c
BLAKE2b-256 96deba52d0979f96b253b72d3dbeffd4993cb24344fe0614b0415705b453f28e

See more details on using hashes here.

Provenance

The following attestation bundles were made for omegaid-0.2.5-py3-none-any.whl:

Publisher: publish-to-pypi.yml on dmf-archive/OmegaID

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

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