Skip to main content

ACTx (Accelerated, Computegraph, Tensor, Execution)

PyPI version PyPI downloads Build Codecov License

Platform Wheel code style Python version

"What I cannot create, I do not understand." - Richard Feynman

Driven by this philosophy, this high-performance tensor library was built as a hands-on learning project. It leverages Metal for GPU acceleration, implements dynamic compute graphs for automatic differentiation (autograd), and provides Python bindings for ease of use in machine learning and scientific computing.

Note: While capable of basic tensor operations and gradient computation, this project is intended primarily for educational purposes and is not intended for production-level model building.

Features

  • GPU Acceleration: Utilizes Metal for efficient tensor computation on macOS devices.
  • Dynamic Compute Graphs: Implements dynamic computation graphs for automatic differentiation, similar to autograd, enabling gradient computation for machine learning tasks.
  • Python Bindings: Provides Python bindings for seamless integration with Python-based workflows.
  • High Performance: Optimized for both CPU and GPU execution, ensuring maximum performance across Metal enabled devices.
  • Educational Focus: Aimed at helping users understand the underlying concepts of tensor operations, autograd, and GPU acceleration.

Requirements

  • macOS 10.15+ or iOS 13+ with Metal support
  • Xcode 12+ with Command Line Tools
  • Python 3.x (for Python bindings)
  • CMake 3.x or higher (for building the project)

Installation

From Source

  1. Clone the repository:

    git clone https://github.com/arjunmnath/ACTx.git
    cd ACTx
    
  2. Build the C++/Objective-C++ library:

    Debug build

    cmake --preset debug
    cmake --build build -- -j$(nproc)
    

    Release build

    cmake --preset release
    cmake --build build -- -j$(nproc)
    

    Test build

    cmake --preset test
    cmake --build build -- -j$(nproc)
    

    Run Tests

    ctest --parallel $(nproc) --progress --test-dir build --output-on-failure
    
  3. Install Python bindings:

    pip install .
    

From PyPi

pip install actx

🚧 Only on MacOS at present

Usage

C++/Objective-C++ API

#include "actx.h"

int main() {
    Tensor tensor1 = Tensor::random({3, 3});
    Tensor tensor2 = Tensor::random({3, 3});

    // Define a simple computation
    Tensor result = tensor1 * tensor2;

    // Compute gradients
    result.backward();

    // Access the gradients
    Tensor grad = tensor1.grad();
    grad.print();
    return 0;
}

Python API

import actx

# Create tensors
tensor1 = actx.random((3, 3), requires_grad=True)
tensor2 = actx.random((3, 3), requires_grad=True)

# Define a simple computation
result = tensor1 * tensor2

# Compute gradients
result.backward()

# Access the gradients
grad_tensor1 = tensor1.grad
grad_tensor2 = tensor2.grad

print("Gradient of tensor1:\n", grad_tensor1)
print("Gradient of tensor2:\n", grad_tensor2)

Documentation

No documentation understand it yourself 🤷🏻‍♂️

Contributing

Contributions are welcome! Please read our Contributions Guide before submitting a pull request. If you encounter any issues, feel free to open an issue in the repository.

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

Acknowledgements

  • Metal framework for GPU acceleration
  • Python bindings via c-api
  • Inspired by various tensor libraries such as NumPy and PyTorch, and automatic differentiation systems like autograd.

Metadata

Release files for actx 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for actx 0.1.1
File Size Uploaded Provenance Actions
actx-0.1.1.tar.gz 648.8 kB Without provenance Details for actx-0.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for actx 0.1.1
File Actions
actx-0.1.1-cp312-cp312-macosx_14_0_arm64.whl CPython 3.12 CPython 3.12 macOS 14.0+ ARM64 Details for actx-0.1.1-cp312-cp312-macosx_14_0_arm64.whl
actx-0.1.1-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details for actx-0.1.1-cp311-cp311-macosx_14_0_arm64.whl
actx-0.1.1-cp310-cp310-macosx_14_0_arm64.whl CPython 3.10 CPython 3.10 macOS 14.0+ ARM64 Details for actx-0.1.1-cp310-cp310-macosx_14_0_arm64.whl
actx-0.1.1-cp39-cp39-macosx_14_0_arm64.whl CPython 3.9 CPython 3.9 macOS 14.0+ ARM64 Details for actx-0.1.1-cp39-cp39-macosx_14_0_arm64.whl
actx-0.1.1-cp38-cp38-macosx_14_0_arm64.whl CPython 3.8 CPython 3.8 macOS 14.0+ ARM64 Details for actx-0.1.1-cp38-cp38-macosx_14_0_arm64.whl

Total release size: 1.8 MB

Release files / actx-0.1.1.tar.gz

Download URL actx-0.1.1.tar.gz
Size 648.8 kB
Tags Source
SHA-256 checksum
How to use checksums
33d6baf134c16b35cc54dae4fd87ea06e4b18a7d34e37476c598705b53c9462d
BLAKE2b-256 checksum
How to use checksums
e3abfabe7820d93b99ab84c5a3c3f8a250eaa8b171cd297e06b7d42751ee6519
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / actx-0.1.1-cp312-cp312-macosx_14_0_arm64.whl

Download URL actx-0.1.1-cp312-cp312-macosx_14_0_arm64.whl
Size 224.9 kB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
c35b231de028bbd9ca5a3d70ceda0334a3b698114be7b2577dbeb4c3ec657dcf
BLAKE2b-256 checksum
How to use checksums
8c26af202a9f5a73c45e6f87eadd66cc17b46bd13c367a4749813e4630ae4004
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / actx-0.1.1-cp311-cp311-macosx_14_0_arm64.whl

Download URL actx-0.1.1-cp311-cp311-macosx_14_0_arm64.whl
Size 224.9 kB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
6867f661a2c139111408657fa26055e70fd53b7cbb887e22f83f0498cd5766bd
BLAKE2b-256 checksum
How to use checksums
e2052c97d42cb6a3e70c07a4dfeb88eba0762f13587c8d00dc0da34205880bcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / actx-0.1.1-cp310-cp310-macosx_14_0_arm64.whl

Download URL actx-0.1.1-cp310-cp310-macosx_14_0_arm64.whl
Size 224.9 kB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
59e744b1c95176a5572764d4de4bdb8be2326830a999261fc47fa735e4601815
BLAKE2b-256 checksum
How to use checksums
2d8c6ef5d556abba79714ff708bb4dbe8f6684c20e37daccdfd9e711698082fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / actx-0.1.1-cp39-cp39-macosx_14_0_arm64.whl

Download URL actx-0.1.1-cp39-cp39-macosx_14_0_arm64.whl
Size 224.9 kB
Tags CPython 3.9 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
58924b905f5937338d9e3182361c6bf3a5529c7d38287d90f3504a03573eb674
BLAKE2b-256 checksum
How to use checksums
62812308ca660f918b023ecda8136689ebbcaaa6b1a55174c0a40d071d04df53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / actx-0.1.1-cp38-cp38-macosx_14_0_arm64.whl

Download URL actx-0.1.1-cp38-cp38-macosx_14_0_arm64.whl
Size 224.7 kB
Tags CPython 3.8 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
8b2909f02161115b0aa41cec0297c4035d90be085ac89ca8b80f37b4d38e9522
BLAKE2b-256 checksum
How to use checksums
5cb70e8f0375494c50a8ef1d405c8f8ad5d9cd70719a95a16c17fd5c261b0fb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for actx 0.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

6 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page