Chisel CLI - Accelerate your Python functions with cloud GPUs
Project description
Chisel CLI
Accelerate your Python functions with cloud GPUs using a simple decorator.
Quick Start
1. Install Chisel CLI:
pip install chisel-cli
2. Create your script:
from chisel import capture_trace
@capture_trace(trace_name="matrix_ops")
def matrix_multiply(size=1000):
import torch
device = "cuda" if torch.cuda.is_available() else "cpu"
a = torch.randn(size, size, device=device)
b = torch.randn(size, size, device=device)
result = torch.mm(a, b)
return result.cpu().numpy()
if __name__ == "__main__":
result = matrix_multiply(2000)
print(f"Result shape: {result.shape}")
3. Run on cloud GPU:
# Local execution
python my_script.py
# Cloud GPU execution
chisel python my_script.py
4. Interactive setup:
- Chisel CLI prompts for app name, upload directory, requirements file, and GPU configuration
- First-time authentication opens browser automatically
- Real-time job status and output streaming
Features
- Simple decorator: Just add
@capture_trace()to your functions - Local & cloud: Same code runs locally or on cloud GPUs
- Interactive CLI: Guided setup for job configuration
- Real-time streaming: Live output and job status
- GPU profiling: Automatic performance traces and memory analysis
- Multi-GPU support: Scale from 1 to 8x A100-80GB GPUs
Usage
Basic Example
from chisel import capture_trace
@capture_trace(trace_name="my_function")
def my_gpu_function():
import torch
device = "cuda" if torch.cuda.is_available() else "cpu"
return torch.randn(1000, 1000, device=device)
# Runs locally with: python script.py
# Runs on GPU with: chisel python script.py
Multiple Functions
@capture_trace(trace_name="preprocess")
def preprocess(data):
# Data preprocessing
pass
@capture_trace(trace_name="train")
def train(data):
# Model training
pass
@capture_trace(trace_name="evaluate")
def evaluate(data):
# Model evaluation
pass
Command Line Arguments
# Pass arguments to your script
chisel python train.py --epochs 100 --batch-size 32
# Or configure the job directly
chisel python train.py --app-name "training-job" --gpu 4
GPU Options
When prompted by the CLI, choose from:
| Option | GPU Configuration | Memory | Use Case |
|---|---|---|---|
| 1 | 1x A100-80GB | 80GB | Development, inference |
| 2 | 2x A100-80GB | 160GB | Medium training |
| 4 | 4x A100-80GB | 320GB | Large models |
| 8 | 8x A100-80GB | 640GB | Massive models |
Documentation
- Getting Started - Installation and first steps
- API Reference - Complete function reference
- Examples - Working code examples
- Configuration - Setup and optimization
- Troubleshooting - Common issues and solutions
Examples
See the examples directory for working code:
- Basic usage - Matrix operations
- Command line args - Script with arguments
- Deep learning - PyTorch training
- Multi-GPU - Parallel processing
Authentication
Chisel CLI handles authentication automatically:
# First time: Browser opens for authentication
chisel python my_script.py
# Logout to clear credentials
chisel --logout
Credentials are stored securely in ~/.chisel/credentials.json.
Development
# Clone repository
git clone https://github.com/Herdora/chisel.git
cd chisel
# Install in development mode
pip install -e .
# Run tests
pytest
# Check code style
ruff check src/ examples/
Contributing
We welcome contributions! Please see Development Guide for details.
Support
- 📧 Email: contact@herdora.com
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
License
MIT License - see LICENSE 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 Distribution
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 chisel_cli-0.1.33.tar.gz.
File metadata
- Download URL: chisel_cli-0.1.33.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d1958107ff6cde85e8b305e10b600e2e9ca52c0b469a6af0961afa9124318ce
|
|
| MD5 |
d86a072773deb012242aa97100e7eaf4
|
|
| BLAKE2b-256 |
9074b09ba892183e95d54acaaf8d5ed10c9adb38d9e219048a6a63e6366196af
|
File details
Details for the file chisel_cli-0.1.33-py3-none-any.whl.
File metadata
- Download URL: chisel_cli-0.1.33-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a97115d812eba7ecbe02fbd1a42800745f7992f419ca631b8ca1e52c6097211a
|
|
| MD5 |
fe761811a4c07a69d85e40c814060ae7
|
|
| BLAKE2b-256 |
3963925ac5f6adb20a0b6be33fef6789491b27cd28d011f8d426d5aced5d5c0f
|