GPUsync
Write GPU kernels in Python and run them on any GPU: CUDA, Metal, Vulkan, DX12 (through wgpu) and OpenCL ≥ 1.2. The core is written in Rust; the only runtime dependency is NumPy.
pip install gpusync
import numpy as np
import gpusync as gs
@gs.kernel
def normalize(x: gs.f32[:], mean: gs.f32, std: gs.f32) -> gs.f32[:]:
return (x - mean) / std
x = np.random.rand(1_000_000).astype(np.float32)
y = normalize(x, x.mean(), x.std()) # runs on the best available GPU
print(y[:5]) # waits for the result and copies it back
z = normalize(y, 0.0, 2.0) # chaining: y stays on the GPU
- Write one cell, run them all. Element-wise kernels, indexed kernels (
gs.index(), named dimensions, several outputs, local arrays) and an explicit mode with atomic writes for histograms and scattering. - Every GPU, the same code. The device is picked from what the kernel needs (CUDA, then Vulkan, OpenCL…); when
an operation is missing (f64 on Metal, for instance), the whole kernel moves to a capable device, with a
warning. A reference interpreter (
cpu:0) is always available. - No size limit. Inputs and outputs larger than GPU memory, or than main memory (
np.memmap,out=,kernel.stream()): the computation is split and transfers overlap with compute. - Results stay on the GPU until read: chaining,
await, Jupyter, threads, zero-copy DLPack,y.save(). - Thread groups: shared memory, barriers checked at compile time, several cells per thread, byte matrix products on Tensor Cores (CUDA).
- Native window (
gs.Window) that shows GPU results without a copy.
Documentation
Full documentation in docs/, also published as a website (generated into docs/pages):
installation, writing a kernel, results and large data,
devices, atomics, thread groups, window,
errors and performance, reference. Every Python example in it is run by the
tests.
The internal design (IR, code generators, transfer engine, measurements per milestone) is described in ARCHITECTURE.md (in French).
The graphics and simulation engine gpusync.gfx (2D / 3D rendering, fluids, atmosphere, weather) is a separate
package, gpusync-gfx, installed on top of the library.
Status
Version 0.1. Tested on macOS (Apple M5 Pro: Metal, OpenCL) and Windows (RTX 4080 SUPER and Intel UHD 770: CUDA, Vulkan, OpenCL); Linux is built by the CI but not tested on a GPU yet.
Development
Requirements: Rust (rustup), Python ≥ 3.10 and a C compiler (Xcode Command Line Tools on macOS, Visual Studio Build Tools "C++" on Windows).
python3 tools/dev.py setup # .venv + maturin, pytest, NumPy, then builds both packages
python3 tools/dev.py test # rebuilds, then cargo test, pytest and the device diagnostic
python3 tools/build_pages.py # regenerates the documentation website
GS_EXPECT=metal,opencl (or vulkan,opencl) makes the tests fail if these backends have no device on the
machine. To run on every test machine at once, see tools/remote:
python3 tools/remote/gs_remote.py run all -- @python tools/dev.py test
Benchmarks of each milestone are in tools/bench_m*.py (see ARCHITECTURE.md for their results).
Layout
crates/
gpusync-ir/ typed IR, semantics, reference interpreter
gpusync-frontend/ Python AST (JSON) → IR: typing, errors
gpusync-codegen/ IR → OpenCL C, CUDA C, WGSL
gpusync-runtime/ shared types (DeviceInfo, Backend trait), discovery
gpusync-backend-wgpu/ Metal, Vulkan, DX12: discovery, execution, window
gpusync-backend-opencl/ OpenCL (loaded dynamically): discovery, execution, zero-copy
gpusync-backend-cuda/ CUDA (driver and NVRTC loaded dynamically): discovery, execution
gpusync-core/ compilation and launch (no Python); multi-GPU differential test
gpusync-py/ PyO3 binding → gpusync._core module
python/gpusync/ Python package: @gs.kernel, gs.Array, types, devices, gs.Window
gfx/ gpusync-gfx package: the gpusync.gfx engine and its tests
docs/ library documentation (examples checked by tests/test_docs.py)
docs/pages/ GitHub Pages website, generated from docs/*.md by tools/build_pages.py
tests/ Python tests (differential on every device, errors, docs)
tools/ dev tasks (dev.py), website generator, benchmarks, remote test machines
Licence
MIT, see LICENSE.
Metadata
Release files for gpusync 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| gpusync-0.1.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for gpusync-0.1.0-cp310-abi3-win_amd64.whl |
| gpusync-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ x86-64 | Details for gpusync-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl |
| gpusync-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ ARM64 | Details for gpusync-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl |
| gpusync-0.1.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details for gpusync-0.1.0-cp310-abi3-macosx_11_0_arm64.whl |
| gpusync-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details for gpusync-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl |
Total release size: 18.1 MB
Release files / gpusync-0.1.0-cp310-abi3-win_amd64.whl
| Download URL | gpusync-0.1.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 3.4 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
6c1816e2f96dd626f95287d7258e07a13fea5c24734579570d6a89f0d8a661ec
|
|
BLAKE2b-256 checksum How to use checksums |
0ce22581a585b7a047dc416612732f2f6f6f6717af615406e58558b4b0bfddd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / gpusync-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl
| Download URL | gpusync-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
a6c662601b6d9c0a78ebc70e6adf933f93c039c8f248abbaa24473f20cc84e58
|
|
BLAKE2b-256 checksum How to use checksums |
7641ac296494a341d23d345ce93714a2c3fd606b6e15245a3599ba97abc58935
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / gpusync-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl
| Download URL | gpusync-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 4.4 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
058567c0f8d82ae44e593e360593b87d8da5c5670a74244be08af6024895669c
|
|
BLAKE2b-256 checksum How to use checksums |
6e081f6396e9bb101fd57998fc5787941844a4c2b641ce3acd7b4ac4c89db950
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / gpusync-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | gpusync-0.1.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d075de460a9af6321b48738d223ed190c2389b7be6bcc009e00f2cf34532935b
|
|
BLAKE2b-256 checksum How to use checksums |
08b1dbf71d3d920dc3d8efd87adb3b59679e607aa2c408bcf04b030e98438b9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / gpusync-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | gpusync-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
3172f0432b3911fc119e55276c608794d7ccc13a03208a00234c7405fdb39217
|
|
BLAKE2b-256 checksum How to use checksums |
5b518957ffcadb0e60b91ed6171627acf789d201c750fe6a2fc90cb0c5059e18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logSecurity for gpusync 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 5 files in this release have been uploaded with provenance metadata.
Attestation for gpusync-0.1.0-cp310-abi3-win_amd64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.