High-performance Python acceleration engine — CPU, threads, virtual threads, multi-GPU and virtualization.
Project description
PyAccelerate
High-performance Python acceleration engine — CPU, threads, virtual threads, multi-GPU and virtualization.
Features
| Module | Description |
|---|---|
cpu |
CPU detection, topology, NUMA, affinity, ISA flags, dynamic worker recommendations |
threads |
Persistent virtual-thread pool, sliding-window executor, async bridge, process pool |
gpu |
Multi-vendor GPU detection (NVIDIA/CUDA, AMD/OpenCL, Intel oneAPI), ranking, multi-GPU dispatch |
virt |
Virtualization detection (Hyper-V, VT-x/AMD-V, KVM, WSL2, Docker, container detection) |
memory |
Memory pressure monitoring, automatic worker clamping, reusable buffer pool |
profiler |
@timed, @profile_memory decorators, Timer context manager, Tracker statistics |
benchmark |
Built-in micro-benchmarks (CPU, threads, memory bandwidth, GPU compute) |
engine |
Unified orchestrator — auto-detects everything and provides a single API |
Quick Start
pip install pyaccelerate
from pyaccelerate import Engine
engine = Engine()
print(engine.summary())
# Submit I/O-bound tasks to the virtual thread pool
future = engine.submit(my_io_func, arg1, arg2)
# Run many tasks with auto-tuned concurrency
engine.run_parallel(process_file, [(f,) for f in files])
# GPU dispatch (auto-fallback to CPU)
results = engine.gpu_dispatch(my_kernel, data_chunks)
CLI
pyaccelerate info # Full hardware report
pyaccelerate benchmark # Run micro-benchmarks
pyaccelerate gpu # GPU details
pyaccelerate cpu # CPU details
pyaccelerate virt # Virtualization info
pyaccelerate memory # Memory stats
pyaccelerate status # One-liner
Modules in Depth
Virtual Thread Pool
Inspired by Java's virtual threads — a persistent ThreadPoolExecutor sized for I/O (cores × 3, cap 32). All I/O-bound work shares this pool instead of creating/destroying threads per operation.
from pyaccelerate.threads import get_pool, run_parallel, submit
# Single task
fut = submit(download_file, url)
# Bounded concurrency (sliding window)
run_parallel(process, [(item,) for item in items], max_concurrent=8)
Multi-GPU Dispatch
Auto-detects GPUs across CUDA, OpenCL and Intel oneAPI. Distributes workloads with configurable strategies.
from pyaccelerate.gpu import detect_all, dispatch
gpus = detect_all()
results = dispatch(my_kernel, data_chunks, strategy="score-weighted")
Profiling
Zero-config decorators for timing and memory tracking:
from pyaccelerate.profiler import timed, profile_memory, Tracker
@timed(level=logging.INFO)
def heavy_computation():
...
tracker = Tracker("db_queries")
for batch in batches:
with tracker.measure():
run_query(batch)
print(tracker.summary())
Installation Options
# Core (CPU + threads + memory + virt)
pip install pyaccelerate
# With NVIDIA GPU support
pip install pyaccelerate[cuda]
# With OpenCL support (AMD/Intel/NVIDIA)
pip install pyaccelerate[opencl]
# With Intel oneAPI support
pip install pyaccelerate[intel]
# All GPU backends
pip install pyaccelerate[all-gpu]
# Development
pip install pyaccelerate[dev]
Docker
# CPU-only
docker build -t pyaccelerate .
docker run --rm pyaccelerate info
# With NVIDIA GPU
docker build -f Dockerfile.gpu -t pyaccelerate:gpu .
docker run --rm --gpus all pyaccelerate:gpu info
# Docker Compose
docker compose up pyaccelerate # CPU
docker compose up gpu # GPU
Development
git clone https://github.com/GuilhermeP96/pyaccelerate.git
cd pyaccelerate
pip install -e ".[dev]"
# Run tests
pytest -v
# Lint + format
ruff check src/ tests/
ruff format src/ tests/
# Type check
mypy src/
# Build wheel
python -m build
Architecture
pyaccelerate/
├── cpu.py # CPU detection & topology
├── threads.py # Virtual thread pool & executors
├── gpu/
│ ├── detector.py # Multi-vendor GPU enumeration
│ ├── cuda.py # CUDA/CuPy helpers
│ ├── opencl.py # PyOpenCL helpers
│ ├── intel.py # Intel oneAPI helpers
│ └── dispatch.py # Multi-GPU load balancer
├── virt.py # Virtualization detection
├── memory.py # Memory monitoring & buffer pool
├── profiler.py # Timing & profiling utilities
├── benchmark.py # Built-in micro-benchmarks
├── engine.py # Unified orchestrator
└── cli.py # Command-line interface
Roadmap
- npm package (Node.js bindings via pybind11/napi)
- gRPC server mode for multi-language integration
- Kubernetes operator for auto-scaling GPU workloads
- Prometheus metrics exporter
- Auto-tuning feedback loop (benchmark → config → re-tune)
Origin
Evolved from the acceleration & virtual-thread systems built for:
- adb-toolkit — multi-GPU acceleration, virtual thread pool
- python-gpu-statistical-analysis — GPU compute foundations
License
MIT — see 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 pyaccelerate-0.1.0.tar.gz.
File metadata
- Download URL: pyaccelerate-0.1.0.tar.gz
- Upload date:
- Size: 37.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20d75205c215f81ff62dfde9f889a9306ee403c3407bb2004f51136bb0d3d24a
|
|
| MD5 |
3c629af40b9dd05283ef11805e20f988
|
|
| BLAKE2b-256 |
acb1a4f2f670d488863d0c3dc6a93b379ae4d463b309508a060897d388c3a0f7
|
Provenance
The following attestation bundles were made for pyaccelerate-0.1.0.tar.gz:
Publisher:
publish.yml on GuilhermeP96/pyaccelerate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyaccelerate-0.1.0.tar.gz -
Subject digest:
20d75205c215f81ff62dfde9f889a9306ee403c3407bb2004f51136bb0d3d24a - Sigstore transparency entry: 1004938745
- Sigstore integration time:
-
Permalink:
GuilhermeP96/pyaccelerate@3fcef96f7c870ba7d04a7383748df5ea560c5a77 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/GuilhermeP96
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3fcef96f7c870ba7d04a7383748df5ea560c5a77 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyaccelerate-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyaccelerate-0.1.0-py3-none-any.whl
- Upload date:
- Size: 38.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce21bf11880bd60e9711bd4b321e9e687a69d388b7eda47daa425cb3c838230e
|
|
| MD5 |
de5cf165b8c71a602fea905b7b8380fd
|
|
| BLAKE2b-256 |
f0530d1a2e3ee917d7b9ee88356cb1532f1e3c1e5611701ec19de5d157a4dda9
|
Provenance
The following attestation bundles were made for pyaccelerate-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on GuilhermeP96/pyaccelerate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyaccelerate-0.1.0-py3-none-any.whl -
Subject digest:
ce21bf11880bd60e9711bd4b321e9e687a69d388b7eda47daa425cb3c838230e - Sigstore transparency entry: 1004938746
- Sigstore integration time:
-
Permalink:
GuilhermeP96/pyaccelerate@3fcef96f7c870ba7d04a7383748df5ea560c5a77 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/GuilhermeP96
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3fcef96f7c870ba7d04a7383748df5ea560c5a77 -
Trigger Event:
release
-
Statement type: