⚡ crusoe-estimator
PyTorch Training Cost & Carbon Estimator for Crusoe Cloud
Benchmark your PyTorch training loop locally on a small sample, then get instant estimates for:
- ⏱️ Training time on every Crusoe Cloud GPU (A100, H100, H200, MI300X)
- 💰 Cost on Crusoe Cloud
- 🌍 CO₂ savings — your local emissions vs Crusoe's near-zero carbon footprint
Installation
pip install crusoe-estimator
Or with PyTorch (if not already installed):
pip install "crusoe-estimator[torch]"
Quick Start
Pattern 1: Training Loop Wrapper (Recommended)
from crusoe_estimator import CrusoeEstimator
estimator = CrusoeEstimator(total_epochs=100, location="HR")
for epoch in estimator.epochs(sample=3):
# Your normal training code — runs only 3 epochs
for batch_x, batch_y in train_loader:
optimizer.zero_grad()
output = model(batch_x)
loss = criterion(output, batch_y)
loss.backward()
optimizer.step()
# Generate a beautiful HTML report
estimator.generate_report("training_report.html")
# Or print a text summary
print(estimator.summary())
Pattern 2: Decorator
estimator = CrusoeEstimator(total_epochs=100, location="DE")
@estimator.watch(sample_epochs=3)
def train_epoch(model, dataloader, optimizer, criterion):
for x, y in dataloader:
optimizer.zero_grad()
loss = criterion(model(x), y)
loss.backward()
optimizer.step()
# Calling the decorated function runs 3 epochs and benchmarks
train_epoch(model, train_loader, optimizer, criterion)
estimator.generate_report("report.html")
Pattern 3: Context Manager
estimator = CrusoeEstimator(total_epochs=100, sample_epochs=5, location="US")
with estimator.track():
for epoch in range(5):
train_one_epoch(model, train_loader, optimizer, criterion)
estimator.generate_report("report.html")
Pattern 4: Function Wrapper
estimator = CrusoeEstimator(total_epochs=100, location="HR")
result = estimator.estimate(
train_fn=lambda: train_one_epoch(model, loader, optimizer, criterion),
sample_epochs=3,
)
estimator.generate_report("report.html")
Dataset Scaling
If you benchmark with a smaller dataset:
estimator = CrusoeEstimator(
total_epochs=100,
total_dataset_size=50000,
sample_dataset_size=5000, # Using 10% of data
location="HR",
)
Supported GPUs
Crusoe Cloud
| GPU | FP16 TFLOPS | Memory | Price/hr |
|---|---|---|---|
| A100 80GB | 312 | 80 GB | $1.47 |
| H100 SXM | 989 | 80 GB | $2.25 |
| H200 SXM | 989 | 141 GB | $3.25 |
| MI300X | 1307 | 192 GB | $2.49 |
Local GPU Detection
Automatically detects 50+ GPUs:
- NVIDIA: RTX 20/30/40 series, A100, H100, V100, T4
- AMD: MI300X, MI250X
- Apple Silicon: M1–M4 (all variants)
How It Works
- Detect local GPU and its specifications (FLOPS, memory, TDP)
- Benchmark your training loop for N sample epochs
- Extrapolate total training time using average epoch time
- Scale to Crusoe GPUs using FLOPS ratio (70% compute + 30% memory bandwidth weighting)
- Calculate cost based on Crusoe pricing
- Estimate CO₂ using regional carbon intensity (local) vs near-zero (Crusoe)
- Generate an HTML report with tables, charts, and recommendations
Carbon Intensity
Uses real-world carbon intensity data (kg CO₂/kWh):
- 🇭🇷 Croatia: 0.170
- 🇩🇪 Germany: 0.340
- 🇫🇷 France: 0.056
- 🇺🇸 USA: 0.390
- 🇨🇳 China: 0.560
- ☁️ Crusoe: ≈ 0.000 (renewable energy)
API Reference
CrusoeEstimator
Main class. Constructor parameters:
total_epochs— how many epochs the full training would runsample_epochs— how many epochs to actually benchmark (default: 3)total_dataset_size— full dataset size (optional, for scaling)sample_dataset_size— dataset size used in sample (optional)location— country code for CO₂ calculation (e.g., "HR", "US", "DE")power_watts_override— override auto-detected GPU power draw
Reports
estimator.generate_report("report.html")— HTML reportestimator.summary()— text summary
Built with 💚 at HackEurope 2026 • Powered by Crusoe Cloud
Metadata
Release files for crusoe-estimator 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| crusoe_estimator-0.1.2.tar.gz | 40.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| crusoe_estimator-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 82.0 kB
Release files / crusoe_estimator-0.1.2.tar.gz
| Download URL | crusoe_estimator-0.1.2.tar.gz |
|---|---|
| Size | 40.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
16c434240e5a8ac4d8d6f60c5dc58cbd3c6f1d1d36e306782baaa7af373ac9f4
|
|
BLAKE2b-256 checksum How to use checksums |
4cd4502a4a886b7778cc6ba8f53b5696919a224673715507de27aeaf60003a8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.0
|
Release files / crusoe_estimator-0.1.2-py3-none-any.whl
| Download URL | crusoe_estimator-0.1.2-py3-none-any.whl |
|---|---|
| Size | 41.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cc00bb226e0ac33330b2664ce40504c03d2acba8649d1b8a329142b9d065acaf
|
|
BLAKE2b-256 checksum How to use checksums |
4dd65d490ef1352f06d8f527ffc73363989e1798a88a265d3ee42c0b3f35b4b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.0
|