A high-performance toolbox for PhiID computation, accelerated by GPU.
Project description
ΩID
Ω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
phyidimplementation 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file omegaid-0.2.4.tar.gz.
File metadata
- Download URL: omegaid-0.2.4.tar.gz
- Upload date:
- Size: 39.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82a1564a0cb41231a5ae5892c63008e2bf9201f5f930beb0b2b67c81d49d04b4
|
|
| MD5 |
cc319a919afd79a5b3ff0bd83622f68c
|
|
| BLAKE2b-256 |
4c821ca601bf9552927d2a3c0f852fc280894761b6a911953b096062835d66c3
|
Provenance
The following attestation bundles were made for omegaid-0.2.4.tar.gz:
Publisher:
publish-to-pypi.yml on dmf-archive/OmegaID
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
omegaid-0.2.4.tar.gz -
Subject digest:
82a1564a0cb41231a5ae5892c63008e2bf9201f5f930beb0b2b67c81d49d04b4 - Sigstore transparency entry: 256085475
- Sigstore integration time:
-
Permalink:
dmf-archive/OmegaID@e93121d7a7e17039d96927f7b145ab538d1ca53f -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/dmf-archive
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@e93121d7a7e17039d96927f7b145ab538d1ca53f -
Trigger Event:
push
-
Statement type:
File details
Details for the file omegaid-0.2.4-py3-none-any.whl.
File metadata
- Download URL: omegaid-0.2.4-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2382a9e5e94ab90fba8171fd3b5331bebc8e37b71e94e8b6927fa1dce5f2435
|
|
| MD5 |
92d7ed6b861703ecee39b7722258bb02
|
|
| BLAKE2b-256 |
7a3f1d65587ce79a5224bdc7ea1b32fe3cdc28e2860dc66a4a0557f5cdd031cf
|
Provenance
The following attestation bundles were made for omegaid-0.2.4-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on dmf-archive/OmegaID
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
omegaid-0.2.4-py3-none-any.whl -
Subject digest:
e2382a9e5e94ab90fba8171fd3b5331bebc8e37b71e94e8b6927fa1dce5f2435 - Sigstore transparency entry: 256085478
- Sigstore integration time:
-
Permalink:
dmf-archive/OmegaID@e93121d7a7e17039d96927f7b145ab538d1ca53f -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/dmf-archive
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@e93121d7a7e17039d96927f7b145ab538d1ca53f -
Trigger Event:
push
-
Statement type: