Commands
bench
Run a quick synthetic benchmark across five core OchreML workloads on CPU, CUDA, wgpu, or TPU.
ochreml bench runs a self-contained (~1–3s) synthetic benchmark measuring fit_ms and predict_ms across linear models, trees, histogram gradient boosting, and clustering (o´∀`o).
Usage
ochreml bench [--device DEVICE] [--json]Flags
| Flag | Default | Description |
|---|---|---|
--device | auto | Target device (auto, cpu, cuda:0, wgpu, tpu) |
--json | false | Emit structured JSON output |
Included Workloads
Data is generated deterministically (seed=42) in pure Python with zero external dependencies:
| Workload | Shape | Estimator Config |
|---|---|---|
LinearRegression (2000x16) | 2,000 x 16 | Default LinearRegression |
Ridge (2000x16) | 2,000 x 16 | alpha=1.0 |
RandomForestClassifier (1000x12, 15 trees) | 1,000 x 12 | n_estimators=15, max_depth=6 |
HistGradientBoostingRegressor (2000x16, 20 iters) | 2,000 x 16 | max_iter=20 |
KMeans (1000x12, k=4) | 1,000 x 12 | n_clusters=4, max_iter=30 |
Example
ochreml bench --device cpu --jsonExample JSON output:
{
"version": "0.3.7a1",
"requested_device": "cpu",
"available_devices": ["cpu"],
"total_time_sec": 0.412,
"benchmarks": [
{
"workload": "LinearRegression (2000x16)",
"device": "cpu",
"n_samples": 2000,
"n_features": 16,
"fit_ms": 1.42,
"predict_ms": 0.31
}
]
}