Define the prediction contract
Specify input shapes, preprocessing steps, expected output ranges and a success metric such as 95th-percentile inference latency and F1 on holdout telemetry.
Deploy ONNX models. Measure latency and resource use.
An ONNX model deployment pipeline covers converting a trained model to ONNX, validating numeric equivalence, measuring inference latency and memory on target hardware, and adding monitoring and rollback. Key operational concerns include quantisation effects, input preprocessing parity, and drift detection on edge devices.
Learning concept · Not a validated service
An ONNX model deployment pipeline covers converting a trained model to ONNX, validating numeric equivalence, measuring inference latency and memory on target hardware, and adding monitoring and rollback. Key operational concerns include quantisation effects, input preprocessing parity, and drift detection on edge devices.
A proposed extension: serve model predictions from a lightweight ONNX runtime on an edge gateway and send telemetry (latency, error rates, input statistics) to a monitoring service so a human operator can validate behaviour before rolling updates to many devices.
Specify input shapes, preprocessing steps, expected output ranges and a success metric such as 95th-percentile inference latency and F1 on holdout telemetry.
Train a model on representative telemetry, then export to ONNX (including opset and input signatures) and produce a conversion test suite.
Run numeric-equivalence checks, measure latency and memory on the target device or an emulator, and test quantised variants if applicable.
Collect runtime metrics, detect drift or degradations, and implement an automated rollback policy with human-in-the-loop approvals for critical updates.
The supplied starter generates a synthetic classification dataset with sklearn.make_classification, fits a scikit-learn DecisionTreeClassifier, times repeated in-memory predictions on one sample, and prints the measured single-sample latency plus tree depth and node count. It does not export an ONNX model, run an ONNX runtime, or include device deployment code.
X, y = make_classification(n_samples=1000, n_features=12, n_informative=8, random_state=42)
model = DecisionTreeClassifier(max_depth=6, random_state=42)
model.fit(X, y)
sample = X[:1]
start = time.perf_counter()
for _ in range(1000):
model.predict(sample)
latency_ms = (time.perf_counter() - start) * 1000 / 1000The starter uses a synthetic sklearn dataset and a DecisionTreeClassifier but does not perform any ONNX export, conversion, runtime execution, or device-specific measurement. Its latency loop measures Python scikit-learn prediction time on the host process and therefore does not represent ONNX runtime performance or edge-device metrics.
Proposed extension: convert the trained model to ONNX, run it with ONNX Runtime (and a quantised variant) on a target board or emulator, collect latency/memory telemetry via MQTT, and add a dashboard for monitoring and rollout control.
This is a potential application pathway, not a delivered product. The supplied starter does not implement this service or validate it with real users.
Networkers Home runs this topic inside its Network Engineering Course, with placement support and hands-on labs.