A unified, high-performance core runtime for data, computation, and AI workflows.
Project description
Corepy
High-Performance Tensor Runtime for Python. Rust-Powered Backend. Correctness First. Hardware Aware.
📖 What is Corepy?
Corepy is a high-performance tensor library that bridges Python's ease of use with the raw speed and safety of Rust and C++.
Unlike untyped array libraries, Corepy is built on a strict runtime that ensures:
- Safety: Rust ownership guarantees prevent common segmentation faults.
- Performance: C++ kernels (AVX2, NEON) and Metal shaders for heavy number crunching.
- Observability: Zero-overhead built-in profiler to visualize bottlenecks.
It is designed for developers building AI foundations, scientific simulations, and high-performance systems.
Key Features
- NumPy-Compatible API: Familiar
cp.array,cp.zeros,cp.addinterface. - 🚀 Metal GPU: Native acceleration on macOS (Apple Silicon) with
device="metal". - 📊 Profiler Export: Visualise traces in Chrome/Perfetto with
cp.profiler.export_chrome_trace(). - ⚡ Hybrid Runtime: Rust dispatcher + C++ kernels + Objective-C++ (Metal).
- 🛡️ Cross-Platform Build: CMake-based build system that works on Linux, macOS, and Windows.
- 📈 Efficient Stats: Compute multiple statistics in one pass with
cp.compute_stats.
💻 Supported Platforms
| Platform | Architecture | Accelerators | Status |
|---|---|---|---|
| Linux | x86_64 | AVX2, OpenBLAS | ✅ Production |
| macOS | Apple Silicon | Metal, NEON | ✅ Beta (0.2.4+) |
| Windows | x86_64 | AVX2 | ✅ Experimental |
🛠️ Installation
Preferred Method (uv)
We recommend uv for fast, correct cross-platform installation.
uv pip install corepy
Fallback (pip)
pip install corepy
👨💻 Development
For detailed instructions on setting up a development environment, building from source, and running tests, please refer to DEVELOPMENT.md.
Quick Build
git clone https://github.com/ai-foundation-software/corepy.git
cd corepy
make install
⚡ Quick Start
1. Metal Acceleration (macOS)
import corepy as cp
# Automatically uses Metal if available on macOS
t = cp.array([1.0, 2.0, 3.0], device="metal")
result = t.sum()
print(f"Result (GPU): {result}")
2. Performance Profiling
Stop guessing where your code is slow. Corepy has a built-in profiler.
import corepy as cp
# 1. Enable profiling
cp.enable_profiling()
# 2. Run your heavy workload
x = cp.ones(1_000_000)
y = x * 3.14159
result = y.mean()
# 3. Export to Chrome Tracing format
cp.profiler.export_chrome_trace("trace.json")
📚 Documentation
- Getting Started: First steps and installation details.
- Metal GPU Guide: using Apple Silicon acceleration.
- Architecture: Deep dive into the Rust/C++ hybrid runtime.
- Examples: Runnable scripts for common patterns.
- Contributing: Build and test guide.
🤝 Stability & Roadmap
Corepy is currently Alpha (v0.2.4).
- v0.2.4: Local CI Simulation, Metal Framework linking, Pinned Deps.
- v0.3.0: CUDA Support and Tiled Matmul Optimization.
- v1.0: Stable API promise.
See Roadmap for details.
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 corepy_ai-0.2.4.tar.gz.
File metadata
- Download URL: corepy_ai-0.2.4.tar.gz
- Upload date:
- Size: 72.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac7a99e92feaad867ec9c9cdbfbbd334d0fb16e63acdf34936cd2cdc4b1359e0
|
|
| MD5 |
1bd00edcfd9ddc153e821b1304761a07
|
|
| BLAKE2b-256 |
b5864c9983e80020916f1da570aee2f54ffa450448458cd7f1cc5699c07ac6ac
|
Provenance
The following attestation bundles were made for corepy_ai-0.2.4.tar.gz:
Publisher:
release.yml on ai-foundation-software/corepy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
corepy_ai-0.2.4.tar.gz -
Subject digest:
ac7a99e92feaad867ec9c9cdbfbbd334d0fb16e63acdf34936cd2cdc4b1359e0 - Sigstore transparency entry: 962913338
- Sigstore integration time:
-
Permalink:
ai-foundation-software/corepy@31262aba995d5910be7dcf0dfe6cc6202a60a1e4 -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/ai-foundation-software
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@31262aba995d5910be7dcf0dfe6cc6202a60a1e4 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file corepy_ai-0.2.4-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: corepy_ai-0.2.4-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 268.4 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ab5ab611bd3b0cad2a3e5df4000f60d1ac523e24f805af2f16ad4cc3c750ad9
|
|
| MD5 |
cb7f695e1cf7599cad979c8bbcfc73b6
|
|
| BLAKE2b-256 |
dc22cf02fd31726cdf347e4d2f798e233c1a51a9e4fd6f84554e158a0a36ff13
|
Provenance
The following attestation bundles were made for corepy_ai-0.2.4-cp39-abi3-win_amd64.whl:
Publisher:
release.yml on ai-foundation-software/corepy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
corepy_ai-0.2.4-cp39-abi3-win_amd64.whl -
Subject digest:
8ab5ab611bd3b0cad2a3e5df4000f60d1ac523e24f805af2f16ad4cc3c750ad9 - Sigstore transparency entry: 962913375
- Sigstore integration time:
-
Permalink:
ai-foundation-software/corepy@31262aba995d5910be7dcf0dfe6cc6202a60a1e4 -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/ai-foundation-software
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@31262aba995d5910be7dcf0dfe6cc6202a60a1e4 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file corepy_ai-0.2.4-cp39-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: corepy_ai-0.2.4-cp39-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 12.7 MB
- Tags: CPython 3.9+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ae903ca3b5e32970471ef3b1101042ff372eb900c952d5f13b53fa5b6dc4976
|
|
| MD5 |
ab55f7b8a27fc842d9680de0b4f00872
|
|
| BLAKE2b-256 |
d7b596fc8259812bd47619c6caaa83bd9b7efe6ea9c1ca83faa065ad5adcbe43
|
Provenance
The following attestation bundles were made for corepy_ai-0.2.4-cp39-abi3-manylinux_2_28_x86_64.whl:
Publisher:
release.yml on ai-foundation-software/corepy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
corepy_ai-0.2.4-cp39-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
6ae903ca3b5e32970471ef3b1101042ff372eb900c952d5f13b53fa5b6dc4976 - Sigstore transparency entry: 962913364
- Sigstore integration time:
-
Permalink:
ai-foundation-software/corepy@31262aba995d5910be7dcf0dfe6cc6202a60a1e4 -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/ai-foundation-software
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@31262aba995d5910be7dcf0dfe6cc6202a60a1e4 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file corepy_ai-0.2.4-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: corepy_ai-0.2.4-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 407.2 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d7b580ce07d70b99a34d250b65ad3145eeca1d09e370afbf35973ac7a1ea3d6
|
|
| MD5 |
13568f7954a259d428f69ed4c239f25e
|
|
| BLAKE2b-256 |
044bfdf8774b421e6fed1f020f40cba2413d9666cdc63e8035066d9e540af35a
|
Provenance
The following attestation bundles were made for corepy_ai-0.2.4-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on ai-foundation-software/corepy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
corepy_ai-0.2.4-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
8d7b580ce07d70b99a34d250b65ad3145eeca1d09e370afbf35973ac7a1ea3d6 - Sigstore transparency entry: 962913351
- Sigstore integration time:
-
Permalink:
ai-foundation-software/corepy@31262aba995d5910be7dcf0dfe6cc6202a60a1e4 -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/ai-foundation-software
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@31262aba995d5910be7dcf0dfe6cc6202a60a1e4 -
Trigger Event:
workflow_dispatch
-
Statement type: