Edge & ONNX Deployment
Collection
Edge/on-device deployment: ONNX/ORT/ExecuTorch exports, latency parity, industrial inference for constrained envs. Placeholder until first exports. • 2 items • Updated
A tiny scikit-learn LogisticRegression pipeline (StandardScaler + LR) trained on synthetic tabular features with industrial-energy-flavored names, exported to ONNX for CPU / edge demos.
This model uses fully synthetic data. Feature names (specific_power, vibration_rms, steam_makeup, etc.) are illustrative only. Do not treat predictions as plant savings, control advice, or operational recommendations. Synthetic ≠measured plant outcomes.
| Feature | Description (synthetic) |
|---|---|
specific_power |
Relative specific power |
vibration_rms |
Vibration RMS |
steam_makeup |
Steam makeup rate |
condenser_approach |
Condenser approach |
cooling_tower_delta_t |
Cooling tower delta-T |
boiler_o2_pct |
Boiler Oâ‚‚ % |
Label: intervene (binary)
model.onnx — ONNX graph (opset 12)latency.json — local CPU ORT benchmarktrain_export.py — reproducible train + exportFrom latency.json (1000 single-row inferences, CPUExecutionProvider, warm-up excluded):
| Metric | Value |
|---|---|
| mean_ms | 0.0046 |
| p50_ms | 0.0038 |
| p95_ms | 0.0090 |
| provider | CPUExecutionProvider |
| n_inferences | 1000 |
Numbers above match the committed latency.json from the export run (macOS ARM CPU).
pip install onnxruntime numpy
python - <<'PY'
import json
import numpy as np
import onnxruntime as ort
session = ort.InferenceSession("model.onnx", providers=["CPUExecutionProvider"])
name = session.get_inputs()[0].name
# order: specific_power, vibration_rms, steam_makeup,
# condenser_approach, cooling_tower_delta_t, boiler_o2_pct
x = np.array([[0.9, 3.0, 5.0, 9.0, 11.0, 4.0]], dtype=np.float32)
label, probs = session.run(None, {name: x})
print("label", label, "probs", probs)
print(json.load(open("latency.json"))["mean_ms"], "ms mean")
PY
python3 -m venv .venv-onnx
.venv-onnx/bin/pip install scikit-learn onnx onnxruntime skl2onnx numpy
.venv-onnx/bin/python train_export.py
Seed is fixed (SEED=42).