Skip to Content
OchreML
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

FlagDefaultDescription
--deviceautoTarget device (auto, cpu, cuda:0, wgpu, tpu)
--jsonfalseEmit structured JSON output

Included Workloads

Data is generated deterministically (seed=42) in pure Python with zero external dependencies:

WorkloadShapeEstimator Config
LinearRegression (2000x16)2,000 x 16Default LinearRegression
Ridge (2000x16)2,000 x 16alpha=1.0
RandomForestClassifier (1000x12, 15 trees)1,000 x 12n_estimators=15, max_depth=6
HistGradientBoostingRegressor (2000x16, 20 iters)2,000 x 16max_iter=20
KMeans (1000x12, k=4)1,000 x 12n_clusters=4, max_iter=30

Example

ochreml bench --device cpu --json

Example 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
    }
  ]
}

On this page