Skip to main content

A unified, high-performance core runtime for data, computation, and AI workflows.

Project description

Corepy

Corepy Logo


CI Ruff uv Python License: MIT

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:

  1. Safety: Rust ownership guarantees prevent common segmentation faults.
  2. Performance: C++ kernels (AVX2, NEON) and Metal shaders for heavy number crunching.
  3. 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.add interface.
  • 🚀 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


🤝 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

corepy_ai-0.2.4.tar.gz (72.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

corepy_ai-0.2.4-cp39-abi3-win_amd64.whl (268.4 kB view details)

Uploaded CPython 3.9+Windows x86-64

corepy_ai-0.2.4-cp39-abi3-manylinux_2_28_x86_64.whl (12.7 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ x86-64

corepy_ai-0.2.4-cp39-abi3-macosx_11_0_arm64.whl (407.2 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

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

Hashes for corepy_ai-0.2.4.tar.gz
Algorithm Hash digest
SHA256 ac7a99e92feaad867ec9c9cdbfbbd334d0fb16e63acdf34936cd2cdc4b1359e0
MD5 1bd00edcfd9ddc153e821b1304761a07
BLAKE2b-256 b5864c9983e80020916f1da570aee2f54ffa450448458cd7f1cc5699c07ac6ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for corepy_ai-0.2.4.tar.gz:

Publisher: release.yml on ai-foundation-software/corepy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for corepy_ai-0.2.4-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8ab5ab611bd3b0cad2a3e5df4000f60d1ac523e24f805af2f16ad4cc3c750ad9
MD5 cb7f695e1cf7599cad979c8bbcfc73b6
BLAKE2b-256 dc22cf02fd31726cdf347e4d2f798e233c1a51a9e4fd6f84554e158a0a36ff13

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file corepy_ai-0.2.4-cp39-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for corepy_ai-0.2.4-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6ae903ca3b5e32970471ef3b1101042ff372eb900c952d5f13b53fa5b6dc4976
MD5 ab55f7b8a27fc842d9680de0b4f00872
BLAKE2b-256 d7b596fc8259812bd47619c6caaa83bd9b7efe6ea9c1ca83faa065ad5adcbe43

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file corepy_ai-0.2.4-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for corepy_ai-0.2.4-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8d7b580ce07d70b99a34d250b65ad3145eeca1d09e370afbf35973ac7a1ea3d6
MD5 13568f7954a259d428f69ed4c239f25e
BLAKE2b-256 044bfdf8774b421e6fed1f020f40cba2413d9666cdc63e8035066d9e540af35a

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page