Skip to main content

Fast, CPU-only AI framework for Python developers

Project description

BARX: Fast, CPU-only AI Framework for Python

PyPI version Python versions License

BARX is a high-performance, CPU-only AI framework that enables Python developers to build, train, and run AI models without GPU requirements.

Key Features

  • CPU-only execution: Run models on laptops, edge devices, and servers without GPU dependencies
  • High performance: Rust/SIMD kernels for critical operations deliver optimized performance on CPU
  • Tensors & Neural Networks: Create and manipulate tensors, build neural networks with standard layers
  • Memory efficiency: INT8 quantization for large models keeps memory usage ≤3GB
  • Simple API: Clean, intuitive API inspired by popular deep learning frameworks
  • Pure Python frontend: Easy to understand and extend with a clean Python interface

Installation

pip install barx

Quick Start

# Create and manipulate tensors
from barx.tensor import T
x = T.randn(32, 128)
y = x.dot(x.T)
print(y.mean())

# Define a neural network
from barx.nn import Linear, ReLU, Softmax, Sequential
model = Sequential(
    Linear(128, 64), ReLU(),
    Linear(64, 10), Softmax()
)

# Train with automatic differentiation
from barx.optim import SGD
optimizer = SGD(model.parameters(), lr=0.01)
for epoch in range(5):
    for x, y in data_loader:
        pred = model(x)
        loss = ((pred - y)**2).mean()
        loss.backward()
        optimizer.step()
        optimizer.zero_grad()

Architecture

BARX is designed for simplicity and efficiency:

  • Pure-Python frontend with clear abstractions for tensors and neural networks
  • Rust backends for compute-intensive operations via PyO3 bindings
  • NumPy fallback ensures all operations work even without Rust kernels
  • Automatic differentiation for training neural networks from scratch
  • Efficient memory usage with INT8 quantization support
  • Multi-threading for operations on large tensors

Examples

The examples/ directory contains sample code demonstrating various features:

  • Basic tensor operations
  • Neural network training and inference
  • INT8 quantization for large models

Comparison with Other Frameworks

Feature BARX NumPy PyTorch TensorFlow
GPU Support
CPU Performance ⚠️
Easy Installation ⚠️ ⚠️
Small Footprint
Autograd
Edge Deployment ⚠️ ⚠️ ⚠️

Contributing

Contributions are welcome! Feel free to:

  1. Report bugs or request features via issues
  2. Submit pull requests with improvements
  3. Help with documentation or examples
  4. Share your experience using BARX

License

MIT License

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

barx-0.1.0.tar.gz (34.3 kB view details)

Uploaded Source

Built Distribution

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

barx-0.1.0-cp38-abi3-win_amd64.whl (229.5 kB view details)

Uploaded CPython 3.8+Windows x86-64

File details

Details for the file barx-0.1.0.tar.gz.

File metadata

  • Download URL: barx-0.1.0.tar.gz
  • Upload date:
  • Size: 34.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for barx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a885e467e031b81c6d887fa96d5e6bdd2c4c69d50591413d863906a750adaf30
MD5 32c70f1d6bd3a89af37e4aa7154f2698
BLAKE2b-256 d351af390d8ca7cf661d0576f5de05049d66108ba1760535a8ac06cc3efcf38b

See more details on using hashes here.

File details

Details for the file barx-0.1.0-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: barx-0.1.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 229.5 kB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for barx-0.1.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e8bead4f2c05ecd885914c355f270c4b8962a1f8b3ee8a3c91b3d58c8a4e4af1
MD5 9f6a2578c938b2c69f1097d9a2b56f74
BLAKE2b-256 73fb5546e67f7f3509f7e3d22af11327b748e10a9728281fc9f92ba9d756e165

See more details on using hashes here.

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