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 GPU support for significant speedups on large datasets.
- Numerical Integrity: Results are numerically consistent with the original
phyidimplementation.
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.
import numpy as np
from omegaid.core.decomposition import calc_PhiID
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
n_samples = 10000
tau = 1
src = np.random.randn(n_samples)
trg = np.random.randn(n_samples)
# Calculate Phi-ID
atoms_res, calc_res = calc_PhiID(src, trg, tau)
# Print the synergistic atom (sts)
print("Synergy (sts):", np.mean(atoms_res["sts"]))
Performance
The package has been benchmarked against the original phyid implementation. The NumPy backend provides a consistent ~1.4-2x speedup. The CuPy backend shows significant performance gains on larger datasets, leveraging GPU acceleration effectively.
Note: The current benchmarks are based on a 2x2 system (two scalar time series).
| Data Size | Original (scipy) | OmegaID (numpy) | OmegaID (cupy) | NumPy Speedup | CuPy Speedup |
|---|---|---|---|---|---|
| 10,000 | 0.0112s | 0.0071s | 0.3243s | 1.58x | 0.03x |
| 100,000 | 0.1161s | 0.0846s | 0.0932s | 1.37x | 1.25x |
| 500,000 | 0.6492s | 0.4592s | 0.3207s | 1.41x | 2.02x |
The results demonstrate that for data lengths exceeding 100,000 samples, the CuPy backend begins to outperform both the original and the NumPy-based implementations, with the trend suggesting greater speedups for even larger datasets.
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.2.tar.gz.
File metadata
- Download URL: omegaid-0.2.2.tar.gz
- Upload date:
- Size: 38.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9be8ee80e58af1ae21554502912c5a720093429b5df1fd8fb975ac0b25627973
|
|
| MD5 |
c1a24a4f94b9dfcf3b2c28820c11409f
|
|
| BLAKE2b-256 |
cd618447b01e4083bd96413c8e9481e0c1047ac2d2081762238ae30f2e6238c3
|
Provenance
The following attestation bundles were made for omegaid-0.2.2.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.2.tar.gz -
Subject digest:
9be8ee80e58af1ae21554502912c5a720093429b5df1fd8fb975ac0b25627973 - Sigstore transparency entry: 256039827
- Sigstore integration time:
-
Permalink:
dmf-archive/OmegaID@38bb26f0ecf0f47ab5f25f37d2cc2aeb520d27b7 -
Branch / Tag:
refs/tags/v0.2.2 - 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@38bb26f0ecf0f47ab5f25f37d2cc2aeb520d27b7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file omegaid-0.2.2-py3-none-any.whl.
File metadata
- Download URL: omegaid-0.2.2-py3-none-any.whl
- Upload date:
- Size: 9.8 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 |
96404dfa7a0a96a2995e379776f442c278a822d4f9eb9ec15a28f85b6bff6713
|
|
| MD5 |
b135f551a1fd5cc7534ea6846da748bd
|
|
| BLAKE2b-256 |
2ccdc5a6a4aadf3fab054f8f7a8fb439e3e8e358f414c151950d76bf8c0c569f
|
Provenance
The following attestation bundles were made for omegaid-0.2.2-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.2-py3-none-any.whl -
Subject digest:
96404dfa7a0a96a2995e379776f442c278a822d4f9eb9ec15a28f85b6bff6713 - Sigstore transparency entry: 256039836
- Sigstore integration time:
-
Permalink:
dmf-archive/OmegaID@38bb26f0ecf0f47ab5f25f37d2cc2aeb520d27b7 -
Branch / Tag:
refs/tags/v0.2.2 - 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@38bb26f0ecf0f47ab5f25f37d2cc2aeb520d27b7 -
Trigger Event:
push
-
Statement type: