Actor-shaped face for compute-acceleration backends (NVIDIA CUDA shipping; ROCm / Metal / oneAPI / Vulkan future), on the rakka actor runtime.
Project description
rakka-accel (Python)
Python bindings for rakka-accel — drive an actor-supervised NVIDIA CUDA pipeline directly from Python without juggling streams, contexts, or hand-rolled retry loops.
import numpy as np
import rakka_accel
with rakka_accel.System.open("my-app") as sys:
dev = sys.spawn_device(device_id=0) # real CUDA device
# Allocate two N×N f32 buffers on-device.
n = 256
a = dev.allocate_f32(n * n)
b = dev.allocate_f32(n * n)
c = dev.allocate_f32(n * n)
# Upload from numpy.
dev.copy_from_numpy(a, np.ones(n * n, dtype=np.float32))
dev.copy_from_numpy(b, np.full(n * n, 2.0, dtype=np.float32))
# Run cuBLAS SGEMM — the call blocks until the kernel finishes.
dev.sgemm(a, b, c, m=n, n=n, k=n, alpha=1.0, beta=0.0)
# Pull the result back into a fresh numpy array.
result = dev.copy_to_numpy(c)
print(result.reshape(n, n))
For hosts without a GPU, pass mock=True to spawn_device and the
device replies Unrecoverable("...mock mode") for any kernel call —
useful for testing the surrounding plumbing in CI.
Install
The wheel builds with maturin:
# from this directory
pip install maturin pytest numpy
maturin develop --release # builds + installs into the active venv
pytest tests/ # runs the no-GPU smoke suite
For a release wheel:
maturin build --release --no-default-features --features extension-module
# wheel lands in target/wheels/
The pure-Python facade (python/rakka_accel/__init__.py) re-exports
the native classes and exception types. Downstream libraries import
from rakka_accel and treat rakka_accel._native as private.
Feature flags
The Rust crate matches rakka-accel's feature gating so the wheel can
be built minimal or full:
| Feature | Adds |
|---|---|
| (default) | System, Device, GpuBuffer, exceptions |
curand |
RngGenerator |
nvrtc |
NvrtcKernel |
cudnn / cufft / cusolver / cublaslt / nccl |
placeholder; future Python surfaces |
core-libs / training-libs / full-cuda |
aggregates |
maturin develop --features rakka-accel-py/curand,rakka-accel-py/nvrtc
Public API
| Class / function | What it wraps |
|---|---|
rakka_accel.System.open(name) |
A rakka_core::actor::ActorSystem lifetime |
system.spawn_device(id, mock=) |
A DeviceActor (real or mock) |
device.allocate_f32(len) |
DeviceMsg::AllocateF32 → GpuBuffer |
device.copy_from_numpy(buf, np) |
H2D CopyFromHostF32 |
device.copy_to_numpy(buf) |
D2H CopyToHostF32 → numpy float32 array |
device.sgemm(a,b,c,m,n,k,...) |
cuBLAS SGEMM via BlasActor |
device.stats() |
DeviceMsg::Stats → DeviceLoad |
GpuBuffer.is_stale() |
Generation token check vs. DeviceState |
GpuRuntimeError (and subclasses) |
Typed GpuError mapping |
Every method blocks the calling thread until the underlying actor
replies (the GIL is released for the duration via py.allow_threads).
Async wrappers can be layered later via
pyo3_async_runtimes::tokio::future_into_py.
How it works
Three pieces:
- A shared tokio runtime. The first call to
System.open(...)initializes a multi-threaded scheduler; every subsequent call reuses it. Implemented insrc/runtime.rsviapyo3-async-runtimes::tokio::init. - The
_nativeextension module.src/lib.rsregistersSystem,Device,GpuBuffer, exceptions, and (feature-gated)RngGenerator/NvrtcKernel. Each Python class wraps a typedActorRef<...>from rakka-accel and converts replies viaerrors::map_gpu. - The pure-Python facade at
python/rakka_accel/__init__.py. Hides_native; documents the API; gives downstream libraries a stable import path.
See docs/python-bridge.md for the full architecture write-up.
License
Apache-2.0.
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 Distributions
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 rakka_accel-0.2.9.tar.gz.
File metadata
- Download URL: rakka_accel-0.2.9.tar.gz
- Upload date:
- Size: 9.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f63e6a2f6a5b5e5c52f182125413d2a82d26f13f0a0a9ed684ef4131acf4ed0
|
|
| MD5 |
14c7add2c591e5bb9cbf6fa9ece37214
|
|
| BLAKE2b-256 |
0b71ed5b1d575ed90c2e82f57fec46fc4279249dea82aa44140afdfa946fa525
|
Provenance
The following attestation bundles were made for rakka_accel-0.2.9.tar.gz:
Publisher:
release.yml on rustakka/rakka-accel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rakka_accel-0.2.9.tar.gz -
Subject digest:
3f63e6a2f6a5b5e5c52f182125413d2a82d26f13f0a0a9ed684ef4131acf4ed0 - Sigstore transparency entry: 1436163367
- Sigstore integration time:
-
Permalink:
rustakka/rakka-accel@7cf7d505f28547435246022914c92629f31b8ac2 -
Branch / Tag:
refs/tags/v0.2.9 - Owner: https://github.com/rustakka
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7cf7d505f28547435246022914c92629f31b8ac2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rakka_accel-0.2.9-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: rakka_accel-0.2.9-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 631.3 kB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b02f422a88b3402f99dbd553386054095ad9d8e1c45bf0cb186316eccc350781
|
|
| MD5 |
a0bac6f8a74a1aebfdf6d0d035215528
|
|
| BLAKE2b-256 |
d4ad33cca8ce769835a7961b798a310c24b65ed9f52426111863c0df034494a7
|
Provenance
The following attestation bundles were made for rakka_accel-0.2.9-cp310-abi3-win_amd64.whl:
Publisher:
release.yml on rustakka/rakka-accel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rakka_accel-0.2.9-cp310-abi3-win_amd64.whl -
Subject digest:
b02f422a88b3402f99dbd553386054095ad9d8e1c45bf0cb186316eccc350781 - Sigstore transparency entry: 1436163372
- Sigstore integration time:
-
Permalink:
rustakka/rakka-accel@7cf7d505f28547435246022914c92629f31b8ac2 -
Branch / Tag:
refs/tags/v0.2.9 - Owner: https://github.com/rustakka
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7cf7d505f28547435246022914c92629f31b8ac2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rakka_accel-0.2.9-cp310-abi3-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: rakka_accel-0.2.9-cp310-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 903.7 kB
- Tags: CPython 3.10+, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce8c2dc9c2d97c30e364fcd195c97b04ccbcdd8ae8dbe38e603cc0a6120769ce
|
|
| MD5 |
04645a3bb980ffb41b3386a240eab3b5
|
|
| BLAKE2b-256 |
659223a661c56e89b382d50c6d2cb38dcc139f7880d0ea8d7626c3ee619a7d44
|
Provenance
The following attestation bundles were made for rakka_accel-0.2.9-cp310-abi3-musllinux_1_2_x86_64.whl:
Publisher:
release.yml on rustakka/rakka-accel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rakka_accel-0.2.9-cp310-abi3-musllinux_1_2_x86_64.whl -
Subject digest:
ce8c2dc9c2d97c30e364fcd195c97b04ccbcdd8ae8dbe38e603cc0a6120769ce - Sigstore transparency entry: 1436163373
- Sigstore integration time:
-
Permalink:
rustakka/rakka-accel@7cf7d505f28547435246022914c92629f31b8ac2 -
Branch / Tag:
refs/tags/v0.2.9 - Owner: https://github.com/rustakka
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7cf7d505f28547435246022914c92629f31b8ac2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rakka_accel-0.2.9-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: rakka_accel-0.2.9-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 688.0 kB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc2dd9ae2881cc4c936ac6bfb4cfb26f982d1a466156105c8aff112c2669db6d
|
|
| MD5 |
edb378468ac844facd657effb20beba7
|
|
| BLAKE2b-256 |
84cb88fa17b5e0ba0e5b263233e8450b648e9121fe74f9dac29b0a8e27b23d7e
|
Provenance
The following attestation bundles were made for rakka_accel-0.2.9-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on rustakka/rakka-accel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rakka_accel-0.2.9-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
fc2dd9ae2881cc4c936ac6bfb4cfb26f982d1a466156105c8aff112c2669db6d - Sigstore transparency entry: 1436163370
- Sigstore integration time:
-
Permalink:
rustakka/rakka-accel@7cf7d505f28547435246022914c92629f31b8ac2 -
Branch / Tag:
refs/tags/v0.2.9 - Owner: https://github.com/rustakka
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7cf7d505f28547435246022914c92629f31b8ac2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rakka_accel-0.2.9-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.
File metadata
- Download URL: rakka_accel-0.2.9-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.10+, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b28620dd57f5e25da4989ec63c08426635a08c22f78bdab5757b72713b7f0e55
|
|
| MD5 |
5bd67bd2204b1bac80949cc6bc853825
|
|
| BLAKE2b-256 |
9973eba58320d457950346163d28c13b07a51a57f7c0dee2192c8432abd5bbf5
|
Provenance
The following attestation bundles were made for rakka_accel-0.2.9-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:
Publisher:
release.yml on rustakka/rakka-accel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rakka_accel-0.2.9-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl -
Subject digest:
b28620dd57f5e25da4989ec63c08426635a08c22f78bdab5757b72713b7f0e55 - Sigstore transparency entry: 1436163369
- Sigstore integration time:
-
Permalink:
rustakka/rakka-accel@7cf7d505f28547435246022914c92629f31b8ac2 -
Branch / Tag:
refs/tags/v0.2.9 - Owner: https://github.com/rustakka
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7cf7d505f28547435246022914c92629f31b8ac2 -
Trigger Event:
push
-
Statement type: